-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timebounds On Transactions #366
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments (small issues). Then please sign the Contributor License Agreement. Thanks for the contribution!
build/main.go
Outdated
@@ -217,6 +217,11 @@ type Thresholds struct { | |||
High *uint32 | |||
} | |||
|
|||
type Timebounds struct { | |||
Mintime uint64 | |||
Maxtime uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super small thing but can we make it MinTime
and MaxTime
(capital letters)?
build/transaction_test.go
Outdated
It("succeeds", func() { Expect(err).NotTo(HaveOccurred()) }) | ||
It("sets an minimum and maximum timebound on the transaction", func() { | ||
Expect(subject.TX.TimeBounds.MinTime).To(BeEquivalentTo(xdr.Uint64(1521056118))) | ||
Expect(subject.TX.TimeBounds.MaxTime).To(BeEquivalentTo(xdr.Uint64(1521056298))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why not use Equal
instead of BeEquivalentTo
? We don't need conversions here.
Like Equal, BeEquivalentTo uses reflect.DeepEqual to compare ACTUAL with EXPECTED. Unlike Equal, however, BeEquivalentTo will first convert ACTUAL’s type to that of EXPECTED before making the comparison with reflect.DeepEqual.
@bartekn Hi, I've updated it based on your feedback and signed the Contributor License Agreement |
This PR solves the following issue: #350
Basically, passing a lower and upper timebounds on a Transaction in
build
package.