Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon: Support new CAP-21 transaction conditions #4297

Merged
merged 22 commits into from
Mar 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Temporary passing data for v2 preconditions transaction insertion test
  • Loading branch information
Paul Bellamy committed Mar 25, 2022
commit 4e61c0fac7383db5cee325f48742e2c956083397
36 changes: 20 additions & 16 deletions services/horizon/internal/db2/history/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ func TestInsertTransaction(t *testing.T) {
timeBoundWithMin := TimeBounds{Lower: null.IntFrom(1576195867)}
timeBoundWithMax := TimeBounds{Lower: null.IntFrom(0), Upper: null.IntFrom(1576195867)}
timeboundsWithMinAndMax := TimeBounds{Lower: null.IntFrom(1576095867), Upper: null.IntFrom(1576195867)}
ledgerboundsWithMinAndMax := LedgerBounds{MinLedger: null.IntFrom(123456), MaxLedger: null.IntFrom(1234567)}
v2TimeboundsWithMinAndMax := TimeBounds{Lower: null.IntFrom(0), Upper: null.IntFrom(1648153609)}
v2LedgerboundsWithMinAndMax := LedgerBounds{MinLedger: null.IntFrom(0), MaxLedger: null.IntFrom(1)}

withMultipleSignatures := []string{
"MID8kIOLP/yEymCyhU7A/YeVpnVTDzAqszWtv8c+/qAw542BaKWxCJxl/jsggY0mF+SR8X0bvWXvPBgyYcDZDw==",
Expand Down Expand Up @@ -742,39 +743,42 @@ func TestInsertTransaction(t *testing.T) {
{
"transaction with v2 preconditions",
buildLedgerTransaction(tt.T, testTransaction{
index: 1,
envelopeXDR: "AAAAAgAAAAEAAAAAAAAAGwAAAAAAAAAqAAAAAQAAABsAAAAqAAAAAQAAAAAAAAAOAAAAAAAAABsAAAAqAAAAAQAAAAAdBJqAD9qPq+j2nRDdjdp5KVoUh8riPkNO9ato7BNs8w==",
resultXDR: "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA=",
index: 1,
envelopeXDR: "AAAAAgAAAADg3G3hclysZlFitS+s5zWyiiJD5B0STWy5LXCj6i5yxQAAAGQAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAAAAAAAYjzUCQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAACgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAA=",
// Real values pending core accepting these txns
resultXDR: "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA=",
// Real values pending core accepting these txns
feeChangesXDR: "AAAAAA==",
metaXDR: "AAAAAQAAAAAAAAAA",
hash: "7aa3419a833fb14e312ae47a98e565f668a72f23c39e0cf79f598d3d3e793b2d",
// Real values pending core accepting these txns
metaXDR: "AAAAAQAAAAAAAAAA",
hash: "7ad89c184dd2aa17f9f96105f9508521b52bb36f74cf57d5ffd6f7205a737764",
}),
Transaction{
LedgerCloseTime: ledger.ClosedAt,
TransactionWithoutLedger: TransactionWithoutLedger{
TotalOrderID: TotalOrderID{528280981504},
TransactionHash: "7aa3419a833fb14e312ae47a98e565f668a72f23c39e0cf79f598d3d3e793b2d",
TransactionHash: "7ad89c184dd2aa17f9f96105f9508521b52bb36f74cf57d5ffd6f7205a737764",
LedgerSequence: ledger.Sequence,
ApplicationOrder: 1,
Account: "GAUJETIZVEP2NRYLUESJ3LS66NVCEGMON4UDCBCSBEVPIID773P2W6AY",
AccountSequence: "123456",
Account: "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3",
AccountSequence: "1",
MaxFee: 100,
FeeCharged: 300,
OperationCount: 1,
TxEnvelope: "AAAAACiSTRmpH6bHC6Ekna5e82oiGY5vKDEEUgkq9CB//t+rAAAAZAAAAAAAAeJAAAAAAQAAAABd8VB7AAAAAF3y1xsAAAAAAAAAAQAAAAAAAAALAAAAAAAS1ocAAAAAAAAAAA==",
TxEnvelope: "AAAAAgAAAADg3G3hclysZlFitS+s5zWyiiJD5B0STWy5LXCj6i5yxQAAAGQAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAAAAAAAYjzUCQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAACgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAA=",
TxResult: "AAAAAAAAASwAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAA=",
TxFeeMeta: "AAAAAA==",
TxMeta: "AAAAAQAAAAAAAAAA",
Signatures: emptySignatures,
InnerSignatures: nullSignatures,
MemoType: "none",
Memo: null.NewString("", false),
TimeBounds: timeboundsWithMinAndMax,
LedgerBounds: ledgerboundsWithMinAndMax,
MinAccountSequence: null.IntFrom(123456),
MinAccountSequenceAge: null.IntFrom(1),
MinAccountSequenceLedgerGap: null.IntFrom(1),
ExtraSigners: pq.StringArray{"???"},
TimeBounds: v2TimeboundsWithMinAndMax,
LedgerBounds: v2LedgerboundsWithMinAndMax,
MinAccountSequence: null.Int{},
MinAccountSequenceAge: null.IntFrom(10),
MinAccountSequenceLedgerGap: null.IntFrom(2),
ExtraSigners: pq.StringArray{},
Successful: success,
},
},
Expand Down