Skip to content
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

Merged
merged 4 commits into from
Mar 15, 2018
Merged

Conversation

YazzyYaz
Copy link
Contributor

This PR solves the following issue: #350

Basically, passing a lower and upper timebounds on a Transaction in build package.

Copy link
Contributor

@bartekn bartekn left a 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
Copy link
Contributor

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)?

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)))
Copy link
Contributor

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.

@YazzyYaz
Copy link
Contributor Author

@bartekn Hi, I've updated it based on your feedback and signed the Contributor License Agreement

@bartekn bartekn merged commit e64c35d into stellar:master Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants