From 6d0f666bcd9e3d329a49eb889749dab22bb1966d Mon Sep 17 00:00:00 2001 From: George Date: Fri, 25 Mar 2022 16:26:16 -0700 Subject: [PATCH] txnbuild: Complete rename, avoid using XDR types in `TransactionParams`. (#4307) * Timebounds -> TimeBounds, Ledgerbounds -> LedgerBounds * Duration -> int64, SignerKey -> string --- clients/horizonclient/examples_test.go | 10 +- clients/horizonclient/main_test.go | 16 +- .../account_sign_signing_address_test.go | 30 +- .../webauth/internal/serve/token_test.go | 2 +- services/friendbot/init_friendbot.go | 2 +- services/friendbot/internal/minion.go | 2 +- .../integration/negative_seq_txsub_test.go | 2 +- .../internal/integration/sponsorship_test.go | 2 +- .../internal/test/integration/integration.go | 2 +- .../configureissuer/configureissuer.go | 2 +- .../internal/serve/api_tx_approve_test.go | 8 +- .../internal/serve/friendbot.go | 2 +- .../internal/serve/tx_approve.go | 2 +- .../internal/serve/tx_approve_test.go | 44 +-- txnbuild/account_merge_test.go | 2 +- txnbuild/allow_trust_test.go | 4 +- txnbuild/bump_sequence_test.go | 2 +- txnbuild/change_trust_test.go | 6 +- txnbuild/clawback_test.go | 6 +- txnbuild/cmd/demo/operations/demo.go | 14 +- txnbuild/create_account_test.go | 4 +- txnbuild/create_claimable_balance_test.go | 2 +- txnbuild/create_passive_offer_test.go | 8 +- txnbuild/example_test.go | 56 ++-- txnbuild/fee_bump_test.go | 16 +- txnbuild/manage_buy_offer_test.go | 10 +- txnbuild/manage_data_test.go | 6 +- txnbuild/manage_offer_test.go | 10 +- txnbuild/operation_test.go | 4 +- txnbuild/path_payment_strict_send_test.go | 10 +- txnbuild/path_payment_test.go | 10 +- txnbuild/payment_test.go | 6 +- txnbuild/preconditions.go | 80 +++-- txnbuild/preconditions_test.go | 48 ++- txnbuild/signers_test.go | 32 +- txnbuild/transaction.go | 13 +- txnbuild/transaction_fee_test.go | 14 +- txnbuild/transaction_test.go | 288 +++++++++--------- 38 files changed, 413 insertions(+), 364 deletions(-) diff --git a/clients/horizonclient/examples_test.go b/clients/horizonclient/examples_test.go index 3494014fab..9ca8596ae7 100644 --- a/clients/horizonclient/examples_test.go +++ b/clients/horizonclient/examples_test.go @@ -1100,7 +1100,7 @@ func ExampleClient_SubmitFeeBumpTransaction() { IncrementSequenceNum: false, Operations: []txnbuild.Operation{&op}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! }, ) if err != nil { @@ -1154,7 +1154,7 @@ func ExampleClient_SubmitFeeBumpTransactionWithOptions() { IncrementSequenceNum: false, Operations: []txnbuild.Operation{&op}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! }, ) if err != nil { @@ -1211,7 +1211,7 @@ func ExampleClient_SubmitTransaction() { IncrementSequenceNum: false, Operations: []txnbuild.Operation{&op}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! }, ) if err != nil { @@ -1253,7 +1253,7 @@ func ExampleClient_SubmitTransactionWithOptions() { IncrementSequenceNum: false, Operations: []txnbuild.Operation{&op}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! }, ) if err != nil { @@ -1295,7 +1295,7 @@ func ExampleClient_SubmitTransactionWithOptions_skip_memo_required_check() { IncrementSequenceNum: false, Operations: []txnbuild.Operation{&op}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, // Use a real timeout in production! }, ) if err != nil { diff --git a/clients/horizonclient/main_test.go b/clients/horizonclient/main_test.go index b1119def12..d42fab46e5 100644 --- a/clients/horizonclient/main_test.go +++ b/clients/horizonclient/main_test.go @@ -146,7 +146,7 @@ func TestCheckMemoRequired(t *testing.T) { IncrementSequenceNum: true, Operations: tc.operations, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) tt.NoError(err) @@ -878,7 +878,7 @@ func TestSubmitTransactionRequest(t *testing.T) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -946,7 +946,7 @@ func TestSubmitTransactionRequestMuxedAccounts(t *testing.T) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -1006,7 +1006,7 @@ func TestSubmitFeeBumpTransaction(t *testing.T) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -1075,7 +1075,7 @@ func TestSubmitTransactionWithOptionsRequest(t *testing.T) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -1168,7 +1168,7 @@ func TestSubmitTransactionWithOptionsRequest(t *testing.T) { Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, Memo: txnbuild.MemoText("HelloWorld"), - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -1202,7 +1202,7 @@ func TestSubmitFeeBumpTransactionWithOptions(t *testing.T) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) @@ -1293,7 +1293,7 @@ func TestSubmitFeeBumpTransactionWithOptions(t *testing.T) { Operations: []txnbuild.Operation{&payment}, BaseFee: txnbuild.MinBaseFee, Memo: txnbuild.MemoText("HelloWorld"), - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 10)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 10)}, }, ) assert.NoError(t, err) diff --git a/exp/services/recoverysigner/internal/serve/account_sign_signing_address_test.go b/exp/services/recoverysigner/internal/serve/account_sign_signing_address_test.go index c7b3289610..4a4a959fcc 100644 --- a/exp/services/recoverysigner/internal/serve/account_sign_signing_address_test.go +++ b/exp/services/recoverysigner/internal/serve/account_sign_signing_address_test.go @@ -350,7 +350,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedButSigningAddressInvalid( }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -412,7 +412,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedOtherSignerSelected(t *te }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -478,7 +478,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxSourceAccountValid(t *t }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -545,7 +545,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxAndOpSourceAccountValid }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -611,7 +611,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxSourceAccountInvalid(t }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -674,7 +674,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedOpSourceAccountInvalid(t }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -738,7 +738,7 @@ func TestAccountSign_signingAddressAccountAuthenticatedTxAndOpSourceAccountInval }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -807,7 +807,7 @@ func TestAccountSign_signingAddressPhoneNumberOwnerAuthenticated(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -879,7 +879,7 @@ func TestAccountSign_signingAddressPhoneNumberOtherAuthenticated(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -951,7 +951,7 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticated(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -1032,7 +1032,7 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticatedOpSourceAccountIsAllow &txnbuild.EndSponsoringFutureReserves{}, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -1109,7 +1109,7 @@ func TestAccountSign_signingAddressEmailOwnerAuthenticatedOpSourceAccountInvalid &txnbuild.EndSponsoringFutureReserves{}, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -1176,7 +1176,7 @@ func TestAccountSign_signingAddressEmailOtherAuthenticated(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -1282,7 +1282,7 @@ func TestAccountSign_signingAddressRejectsFeeBumpTx(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) @@ -1352,7 +1352,7 @@ func TestAccountSign_signingAddressValidContentTypeForm(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimebounds(0, 1)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimebounds(0, 1)}, }, ) require.NoError(t, err) diff --git a/exp/services/webauth/internal/serve/token_test.go b/exp/services/webauth/internal/serve/token_test.go index 367c941b56..7aa41d4b78 100644 --- a/exp/services/webauth/internal/serve/token_test.go +++ b/exp/services/webauth/internal/serve/token_test.go @@ -1139,7 +1139,7 @@ func TestToken_jsonInputNoWebAuthDomainSuccess(t *testing.T) { BaseFee: txnbuild.MinBaseFee, Memo: nil, Preconditions: txnbuild.Preconditions{ - Timebounds: txnbuild.NewTimebounds(txMinTimebounds, txMaxTimebounds), + TimeBounds: txnbuild.NewTimebounds(txMinTimebounds, txMaxTimebounds), }, }, ) diff --git a/services/friendbot/init_friendbot.go b/services/friendbot/init_friendbot.go index 19c45f96b2..ef7a21253c 100644 --- a/services/friendbot/init_friendbot.go +++ b/services/friendbot/init_friendbot.go @@ -120,7 +120,7 @@ func createMinionAccounts(botAccount internal.Account, botKeypair *keypair.Full, IncrementSequenceNum: true, Operations: ops, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { diff --git a/services/friendbot/internal/minion.go b/services/friendbot/internal/minion.go index a27e5a3296..f1f2b1b5ce 100644 --- a/services/friendbot/internal/minion.go +++ b/services/friendbot/internal/minion.go @@ -117,7 +117,7 @@ func (minion *Minion) makeTx(destAddress string) (string, error) { IncrementSequenceNum: true, Operations: []txnbuild.Operation{&createAccountOp}, BaseFee: minion.BaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) if err != nil { diff --git a/services/horizon/internal/integration/negative_seq_txsub_test.go b/services/horizon/internal/integration/negative_seq_txsub_test.go index 572a682e52..787ad0645c 100644 --- a/services/horizon/internal/integration/negative_seq_txsub_test.go +++ b/services/horizon/internal/integration/negative_seq_txsub_test.go @@ -55,7 +55,7 @@ func TestNegativeSequenceTxSubmission(t *testing.T) { SourceAccount: account, Operations: []txnbuild.Operation{&op2}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, IncrementSequenceNum: false, } tx, err := txnbuild.NewTransaction(txParams) diff --git a/services/horizon/internal/integration/sponsorship_test.go b/services/horizon/internal/integration/sponsorship_test.go index af2ae7ea10..d1f3c25d91 100644 --- a/services/horizon/internal/integration/sponsorship_test.go +++ b/services/horizon/internal/integration/sponsorship_test.go @@ -311,7 +311,7 @@ func TestSponsorships(t *testing.T) { SourceAccount: newAccount, Operations: []txnbuild.Operation{preAuthOp}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, IncrementSequenceNum: true, } preaAuthTx, err := txnbuild.NewTransaction(txParams) diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 1a485d2a94..d307301e7a 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -694,7 +694,7 @@ func (i *Test) CreateSignedTransaction( SourceAccount: source, Operations: ops, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, IncrementSequenceNum: true, } diff --git a/services/regulated-assets-approval-server/internal/configureissuer/configureissuer.go b/services/regulated-assets-approval-server/internal/configureissuer/configureissuer.go index ba3cdb8050..5cfa9bed9f 100644 --- a/services/regulated-assets-approval-server/internal/configureissuer/configureissuer.go +++ b/services/regulated-assets-approval-server/internal/configureissuer/configureissuer.go @@ -120,7 +120,7 @@ func setup(opts Options, hClient horizonclient.ClientInterface) error { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) if err != nil { return errors.Wrap(err, "building transaction") diff --git a/services/regulated-assets-approval-server/internal/serve/api_tx_approve_test.go b/services/regulated-assets-approval-server/internal/serve/api_tx_approve_test.go index 47f0af2f13..86c4c1c087 100644 --- a/services/regulated-assets-approval-server/internal/serve/api_tx_approve_test.go +++ b/services/regulated-assets-approval-server/internal/serve/api_tx_approve_test.go @@ -115,7 +115,7 @@ func TestAPI_txApprove_revised(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -235,7 +235,7 @@ func TestAPI_txAprove_actionRequired(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -328,7 +328,7 @@ func TestAPI_txAprove_actionRequiredFlow(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -539,7 +539,7 @@ func TestAPI_txApprove_success(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) txe, err := tx.Base64() diff --git a/services/regulated-assets-approval-server/internal/serve/friendbot.go b/services/regulated-assets-approval-server/internal/serve/friendbot.go index 9adc1b56c2..9e4ad3c228 100644 --- a/services/regulated-assets-approval-server/internal/serve/friendbot.go +++ b/services/regulated-assets-approval-server/internal/serve/friendbot.go @@ -158,7 +158,7 @@ func (h friendbotHandler) topUpAccountWithRegulatedAsset(ctx context.Context, in }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) if err != nil { err = errors.Wrap(err, "building transaction") diff --git a/services/regulated-assets-approval-server/internal/serve/tx_approve.go b/services/regulated-assets-approval-server/internal/serve/tx_approve.go index ff1f9dee00..1eb49ef070 100644 --- a/services/regulated-assets-approval-server/internal/serve/tx_approve.go +++ b/services/regulated-assets-approval-server/internal/serve/tx_approve.go @@ -231,7 +231,7 @@ func (h txApproveHandler) txApprove(ctx context.Context, in txApproveRequest) (r IncrementSequenceNum: true, Operations: revisedOperations, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) if err != nil { return nil, errors.Wrap(err, "building transaction") diff --git a/services/regulated-assets-approval-server/internal/serve/tx_approve_test.go b/services/regulated-assets-approval-server/internal/serve/tx_approve_test.go index fcdb548f45..d6e26c0b68 100644 --- a/services/regulated-assets-approval-server/internal/serve/tx_approve_test.go +++ b/services/regulated-assets-approval-server/internal/serve/tx_approve_test.go @@ -143,7 +143,7 @@ func TestTxApproveHandler_validateInput(t *testing.T) { Sequence: "1", }, IncrementSequenceNum: true, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, BaseFee: 300, Operations: []txnbuild.Operation{ &txnbuild.Payment{ @@ -169,7 +169,7 @@ func TestTxApproveHandler_validateInput(t *testing.T) { Sequence: "1", }, IncrementSequenceNum: true, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, BaseFee: 300, Operations: []txnbuild.Operation{ &txnbuild.BumpSequence{}, @@ -197,7 +197,7 @@ func TestTxApproveHandler_validateInput(t *testing.T) { Sequence: "1", }, IncrementSequenceNum: true, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, BaseFee: 300, Operations: []txnbuild.Operation{ &txnbuild.Payment{ @@ -372,7 +372,7 @@ func TestTxApproveHandler_txApprove_rejected(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -395,7 +395,7 @@ func TestTxApproveHandler_txApprove_rejected(t *testing.T) { &txnbuild.BumpSequence{}, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -425,7 +425,7 @@ func TestTxApproveHandler_txApprove_rejected(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -455,7 +455,7 @@ func TestTxApproveHandler_txApprove_rejected(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -482,7 +482,7 @@ func TestTxApproveHandler_txApprove_rejected(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -569,7 +569,7 @@ func TestTxApproveHandler_txApprove_success(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -631,7 +631,7 @@ func TestTxApproveHandler_txApprove_actionRequired(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -707,7 +707,7 @@ func TestTxApproveHandler_txApprove_revised(t *testing.T) { }, }, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewInfiniteTimeout()}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -785,7 +785,7 @@ func TestValidateTransactionOperationsForSuccess(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -809,7 +809,7 @@ func TestValidateTransactionOperationsForSuccess(t *testing.T) { &txnbuild.BumpSequence{}, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -838,7 +838,7 @@ func TestValidateTransactionOperationsForSuccess(t *testing.T) { &txnbuild.BumpSequence{}, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -887,7 +887,7 @@ func TestValidateTransactionOperationsForSuccess(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -936,7 +936,7 @@ func TestValidateTransactionOperationsForSuccess(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1002,7 +1002,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_revisable(t *testing.T) }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1066,7 +1066,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_rejected(t *testing.T) { &txnbuild.BumpSequence{}, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1114,7 +1114,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_rejected(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1163,7 +1163,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_rejected(t *testing.T) { IncrementSequenceNum: true, Operations: compliantOps, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1247,7 +1247,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_actionRequired(t *testin }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) @@ -1386,7 +1386,7 @@ func TestTxApproveHandler_handleSuccessResponseIfNeeded_success(t *testing.T) { }, }, BaseFee: 300, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }) require.NoError(t, err) diff --git a/txnbuild/account_merge_test.go b/txnbuild/account_merge_test.go index 7ee237acf4..9e5f70315a 100644 --- a/txnbuild/account_merge_test.go +++ b/txnbuild/account_merge_test.go @@ -18,7 +18,7 @@ func TestAccountMergeValidate(t *testing.T) { TransactionParams{ SourceAccount: &sourceAccount, Operations: []Operation{&accountMerge}, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, }, ) diff --git a/txnbuild/allow_trust_test.go b/txnbuild/allow_trust_test.go index 7bb0f68979..60f811128a 100644 --- a/txnbuild/allow_trust_test.go +++ b/txnbuild/allow_trust_test.go @@ -22,7 +22,7 @@ func TestAllowTrustValidateAsset(t *testing.T) { TransactionParams{ SourceAccount: &sourceAccount, Operations: []Operation{&allowTrust}, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, }, ) @@ -48,7 +48,7 @@ func TestAllowTrustValidateTrustor(t *testing.T) { TransactionParams{ SourceAccount: &sourceAccount, Operations: []Operation{&allowTrust}, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, }, ) diff --git a/txnbuild/bump_sequence_test.go b/txnbuild/bump_sequence_test.go index 844a7200fc..f29250f976 100644 --- a/txnbuild/bump_sequence_test.go +++ b/txnbuild/bump_sequence_test.go @@ -18,7 +18,7 @@ func TestBumpSequenceValidate(t *testing.T) { TransactionParams{ SourceAccount: &sourceAccount, Operations: []Operation{&bumpSequence}, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, }, ) diff --git a/txnbuild/change_trust_test.go b/txnbuild/change_trust_test.go index 8d56b05ede..88484ed3a1 100644 --- a/txnbuild/change_trust_test.go +++ b/txnbuild/change_trust_test.go @@ -21,7 +21,7 @@ func TestChangeTrustMaxLimit(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -46,7 +46,7 @@ func TestChangeTrustValidateInvalidAsset(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -70,7 +70,7 @@ func TestChangeTrustValidateInvalidLimit(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/clawback_test.go b/txnbuild/clawback_test.go index a8e020f1ef..62b9bac12f 100644 --- a/txnbuild/clawback_test.go +++ b/txnbuild/clawback_test.go @@ -22,7 +22,7 @@ func TestClawbackValidateFrom(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&clawback}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -47,7 +47,7 @@ func TestClawbackValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&clawback}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -72,7 +72,7 @@ func TestClawbackValidateAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&clawback}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/cmd/demo/operations/demo.go b/txnbuild/cmd/demo/operations/demo.go index 2b8fa49462..d7a74ef3b3 100644 --- a/txnbuild/cmd/demo/operations/demo.go +++ b/txnbuild/cmd/demo/operations/demo.go @@ -215,7 +215,7 @@ func bumpSequence(source *hProtocol.Account, seqNum int64, signer Account) (stri IncrementSequenceNum: true, Operations: []txnbuild.Operation{&bumpSequenceOp}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -245,7 +245,7 @@ func createAccount(source *hProtocol.Account, dest string, signer Account) (stri IncrementSequenceNum: true, Operations: []txnbuild.Operation{&createAccountOp}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -274,7 +274,7 @@ func deleteData(source *hProtocol.Account, dataKey string, signer Account) (stri IncrementSequenceNum: true, Operations: []txnbuild.Operation{&manageDataOp}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -305,7 +305,7 @@ func payment(source *hProtocol.Account, dest, amount string, asset txnbuild.Asse IncrementSequenceNum: true, Operations: []txnbuild.Operation{&paymentOp}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -332,7 +332,7 @@ func deleteTrustline(source *hProtocol.Account, asset txnbuild.ChangeTrustAsset, IncrementSequenceNum: true, Operations: []txnbuild.Operation{&deleteTrustline}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -362,7 +362,7 @@ func deleteOffer(source *hProtocol.Account, offerID int64, signer Account) (stri IncrementSequenceNum: true, Operations: []txnbuild.Operation{&deleteOffer}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { @@ -391,7 +391,7 @@ func mergeAccount(source *hProtocol.Account, destAddress string, signer Account) IncrementSequenceNum: true, Operations: []txnbuild.Operation{&accountMerge}, BaseFee: txnbuild.MinBaseFee, - Preconditions: txnbuild.Preconditions{Timebounds: txnbuild.NewTimeout(300)}, + Preconditions: txnbuild.Preconditions{TimeBounds: txnbuild.NewTimeout(300)}, }, ) if err != nil { diff --git a/txnbuild/create_account_test.go b/txnbuild/create_account_test.go index a8a9003705..a5b3b62628 100644 --- a/txnbuild/create_account_test.go +++ b/txnbuild/create_account_test.go @@ -21,7 +21,7 @@ func TestCreateAccountValidateDestination(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -45,7 +45,7 @@ func TestCreateAccountValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) diff --git a/txnbuild/create_claimable_balance_test.go b/txnbuild/create_claimable_balance_test.go index 46e2e94cbf..7fe949be02 100644 --- a/txnbuild/create_claimable_balance_test.go +++ b/txnbuild/create_claimable_balance_test.go @@ -78,7 +78,7 @@ func TestClaimableBalanceID(t *testing.T) { SourceAccount: &aAccount, IncrementSequenceNum: true, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&claimableBalanceEntry}, }, ) diff --git a/txnbuild/create_passive_offer_test.go b/txnbuild/create_passive_offer_test.go index b09b05b74e..60c03083ca 100644 --- a/txnbuild/create_passive_offer_test.go +++ b/txnbuild/create_passive_offer_test.go @@ -25,7 +25,7 @@ func TestCreatePassiveSellOfferValidateBuyingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -52,7 +52,7 @@ func TestCreatePassiveSellOfferValidateSellingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -79,7 +79,7 @@ func TestCreatePassiveSellOfferValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -106,7 +106,7 @@ func TestCreatePassiveSellOfferValidatePrice(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/example_test.go b/txnbuild/example_test.go index 614240125c..3aab258ab9 100644 --- a/txnbuild/example_test.go +++ b/txnbuild/example_test.go @@ -27,7 +27,7 @@ func ExampleInflation() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -60,7 +60,7 @@ func ExampleCreateAccount() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -94,7 +94,7 @@ func ExamplePayment() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -138,7 +138,7 @@ func ExamplePayment_setBaseFee() { IncrementSequenceNum: true, Operations: []Operation{&op1, &op2}, BaseFee: feeStats.MaxFee.P50, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -170,7 +170,7 @@ func ExampleBumpSequence() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -202,7 +202,7 @@ func ExampleAccountMerge() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -235,7 +235,7 @@ func ExampleManageData() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -267,7 +267,7 @@ func ExampleManageData_removeDataEntry() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -307,7 +307,7 @@ func ExampleSetOptions() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -343,7 +343,7 @@ func ExampleChangeTrust() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -373,7 +373,7 @@ func ExampleChangeTrust_removeTrustline() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -407,7 +407,7 @@ func ExampleAllowTrust() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -441,7 +441,7 @@ func ExampleManageSellOffer() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -473,7 +473,7 @@ func ExampleManageSellOffer_deleteOffer() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -508,7 +508,7 @@ func ExampleManageSellOffer_updateOffer() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -543,7 +543,7 @@ func ExampleCreatePassiveSellOffer() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -581,7 +581,7 @@ func ExamplePathPayment() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -619,7 +619,7 @@ func ExamplePathPaymentStrictReceive() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -657,7 +657,7 @@ func ExamplePathPaymentStrictSend() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -693,7 +693,7 @@ func ExampleManageBuyOffer() { IncrementSequenceNum: true, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -726,7 +726,7 @@ func ExampleFeeBumpTransaction() { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, // Use a real timeout in production! + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, // Use a real timeout in production! }, ) check(err) @@ -800,7 +800,7 @@ func ExampleCreateClaimableBalance() { SourceAccount: &aAccount, IncrementSequenceNum: true, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&claimableBalanceEntry}, }, ) @@ -828,7 +828,7 @@ func ExampleClaimClaimableBalance() { SourceAccount: &aAccount, // or Account B, depending on the condition! IncrementSequenceNum: true, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&claimBalance}, }, network.TestNetworkPassphrase, @@ -894,7 +894,7 @@ func ExampleBeginSponsoringFutureReserves() { TransactionParams{ SourceAccount: &test.Aaccount, Operations: sponsorTrustline, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, IncrementSequenceNum: true, }, @@ -935,7 +935,7 @@ func ExampleBeginSponsoringFutureReserves_transfer() { TransactionParams{ SourceAccount: &test.S1account, Operations: transferOps, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, IncrementSequenceNum: true, }, @@ -982,7 +982,7 @@ func ExampleRevokeSponsorship() { TransactionParams{ SourceAccount: &test.S2account, Operations: revokeOps, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, IncrementSequenceNum: true, }, @@ -1051,7 +1051,7 @@ func ExampleLiquidityPoolDeposit() { TransactionParams{ SourceAccount: &test.AAccount, Operations: depositOps, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, IncrementSequenceNum: true, }, @@ -1086,7 +1086,7 @@ func ExampleLiquidityPoolWithdraw() { TransactionParams{ SourceAccount: &test.AAccount, Operations: withdrawOps, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, IncrementSequenceNum: true, }, diff --git a/txnbuild/fee_bump_test.go b/txnbuild/fee_bump_test.go index d9b2d64f4c..36c5c71def 100644 --- a/txnbuild/fee_bump_test.go +++ b/txnbuild/fee_bump_test.go @@ -25,7 +25,7 @@ func TestFeeBumpInvalidFeeSource(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -51,7 +51,7 @@ func TestFeeBumpUpgradesV0Transaction(t *testing.T) { Operations: []Operation{&Inflation{}}, BaseFee: 2 * MinBaseFee, Memo: MemoText("test-memo"), - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -105,7 +105,7 @@ func TestFeeBumpInvalidInnerTransactionType(t *testing.T) { Operations: []Operation{&Inflation{}}, BaseFee: 2 * MinBaseFee, Memo: MemoText("test-memo"), - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -143,7 +143,7 @@ func TestFeeBumpAllowsFeeAccountToEqualInnerSourceAccount(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -202,7 +202,7 @@ func TestFeeBumpSignWithKeyString(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -257,7 +257,7 @@ func TestFeeBumpSignHashX(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -300,7 +300,7 @@ func TestFeeBumpAddSignatureBase64(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -363,7 +363,7 @@ func TestFeeBumpMuxedAccounts(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) diff --git a/txnbuild/manage_buy_offer_test.go b/txnbuild/manage_buy_offer_test.go index d244dfde4d..86422436e2 100644 --- a/txnbuild/manage_buy_offer_test.go +++ b/txnbuild/manage_buy_offer_test.go @@ -28,7 +28,7 @@ func TestManageBuyOfferValidateSellingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -56,7 +56,7 @@ func TestManageBuyOfferValidateBuyingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -84,7 +84,7 @@ func TestManageBuyOfferValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -112,7 +112,7 @@ func TestManageBuyOfferValidatePrice(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -140,7 +140,7 @@ func TestManageBuyOfferValidateOfferID(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/manage_data_test.go b/txnbuild/manage_data_test.go index f4b4b0049c..19ac76f390 100644 --- a/txnbuild/manage_data_test.go +++ b/txnbuild/manage_data_test.go @@ -22,7 +22,7 @@ func TestManageDataValidateName(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -46,7 +46,7 @@ func TestManageDataValidateValue(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -88,7 +88,7 @@ func TestManageDataRoundTrip(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) diff --git a/txnbuild/manage_offer_test.go b/txnbuild/manage_offer_test.go index 2c77eaa193..d2447b0d99 100644 --- a/txnbuild/manage_offer_test.go +++ b/txnbuild/manage_offer_test.go @@ -26,7 +26,7 @@ func TestManageSellOfferValidateSellingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -52,7 +52,7 @@ func TestManageSellOfferValidateBuyingAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -78,7 +78,7 @@ func TestManageSellOfferValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -104,7 +104,7 @@ func TestManageSellOfferValidatePrice(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -132,7 +132,7 @@ func TestManageSellOfferValidateOfferID(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&mso}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/operation_test.go b/txnbuild/operation_test.go index 3922817a85..1fe40dea4c 100644 --- a/txnbuild/operation_test.go +++ b/txnbuild/operation_test.go @@ -56,7 +56,7 @@ func TestZeroBalanceAccount(t *testing.T) { Operations: ops, IncrementSequenceNum: true, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) @@ -466,7 +466,7 @@ func testOperationsMarshallingRoundtrip(t *testing.T, operations []Operation, wi TransactionParams{ SourceAccount: &sourceAccount, Operations: operations, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, BaseFee: MinBaseFee, }, ) diff --git a/txnbuild/path_payment_strict_send_test.go b/txnbuild/path_payment_strict_send_test.go index c06dc2f129..7e0a97da77 100644 --- a/txnbuild/path_payment_strict_send_test.go +++ b/txnbuild/path_payment_strict_send_test.go @@ -27,7 +27,7 @@ func TestPathPaymentStrictSendValidateSendAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -57,7 +57,7 @@ func TestPathPaymentStrictSendValidateDestAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -87,7 +87,7 @@ func TestPathPaymentStrictSendValidateDestination(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -117,7 +117,7 @@ func TestPathPaymentStrictSendValidateSendMax(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) @@ -148,7 +148,7 @@ func TestPathPaymentStrictSendValidateDestAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/path_payment_test.go b/txnbuild/path_payment_test.go index 0bc7155892..5e3ae7b980 100644 --- a/txnbuild/path_payment_test.go +++ b/txnbuild/path_payment_test.go @@ -27,7 +27,7 @@ func TestPathPaymentValidateSendAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) @@ -58,7 +58,7 @@ func TestPathPaymentValidateDestAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -88,7 +88,7 @@ func TestPathPaymentValidateDestination(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -118,7 +118,7 @@ func TestPathPaymentValidateSendMax(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -148,7 +148,7 @@ func TestPathPaymentValidateDestAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/payment_test.go b/txnbuild/payment_test.go index 95eb6ad792..4ee33e8871 100644 --- a/txnbuild/payment_test.go +++ b/txnbuild/payment_test.go @@ -22,7 +22,7 @@ func TestPaymentValidateDestination(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -47,7 +47,7 @@ func TestPaymentValidateAmount(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { @@ -72,7 +72,7 @@ func TestPaymentValidateAsset(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) if assert.Error(t, err) { diff --git a/txnbuild/preconditions.go b/txnbuild/preconditions.go index 1251785d3a..76015c9335 100644 --- a/txnbuild/preconditions.go +++ b/txnbuild/preconditions.go @@ -7,36 +7,37 @@ import ( // Preconditions is a container for all transaction preconditions. type Preconditions struct { - // Transaction is only valid during a certain time range. - Timebounds TimeBounds + // Transaction is only valid during a certain time range (units are seconds). + TimeBounds TimeBounds // Transaction is valid for ledger numbers n such that minLedger <= n < // maxLedger (if maxLedger == 0, then only minLedger is checked) - Ledgerbounds *LedgerBounds + LedgerBounds *LedgerBounds // If nil, the transaction is only valid when sourceAccount's sequence // number "N" is seqNum - 1. Otherwise, valid when N satisfies minSeqNum <= // N < tx.seqNum. MinSequenceNumber *int64 // Transaction is valid if the current ledger time is at least - // minSequenceNumberAge greater than the source account's seqTime. - MinSequenceNumberAge xdr.Duration + // minSequenceNumberAge greater than the source account's seqTime (units are + // seconds). + MinSequenceNumberAge int64 // Transaction is valid if the current ledger number is at least // minSequenceNumberLedgerGap greater than the source account's seqLedger. MinSequenceNumberLedgerGap uint32 // Transaction is valid if there is a signature corresponding to every // Signer in this array, even if the signature is not otherwise required by // the source account or operations. - ExtraSigners []xdr.SignerKey + ExtraSigners []string } // Validate ensures that all enabled preconditions are valid. func (cond *Preconditions) Validate() error { var err error - if err = cond.Timebounds.Validate(); err != nil { + if err = cond.TimeBounds.Validate(); err != nil { return err } - if err = cond.Ledgerbounds.Validate(); err != nil { + if err = cond.LedgerBounds.Validate(); err != nil { return err } @@ -50,28 +51,38 @@ func (cond *Preconditions) Validate() error { // BuildXDR will create a precondition structure that varies depending on // whether or not there are additional preconditions besides timebounds (which // are required). -func (cond *Preconditions) BuildXDR() xdr.Preconditions { +func (cond *Preconditions) BuildXDR() (xdr.Preconditions, error) { xdrCond := xdr.Preconditions{} xdrTimeBounds := xdr.TimeBounds{ - MinTime: xdr.TimePoint(cond.Timebounds.MinTime), - MaxTime: xdr.TimePoint(cond.Timebounds.MaxTime), + MinTime: xdr.TimePoint(cond.TimeBounds.MinTime), + MaxTime: xdr.TimePoint(cond.TimeBounds.MaxTime), } // Only build PRECOND_V2 structure if we need to if cond.hasV2Conditions() { xdrPrecond := xdr.PreconditionsV2{ TimeBounds: &xdrTimeBounds, - MinSeqAge: cond.MinSequenceNumberAge, + MinSeqAge: xdr.Duration(cond.MinSequenceNumberAge), MinSeqLedgerGap: xdr.Uint32(cond.MinSequenceNumberLedgerGap), - ExtraSigners: cond.ExtraSigners, // should we copy? + } + + if len(cond.ExtraSigners) > 0 { + xdrPrecond.ExtraSigners = make([]xdr.SignerKey, len(cond.ExtraSigners)) + for i, signer := range cond.ExtraSigners { + signerKey := xdr.SignerKey{} + if err := signerKey.SetAddress(signer); err != nil { + return xdr.Preconditions{}, errors.Wrap(err, "invalid signer") + } + xdrPrecond.ExtraSigners[i] = signerKey + } } // micro-optimization: if the ledgerbounds will always succeed, omit them - if cond.Ledgerbounds != nil && !(cond.Ledgerbounds.MinLedger == 0 && - cond.Ledgerbounds.MaxLedger == 0) { + if cond.LedgerBounds != nil && !(cond.LedgerBounds.MinLedger == 0 && + cond.LedgerBounds.MaxLedger == 0) { xdrPrecond.LedgerBounds = &xdr.LedgerBounds{ - MinLedger: xdr.Uint32(cond.Ledgerbounds.MinLedger), - MaxLedger: xdr.Uint32(cond.Ledgerbounds.MaxLedger), + MinLedger: xdr.Uint32(cond.LedgerBounds.MinLedger), + MaxLedger: xdr.Uint32(cond.LedgerBounds.MaxLedger), } } @@ -87,16 +98,17 @@ func (cond *Preconditions) BuildXDR() xdr.Preconditions { xdrCond.TimeBounds = &xdrTimeBounds } - return xdrCond + return xdrCond, nil } // FromXDR fills in the precondition structure from an xdr.Precondition. -func (cond *Preconditions) FromXDR(precondXdr xdr.Preconditions) { +func (cond *Preconditions) FromXDR(precondXdr xdr.Preconditions) error { *cond = Preconditions{} // reset existing values switch precondXdr.Type { + case xdr.PreconditionTypePrecondNone: case xdr.PreconditionTypePrecondTime: - cond.Timebounds = NewTimebounds( + cond.TimeBounds = NewTimebounds( int64(precondXdr.MustTimeBounds().MinTime), int64(precondXdr.MustTimeBounds().MaxTime), ) @@ -105,14 +117,14 @@ func (cond *Preconditions) FromXDR(precondXdr xdr.Preconditions) { inner := precondXdr.MustV2() if inner.TimeBounds != nil { - cond.Timebounds = NewTimebounds( + cond.TimeBounds = NewTimebounds( int64(inner.TimeBounds.MinTime), int64(inner.TimeBounds.MaxTime), ) } if inner.LedgerBounds != nil { - cond.Ledgerbounds = &LedgerBounds{ + cond.LedgerBounds = &LedgerBounds{ MinLedger: uint32(inner.LedgerBounds.MinLedger), MaxLedger: uint32(inner.LedgerBounds.MaxLedger), } @@ -123,21 +135,33 @@ func (cond *Preconditions) FromXDR(precondXdr xdr.Preconditions) { cond.MinSequenceNumber = &minSeqNum } - cond.MinSequenceNumberAge = inner.MinSeqAge + cond.MinSequenceNumberAge = int64(inner.MinSeqAge) cond.MinSequenceNumberLedgerGap = uint32(inner.MinSeqLedgerGap) - cond.ExtraSigners = append(cond.ExtraSigners, inner.ExtraSigners...) + if len(inner.ExtraSigners) > 0 { + cond.ExtraSigners = make([]string, len(inner.ExtraSigners)) + for i, signerKey := range inner.ExtraSigners { + signer, err := signerKey.GetAddress() + if err != nil { + return err + } + cond.ExtraSigners[i] = signer + } + } - case xdr.PreconditionTypePrecondNone: - default: // panic? + default: + return errors.New("unsupported precondition type: " + + precondXdr.Type.String()) } + + return nil } // hasV2Conditions determines whether or not this has conditions on top of // the (required) timebound precondition. func (cond *Preconditions) hasV2Conditions() bool { - return (cond.Ledgerbounds != nil || + return (cond.LedgerBounds != nil || cond.MinSequenceNumber != nil || - cond.MinSequenceNumberAge > xdr.Duration(0) || + cond.MinSequenceNumberAge > 0 || cond.MinSequenceNumberLedgerGap > 0 || len(cond.ExtraSigners) > 0) } diff --git a/txnbuild/preconditions_test.go b/txnbuild/preconditions_test.go index 9757f1317f..0ff1c28060 100644 --- a/txnbuild/preconditions_test.go +++ b/txnbuild/preconditions_test.go @@ -16,7 +16,7 @@ var signers = []xdr.SignerKey{ // TestPreconditionClassification ensures that Preconditions will correctly // differentiate V1 (timebounds-only) or V2 (all other) preconditions correctly. func TestPreconditionClassification(t *testing.T) { - tbpc := Preconditions{Timebounds: NewTimebounds(1, 2)} + tbpc := Preconditions{TimeBounds: NewTimebounds(1, 2)} assert.False(t, (&Preconditions{}).hasV2Conditions()) assert.False(t, tbpc.hasV2Conditions()) @@ -24,20 +24,30 @@ func TestPreconditionClassification(t *testing.T) { assert.True(t, tbpc.hasV2Conditions()) } -// TestPreconditionValidation ensures that validation fails when necessary. +// TestPreconditionValidation ensures that errors occur when necessary. func TestPreconditionValidation(t *testing.T) { + t.Run("invalid signer", func(t *testing.T) { + pc := Preconditions{ + TimeBounds: NewTimebounds(27, 42), + ExtraSigners: []string{"literally just some nonsense"}, + } + + _, err := pc.BuildXDR() + assert.Error(t, err) + }) + t.Run("too many signers", func(t *testing.T) { pc := Preconditions{ - Timebounds: NewTimebounds(27, 42), - ExtraSigners: signers, + TimeBounds: NewTimebounds(27, 42), + ExtraSigners: signerKeysToStrings(signers), } assert.Error(t, pc.Validate()) }) t.Run("nonsense ledgerbounds", func(t *testing.T) { - pc := Preconditions{Timebounds: NewTimebounds(27, 42)} - pc.Ledgerbounds = &LedgerBounds{MinLedger: 42, MaxLedger: 1} + pc := Preconditions{TimeBounds: NewTimebounds(27, 42)} + pc.LedgerBounds = &LedgerBounds{MinLedger: 42, MaxLedger: 1} assert.Error(t, pc.Validate()) }) } @@ -66,7 +76,7 @@ func TestPreconditionEncoding(t *testing.T) { MinTime: xdr.TimePoint(1), MaxTime: xdr.TimePoint(2), }, - }, Preconditions{Timebounds: NewTimebounds(1, 2)} + }, Preconditions{TimeBounds: NewTimebounds(1, 2)} }, }, { @@ -74,7 +84,7 @@ func TestPreconditionEncoding(t *testing.T) { func() (xdr.Preconditions, Preconditions) { xdrPc, pc := createPreconditionFixtures() xdrPc.V2.LedgerBounds.MaxLedger = 0 - pc.Ledgerbounds.MaxLedger = 0 + pc.LedgerBounds.MaxLedger = 0 return xdrPc, pc }, }, @@ -83,7 +93,7 @@ func TestPreconditionEncoding(t *testing.T) { func() (xdr.Preconditions, Preconditions) { xdrPc, pc := createPreconditionFixtures() xdrPc.V2.LedgerBounds = nil - pc.Ledgerbounds = nil + pc.LedgerBounds = nil return xdrPc, pc }, }, @@ -114,7 +124,9 @@ func TestPreconditionEncoding(t *testing.T) { expectedBytes, err := xdrPrecond.MarshalBinary() assert.NoError(t, err) - actualBytes, err := precond.BuildXDR().MarshalBinary() + encodedPrecond, err := precond.BuildXDR() + assert.NoError(t, err) + actualBytes, err := encodedPrecond.MarshalBinary() assert.NoError(t, err) // building the struct should result in identical XDR! @@ -156,13 +168,21 @@ func createPreconditionFixtures() (xdr.Preconditions, Preconditions) { }, } pc := Preconditions{ - Timebounds: NewTimebounds(27, 42), - Ledgerbounds: &LedgerBounds{27, 42}, + TimeBounds: NewTimebounds(27, 42), + LedgerBounds: &LedgerBounds{27, 42}, MinSequenceNumber: &seqNum, - MinSequenceNumberAge: xdr.Duration(27), + MinSequenceNumberAge: 27, MinSequenceNumberLedgerGap: 42, - ExtraSigners: []xdr.SignerKey{signers[0]}, + ExtraSigners: []string{signers[0].Address()}, } return xdrCond, pc } + +func signerKeysToStrings(signerKeys []xdr.SignerKey) []string { + strSigners := make([]string, len(signers)) + for i, signerKey := range signers { + strSigners[i] = signerKey.Address() + } + return strSigners +} diff --git a/txnbuild/signers_test.go b/txnbuild/signers_test.go index 35f1d28667..24985824e2 100644 --- a/txnbuild/signers_test.go +++ b/txnbuild/signers_test.go @@ -29,7 +29,7 @@ func TestAccountMergeMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&accountMerge}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -60,7 +60,7 @@ func TestAllowTrustMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&allowTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -88,7 +88,7 @@ func TestBumpSequenceMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&bumpSequence}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -117,7 +117,7 @@ func TestChangeTrustMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -146,7 +146,7 @@ func TestCreateAccountMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -177,7 +177,7 @@ func TestCreatePassiveSellOfferMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -204,7 +204,7 @@ func TestInflationMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -233,7 +233,7 @@ func TestManageDataMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -262,7 +262,7 @@ func TestManageOfferCreateMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -289,7 +289,7 @@ func TestManageOfferDeleteMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&deleteOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -319,7 +319,7 @@ func TestManageOfferUpdateMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&updateOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -353,7 +353,7 @@ func TestPathPaymentMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -384,7 +384,7 @@ func TestPaymentMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -412,7 +412,7 @@ func TestSetOptionsMultSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -462,7 +462,7 @@ func TestSigningImmutability(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, } root, err := NewTransaction(params) assert.NoError(t, err) @@ -513,7 +513,7 @@ func TestFeeBumpSigningImmutability(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, } inner, err := NewTransaction(innerParams) assert.NoError(t, err) diff --git a/txnbuild/transaction.go b/txnbuild/transaction.go index 8c861bd430..cad615e493 100644 --- a/txnbuild/transaction.go +++ b/txnbuild/transaction.go @@ -242,7 +242,7 @@ func (t *Transaction) Memo() Memo { // Timebounds returns the Timebounds configured for this transaction. func (t *Transaction) Timebounds() TimeBounds { - return t.preconditions.Timebounds + return t.preconditions.TimeBounds } // Operations returns the list of operations included in this transaction. @@ -855,6 +855,11 @@ func NewTransaction(params TransactionParams) (*Transaction, error) { return nil, errors.Wrap(err, "invalid preconditions") } + precondXdr, err := tx.preconditions.BuildXDR() + if err != nil { + return nil, errors.Wrap(err, "invalid preconditions") + } + envelope := xdr.TransactionEnvelope{ Type: xdr.EnvelopeTypeEnvelopeTypeTx, V1: &xdr.TransactionV1Envelope{ @@ -862,7 +867,7 @@ func NewTransaction(params TransactionParams) (*Transaction, error) { SourceAccount: sourceAccount, Fee: xdr.Uint32(tx.maxFee), SeqNum: xdr.SequenceNumber(sequence), - Cond: tx.preconditions.BuildXDR(), + Cond: precondXdr, }, Signatures: nil, }, @@ -909,7 +914,7 @@ func convertToV1(tx *Transaction) (*Transaction, error) { Operations: tx.Operations(), BaseFee: tx.BaseFee(), Memo: tx.Memo(), - Preconditions: Preconditions{Timebounds: tx.Timebounds()}, + Preconditions: Preconditions{TimeBounds: tx.Timebounds()}, }) if err != nil { return tx, err @@ -1048,7 +1053,7 @@ func BuildChallengeTx(serverSignerSecret, clientAccountID, webAuthDomain, homeDo BaseFee: MinBaseFee, Memo: nil, Preconditions: Preconditions{ - Timebounds: NewTimebounds(currentTime.Unix(), maxTime.Unix()), + TimeBounds: NewTimebounds(currentTime.Unix(), maxTime.Unix()), }, }, ) diff --git a/txnbuild/transaction_fee_test.go b/txnbuild/transaction_fee_test.go index b1d1114b3c..04dd989fef 100644 --- a/txnbuild/transaction_fee_test.go +++ b/txnbuild/transaction_fee_test.go @@ -16,7 +16,7 @@ func TestBaseFeeCanBeZeroOrPositive(t *testing.T) { SourceAccount: &SimpleAccount{keypair.MustRandom().Address(), 1}, Operations: []Operation{&Inflation{}}, BaseFee: bf, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -30,7 +30,7 @@ func TestBaseFeeErrorWhenNegative(t *testing.T) { SourceAccount: &SimpleAccount{keypair.MustRandom().Address(), 1}, Operations: []Operation{&Inflation{}}, BaseFee: -1, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.EqualError(t, err, "base fee cannot be negative") @@ -45,7 +45,7 @@ func TestFeeBumpMinBaseFee(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -70,7 +70,7 @@ func TestFeeOverflow(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}, &Inflation{}}, BaseFee: math.MaxUint32 / 2, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -80,7 +80,7 @@ func TestFeeOverflow(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}, &Inflation{}, &Inflation{}}, BaseFee: math.MaxUint32 / 2, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.EqualError(t, err, "base fee 2147483647 results in an overflow of max fee") @@ -95,7 +95,7 @@ func TestFeeBumpOverflow(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -128,7 +128,7 @@ func TestFeeBumpFeeGreaterThanOrEqualInner(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{&Inflation{}}, BaseFee: 2 * MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) diff --git a/txnbuild/transaction_test.go b/txnbuild/transaction_test.go index 70f5d366a7..b813dd8b95 100644 --- a/txnbuild/transaction_test.go +++ b/txnbuild/transaction_test.go @@ -39,10 +39,10 @@ func TestTimebounds(t *testing.T) { BaseFee: MinBaseFee, } - tp.Preconditions.Timebounds = tb + tp.Preconditions.TimeBounds = tb tx, err := NewTransaction(tp) assert.NoError(t, err) - assert.Equal(t, tb, tx.preconditions.Timebounds) + assert.Equal(t, tb, tx.preconditions.TimeBounds) assert.Equal(t, xdr.TimePoint(tb.MinTime), tx.envelope.TimeBounds().MinTime) assert.Equal(t, xdr.TimePoint(tb.MaxTime), tx.envelope.TimeBounds().MaxTime) } @@ -51,10 +51,10 @@ func TestV2Preconditions(t *testing.T) { kp0 := newKeypair0() cond := Preconditions{ - Timebounds: NewTimeout(300), - Ledgerbounds: &LedgerBounds{0, 1}, + TimeBounds: NewTimeout(300), + LedgerBounds: &LedgerBounds{0, 1}, MinSequenceNumber: nil, - MinSequenceNumberAge: xdr.Duration(10), + MinSequenceNumberAge: 10, MinSequenceNumberLedgerGap: 2, } assert.True(t, cond.hasV2Conditions()) @@ -97,7 +97,7 @@ func TestIncrementSequenceNum(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -109,7 +109,7 @@ func TestIncrementSequenceNum(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -121,7 +121,7 @@ func TestIncrementSequenceNum(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -133,7 +133,7 @@ func TestIncrementSequenceNum(t *testing.T) { IncrementSequenceNum: false, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -149,7 +149,7 @@ func TestFeeNoOperations(t *testing.T) { SourceAccount: &sourceAccount, Operations: []Operation{}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.EqualError(t, err, "transaction has no operations") @@ -167,7 +167,7 @@ func TestInflation(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&inflation}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -193,7 +193,7 @@ func TestCreateAccount(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -220,7 +220,7 @@ func TestPayment(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -256,7 +256,7 @@ func TestPaymentMuxedAccounts(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -282,7 +282,7 @@ func TestPaymentFailsIfNoAssetSpecified(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) expectedErrMsg := "validation failed for *txnbuild.Payment operation: Field: Asset, Error: asset is undefined" @@ -303,7 +303,7 @@ func TestBumpSequence(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&bumpSequence}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -328,7 +328,7 @@ func TestAccountMerge(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&accountMerge}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -354,7 +354,7 @@ func TestManageData(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -379,7 +379,7 @@ func TestManageDataRemoveDataEntry(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&manageData}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -405,7 +405,7 @@ func TestSetOptionsInflationDestination(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -430,7 +430,7 @@ func TestSetOptionsSetFlags(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -455,7 +455,7 @@ func TestSetOptionsClearFlags(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -480,7 +480,7 @@ func TestSetOptionsMasterWeight(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -507,7 +507,7 @@ func TestSetOptionsThresholds(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -532,7 +532,7 @@ func TestSetOptionsHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -557,7 +557,7 @@ func TestSetOptionsHomeDomainTooLong(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) @@ -579,7 +579,7 @@ func TestSetOptionsSigner(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -605,7 +605,7 @@ func TestMultipleOperations(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&inflation, &bumpSequence}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -632,7 +632,7 @@ func TestChangeTrust(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -658,7 +658,7 @@ func TestChangeTrustNativeAssetNotAllowed(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&changeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) @@ -680,7 +680,7 @@ func TestChangeTrustDeleteTrustline(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&removeTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -709,7 +709,7 @@ func TestAllowTrust(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&allowTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -738,7 +738,7 @@ func TestAllowTrustNoIssuer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&allowTrust}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, @@ -766,7 +766,7 @@ func TestManageSellOfferNewOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -791,7 +791,7 @@ func TestManageSellOfferDeleteOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&deleteOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -820,7 +820,7 @@ func TestManageSellOfferUpdateOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&updateOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -849,7 +849,7 @@ func TestCreatePassiveSellOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createPassiveOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -881,7 +881,7 @@ func TestPathPayment(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&pathPayment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp2, @@ -903,7 +903,7 @@ func TestMemoText(t *testing.T) { Operations: []Operation{&BumpSequence{BumpTo: 1}}, Memo: MemoText("Twas brillig"), BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp2, @@ -925,7 +925,7 @@ func TestMemoID(t *testing.T) { Operations: []Operation{&BumpSequence{BumpTo: 1}}, Memo: MemoID(314159), BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp2, @@ -947,7 +947,7 @@ func TestMemoHash(t *testing.T) { Operations: []Operation{&BumpSequence{BumpTo: 1}}, Memo: MemoHash([32]byte{0x01}), BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp2, @@ -969,7 +969,7 @@ func TestMemoReturn(t *testing.T) { Operations: []Operation{&BumpSequence{BumpTo: 1}}, Memo: MemoReturn([32]byte{0x01}), BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp2, @@ -999,7 +999,7 @@ func TestManageBuyOfferNewOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -1028,7 +1028,7 @@ func TestManageBuyOfferDeleteOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -1057,7 +1057,7 @@ func TestManageBuyOfferUpdateOffer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&buyOffer}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp1, @@ -1142,7 +1142,7 @@ func TestHashHex(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1186,7 +1186,7 @@ func TestTransactionFee(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1200,7 +1200,7 @@ func TestTransactionFee(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: 500, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1234,7 +1234,7 @@ func TestPreAuthTransaction(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1272,7 +1272,7 @@ func TestPreAuthTransaction(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: 500, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1313,7 +1313,7 @@ func TestHashXTransaction(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&setOptions}, BaseFee: 500, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1343,7 +1343,7 @@ func TestHashXTransaction(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&payment}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1449,7 +1449,7 @@ func TestBuild(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1509,7 +1509,7 @@ func TestFromXDRBuildSignEncode(t *testing.T) { Operations: newTx.Operations(), BaseFee: newTx.BaseFee(), Memo: MemoText("newtx"), - Preconditions: Preconditions{Timebounds: newTx.Timebounds()}, + Preconditions: Preconditions{TimeBounds: newTx.Timebounds()}, }, network.TestNetworkPassphrase, kp0, @@ -1535,7 +1535,7 @@ func TestSignWithSecretKey(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -1548,7 +1548,7 @@ func TestSignWithSecretKey(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1582,7 +1582,7 @@ func TestAddSignatureDecorated(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -1595,7 +1595,7 @@ func TestAddSignatureDecorated(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1684,7 +1684,7 @@ func TestFeeBumpTransaction_AddSignatureDecorated(t *testing.T) { SourceAccount: kp1.Address(), }}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }) require.NoError(t, err) tx, err = tx.Sign(network.TestNetworkPassphrase, kp0, kp1) @@ -1734,7 +1734,7 @@ func TestAddSignatureBase64(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, network.TestNetworkPassphrase, kp0, kp1, @@ -1747,7 +1747,7 @@ func TestAddSignatureBase64(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -1784,7 +1784,7 @@ func TestTransaction_ClearSignatures(t *testing.T) { SourceAccount: kp1.Address(), }}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) require.NoError(t, err) @@ -1817,7 +1817,7 @@ func TestFeeBumpTransaction_ClearSignatures(t *testing.T) { SourceAccount: kp1.Address(), }}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }) require.NoError(t, err) require.Len(t, tx.Signatures(), 0) @@ -1869,7 +1869,7 @@ func TestReadChallengeTx_validSignedByServerAndClient(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -1904,7 +1904,7 @@ func TestReadChallengeTx_validSignedByServer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -1939,7 +1939,7 @@ func TestReadChallengeTx_invalidNotSignedByServer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -1972,7 +1972,7 @@ func TestReadChallengeTx_invalidCorrupted(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2013,7 +2013,7 @@ func TestReadChallengeTx_invalidServerAccountIDMismatch(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2048,7 +2048,7 @@ func TestReadChallengeTx_invalidSeqNoNotZero(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2083,7 +2083,7 @@ func TestReadChallengeTx_invalidTimeboundsInfinite(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -2118,7 +2118,7 @@ func TestReadChallengeTx_invalidTimeboundsOutsideRange(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimebounds(0, 100)}, + Preconditions: Preconditions{TimeBounds: NewTimebounds(0, 100)}, }, ) assert.NoError(t, err) @@ -2155,7 +2155,7 @@ func TestReadChallengeTx_validTimeboundsWithGracePeriod(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimebounds(unixNow+5*59, unixNow+60*60)}, + Preconditions: Preconditions{TimeBounds: NewTimebounds(unixNow+5*59, unixNow+60*60)}, }, ) assert.NoError(t, err) @@ -2191,7 +2191,7 @@ func TestReadChallengeTx_invalidTimeboundsWithGracePeriod(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimebounds(unixNow+5*61, unixNow+60*60)}, + Preconditions: Preconditions{TimeBounds: NewTimebounds(unixNow+5*61, unixNow+60*60)}, }, ) assert.NoError(t, err) @@ -2221,7 +2221,7 @@ func TestReadChallengeTx_invalidOperationWrongType(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2249,7 +2249,7 @@ func TestReadChallengeTx_invalidOperationNoSourceAccount(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2282,7 +2282,7 @@ func TestReadChallengeTx_invalidDataValueWrongEncodedLength(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2317,7 +2317,7 @@ func TestReadChallengeTx_invalidDataValueCorruptBase64(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2352,7 +2352,7 @@ func TestReadChallengeTx_invalidDataValueWrongByteLength(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2502,7 +2502,7 @@ func TestReadChallengeTx_doesVerifyHomeDomainFailure(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2535,7 +2535,7 @@ func TestReadChallengeTx_doesVerifyHomeDomainSuccess(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2573,7 +2573,7 @@ func TestReadChallengeTx_allowsAdditionalManageDataOpsWithSourceAccountSetToServ IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2613,7 +2613,7 @@ func TestReadChallengeTx_disallowsAdditionalManageDataOpsWithoutSourceAccountSet IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -2650,7 +2650,7 @@ func TestReadChallengeTx_disallowsAdditionalOpsOfOtherTypes(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2685,7 +2685,7 @@ func TestReadChallengeTx_matchesHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2718,7 +2718,7 @@ func TestReadChallengeTx_doesNotMatchHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2746,7 +2746,7 @@ func TestReadChallengeTx_validWhenWebAuthDomainMissing(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2778,7 +2778,7 @@ func TestReadChallengeTx_invalidWebAuthDomainSourceAccount(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2810,7 +2810,7 @@ func TestReadChallengeTx_invalidWebAuthDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -2843,7 +2843,7 @@ func TestVerifyChallengeTxThreshold_invalidServer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, clientKP, @@ -2879,7 +2879,7 @@ func TestVerifyChallengeTxThreshold_validServerAndClientKeyMeetingThreshold(t *t IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -2920,7 +2920,7 @@ func TestVerifyChallengeTxThreshold_validServerAndMultipleClientKeyMeetingThresh IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, @@ -2975,7 +2975,7 @@ func TestVerifyChallengeTxThreshold_validServerAndMultipleClientKeyMeetingThresh IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, @@ -3026,7 +3026,7 @@ func TestVerifyChallengeTxThreshold_validServerAndMultipleClientKeyMeetingThresh IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, @@ -3067,7 +3067,7 @@ func TestVerifyChallengeTxThreshold_invalidServerAndMultipleClientKeyNotMeetingT IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, @@ -3106,7 +3106,7 @@ func TestVerifyChallengeTxThreshold_invalidClientKeyUnrecognized(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, clientKP3, @@ -3142,7 +3142,7 @@ func TestVerifyChallengeTxThreshold_invalidNoSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, clientKP3, @@ -3174,7 +3174,7 @@ func TestVerifyChallengeTxThreshold_weightsAddToMoreThan8Bits(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP1, clientKP2, @@ -3216,7 +3216,7 @@ func TestVerifyChallengeTxThreshold_matchesHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -3259,7 +3259,7 @@ func TestVerifyChallengeTxThreshold_doesNotMatchHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -3297,7 +3297,7 @@ func TestVerifyChallengeTxThreshold_doesVerifyHomeDomainFailure(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3333,7 +3333,7 @@ func TestVerifyChallengeTxThreshold_doesVerifyHomeDomainSuccess(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3379,7 +3379,7 @@ func TestVerifyChallengeTxThreshold_allowsAdditionalManageDataOpsWithSourceAccou IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3425,7 +3425,7 @@ func TestVerifyChallengeTxThreshold_disallowsAdditionalManageDataOpsWithoutSourc IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3467,7 +3467,7 @@ func TestVerifyChallengeTxThreshold_disallowsAdditionalOpsOfOtherTypes(t *testin IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3500,7 +3500,7 @@ func TestVerifyChallengeTxThreshold_validWhenWebAuthDomainMissing(t *testing.T) IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3540,7 +3540,7 @@ func TestVerifyChallengeTxThreshold_invalidWebAuthDomainSourceAccount(t *testing IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3576,7 +3576,7 @@ func TestVerifyChallengeTxThreshold_invalidWebAuthDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3612,7 +3612,7 @@ func TestVerifyChallengeTxSigners_invalidServer(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, clientKP, @@ -3645,7 +3645,7 @@ func TestVerifyChallengeTxSigners_validServerAndClientMasterKey(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -3678,7 +3678,7 @@ func TestVerifyChallengeTxSigners_invalidServerAndNoClient(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, @@ -3712,7 +3712,7 @@ func TestVerifyChallengeTxSigners_invalidServerAndUnrecognizedClient(t *testing. IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, unrecognizedKP, @@ -3746,7 +3746,7 @@ func TestVerifyChallengeTxSigners_validServerAndMultipleClientSigners(t *testing IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, clientKP2, @@ -3780,7 +3780,7 @@ func TestVerifyChallengeTxSigners_validServerAndMultipleClientSignersReverseOrde IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, clientKP, @@ -3814,7 +3814,7 @@ func TestVerifyChallengeTxSigners_validServerAndClientSignersNotMasterKey(t *tes IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -3848,7 +3848,7 @@ func TestVerifyChallengeTxSigners_validServerAndClientSignersIgnoresServerSigner IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -3882,7 +3882,7 @@ func TestVerifyChallengeTxSigners_invalidServerNoClientSignersIgnoresServerSigne IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, @@ -3916,7 +3916,7 @@ func TestVerifyChallengeTxSigners_validServerAndClientSignersIgnoresDuplicateSig IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -3953,7 +3953,7 @@ func TestVerifyChallengeTxSigners_validIgnorePreauthTxHashAndXHash(t *testing.T) IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -3987,7 +3987,7 @@ func TestVerifyChallengeTxSigners_invalidServerAndClientSignersIgnoresDuplicateS IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -4021,7 +4021,7 @@ func TestVerifyChallengeTxSigners_invalidServerAndClientSignersFailsDuplicateSig IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, clientKP2, @@ -4055,7 +4055,7 @@ func TestVerifyChallengeTxSigners_invalidServerAndClientSignersFailsSignerSeed(t IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP2, @@ -4088,7 +4088,7 @@ func TestVerifyChallengeTxSigners_invalidNoSigners(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4120,7 +4120,7 @@ func TestVerifyChallengeTxSigners_doesVerifyHomeDomainFailure(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4152,7 +4152,7 @@ func TestVerifyChallengeTxSigners_matchesHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -4192,7 +4192,7 @@ func TestVerifyChallengeTxSigners_doesNotMatchHomeDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op1, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(300)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(300)}, }, ) assert.NoError(t, err) @@ -4232,7 +4232,7 @@ func TestVerifyChallengeTxSigners_doesVerifyHomeDomainSuccess(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4269,7 +4269,7 @@ func TestVerifyChallengeTxSigners_allowsAdditionalManageDataOpsWithSourceAccount IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4307,7 +4307,7 @@ func TestVerifyChallengeTxSigners_disallowsAdditionalManageDataOpsWithoutSourceA IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4344,7 +4344,7 @@ func TestVerifyChallengeTxSigners_disallowsAdditionalOpsOfOtherTypes(t *testing. IncrementSequenceNum: true, Operations: []Operation{&op1, &op2, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4371,7 +4371,7 @@ func TestVerifyChallengeTxSigners_validWhenWebAuthDomainMissing(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4405,7 +4405,7 @@ func TestVerifyChallengeTxSigners_invalidWebAuthDomainSourceAccount(t *testing.T IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4436,7 +4436,7 @@ func TestVerifyChallengeTxSigners_invalidWebAuthDomain(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&op, &webAuthDomainOp}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, network.TestNetworkPassphrase, serverKP, clientKP, @@ -4462,7 +4462,7 @@ func TestVerifyTxSignatureUnsignedTx(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewTimeout(1000)}, + Preconditions: Preconditions{TimeBounds: NewTimeout(1000)}, }, ) assert.NoError(t, err) @@ -4488,7 +4488,7 @@ func TestVerifyTxSignatureSingle(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -4514,7 +4514,7 @@ func TestVerifyTxSignatureMultiple(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -4542,7 +4542,7 @@ func TestVerifyTxSignatureInvalid(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err) @@ -4577,7 +4577,7 @@ func TestClaimableBalanceIds(t *testing.T) { SourceAccount: &aMuxedAccount, IncrementSequenceNum: true, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&claimableBalanceEntry}, }, ) @@ -4612,7 +4612,7 @@ func TestTransaction_marshalUnmarshalText(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4646,7 +4646,7 @@ func TestFeeBumpTransaction_marshalUnmarshalText(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4686,7 +4686,7 @@ func TestNewGenericTransactionWithTransaction(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4705,7 +4705,7 @@ func TestNewGenericTransactionWithFeeBumpTransaction(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4737,7 +4737,7 @@ func TestGenericTransaction_marshalUnmarshalText(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4794,7 +4794,7 @@ func TestGenericTransaction_marshalBinary(t *testing.T) { SourceAccount: &SimpleAccount{AccountID: k.Address(), Sequence: 1}, IncrementSequenceNum: false, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, Operations: []Operation{&BumpSequence{BumpTo: 2}}, }, ) @@ -4840,7 +4840,7 @@ func TestGenericTransaction_HashHex(t *testing.T) { IncrementSequenceNum: true, Operations: []Operation{&createAccount}, BaseFee: MinBaseFee, - Preconditions: Preconditions{Timebounds: NewInfiniteTimeout()}, + Preconditions: Preconditions{TimeBounds: NewInfiniteTimeout()}, }, ) assert.NoError(t, err)