From 14db774c5ea74e90c80642e01332fd56da256bda Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Wed, 10 Jul 2024 15:03:40 -0700 Subject: [PATCH 1/3] Use FeeBumpAccount for setting FeeAccountMuxed --- internal/transform/transaction.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/transform/transaction.go b/internal/transform/transaction.go index f4eb255d..b4a5d14e 100644 --- a/internal/transform/transaction.go +++ b/internal/transform/transaction.go @@ -238,8 +238,8 @@ func TransformTransaction(transaction ingest.LedgerTransaction, lhe xdr.LedgerHe if transaction.Envelope.IsFeeBump() { feeBumpAccount := transaction.Envelope.FeeBumpAccount() feeAccount := feeBumpAccount.ToAccountId() - if sourceAccount.Type == xdr.CryptoKeyTypeKeyTypeMuxedEd25519 { - feeAccountMuxed := feeAccount.Address() + if feeBumpAccount.Type == xdr.CryptoKeyTypeKeyTypeMuxedEd25519 { + feeAccountMuxed := feeBumpAccount.Address() transformedTransaction.FeeAccountMuxed = feeAccountMuxed } transformedTransaction.FeeAccount = feeAccount.Address() From 54154ca543bb65c3313cdfbf6e47a125c8e299ec Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Fri, 12 Jul 2024 15:01:59 -0400 Subject: [PATCH 2/3] dummy commit --- internal/transform/test_variables_test.go | 9 +++++++++ internal/transform/transaction_test.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/transform/test_variables_test.go b/internal/transform/test_variables_test.go index 7c984e96..b21dae29 100644 --- a/internal/transform/test_variables_test.go +++ b/internal/transform/test_variables_test.go @@ -95,6 +95,15 @@ var testAccount4Address = "GBVVRXLMNCJQW3IDDXC3X6XCH35B5Q7QXNMMFPENSOGUPQO7WO7HG var testAccount4ID, _ = xdr.AddressToAccountId(testAccount4Address) var testAccount4 = testAccount4ID.ToMuxedAccount() +var dummyEd25519 [32]byte +var testAccount5 = xdr.MuxedAccount{ + Type: xdr.CryptoKeyTypeKeyTypeMuxedEd25519, + Med25519: &xdr.MuxedAccountMed25519{ + Id: xdr.Uint64(1), + Ed25519: xdr.Uint256(dummyEd25519), + }, +} + // a selection of hardcoded assets and their AssetOutput representations var usdtAsset = xdr.Asset{ diff --git a/internal/transform/transaction_test.go b/internal/transform/transaction_test.go index fd1d8b47..b6160f4d 100644 --- a/internal/transform/transaction_test.go +++ b/internal/transform/transaction_test.go @@ -251,7 +251,7 @@ func makeTransactionTestInput() (transaction []ingest.LedgerTransaction, history Type: xdr.EnvelopeTypeEnvelopeTypeTxFeeBump, FeeBump: &xdr.FeeBumpTransactionEnvelope{ Tx: xdr.FeeBumpTransaction{ - FeeSource: testAccount3, + FeeSource: testAccount5, Fee: 7200, InnerTx: xdr.FeeBumpTransactionInnerTx{ Type: xdr.EnvelopeTypeEnvelopeTypeTx, From 459b28ac10989ee0fa3084eeaebab6dc287171f1 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Fri, 12 Jul 2024 12:27:05 -0700 Subject: [PATCH 3/3] Update tests --- internal/transform/test_variables_test.go | 1 + internal/transform/transaction_test.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/transform/test_variables_test.go b/internal/transform/test_variables_test.go index b21dae29..43aadbcc 100644 --- a/internal/transform/test_variables_test.go +++ b/internal/transform/test_variables_test.go @@ -103,6 +103,7 @@ var testAccount5 = xdr.MuxedAccount{ Ed25519: xdr.Uint256(dummyEd25519), }, } +var testAccount5Address = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF" // a selection of hardcoded assets and their AssetOutput representations diff --git a/internal/transform/transaction_test.go b/internal/transform/transaction_test.go index b6160f4d..7759b3a4 100644 --- a/internal/transform/transaction_test.go +++ b/internal/transform/transaction_test.go @@ -108,7 +108,7 @@ func makeTransactionTestOutput() (output []TransactionOutput, err error) { TransactionResultCode: "TransactionResultCodeTxFailed", }, { - TxEnvelope: "AAAABQAAAABnzACGTDuJFoxqr+C8NHCe0CHFBXLi+Y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gJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFVU1NEAAAAAGtY3WxokwttAx3Fu/riPvoew/C7WMK8jZONR8Hfs75zAAAAHgAAAAAAAYagAAAAAAAAA+gAAAAAAAAB9AAAAAAAAAAZAAAAAAAAAAEAAAAAAAAABQECAwQFBgcICQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVNTRAAAAABrWN1saJMLbQMdxbv64j76HsPwu1jCvI2TjUfB37O+cwAAAB4AAAAAAAGKiAAAAAAAAARMAAAAAAAAAfYAAAAAAAAAGgAAAAAAAAACAAAAAwAAAAAAAAAFAQIDBAUGBwgJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFVU1NEAAAAAGtY3WxokwttAx3Fu/riPvoew/C7WMK8jZONR8Hfs75zAAAAHgAAAAAAAYagAAAAAAAAA+gAAAAAAAAB9AAAAAAAAAAZAAAAAAAAAAEAAAAAAAAABQECAwQFBgcICQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVNTRAAAAABrWN1saJMLbQMdxbv64j76HsPwu1jCvI2TjUfB37O+cwAAAB4AAAAAAAGKiAAAAAAAAARMAAAAAAAAAfYAAAAAAAAAGgAAAAAAAAAA", TxFeeMeta: "AAAAAA==", @@ -126,7 +126,8 @@ func makeTransactionTestOutput() (output []TransactionOutput, err error) { TimeBounds: "[0,1594272628)", Successful: true, InnerTransactionHash: "a87fef5eeb260269c380f2de456aad72b59bb315aaac777860456e09dac0bafb", - FeeAccount: testAccount3Address, + FeeAccount: testAccount5Address, + FeeAccountMuxed: "MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFNZG", NewMaxFee: 7200, ClosedAt: time.Date(2020, time.July, 9, 5, 28, 42, 0, time.UTC), ResourceFee: 0,