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

txnbuild: Add support for new CAP-21 preconditions. #4303

Merged
merged 19 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions txnbuild/timebounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func (tb *Timebounds) Validate() error {
return nil
}

func (tb *Timebounds) IsEmpty() bool {
return tb == nil || *tb == Timebounds{}
}

Shaptic marked this conversation as resolved.
Show resolved Hide resolved
// NewTimebounds is a factory method that constructs a Timebounds object from a min and max time.
// A Transaction cannot be built unless a Timebounds object is provided through a factory method.
func NewTimebounds(minTime, maxTime int64) Timebounds {
Expand Down
2 changes: 1 addition & 1 deletion txnbuild/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ func NewTransaction(params TransactionParams) (*Transaction, error) {
// to introduce a breaking change by dropping
// `TransactionParams.Timebounds`, nor require users to set up the
// `AdditionalPreconditions`, we need to coalesce the two values here.
if !params.Timebounds.IsEmpty() {
if params.Timebounds != (Timebounds{}) {
err = params.AdditionalPreconditions.SetTimebounds(&params.Timebounds)
if err != nil {
return nil, errors.Wrap(err, "invalid timebounds")
Expand Down