diff --git a/internal/transform/transaction.go b/internal/transform/transaction.go index 7b4ffbd..973935f 100644 --- a/internal/transform/transaction.go +++ b/internal/transform/transaction.go @@ -127,12 +127,6 @@ func TransformTransaction(transaction ingest.LedgerTransaction, lhe xdr.LedgerHe outputMinSequenceLedgerGap = null.IntFrom(int64(*minSequenceLedgerGap)) } - xdrSignatures := transaction.Envelope.Signatures() - signatures := make([]string, len(xdrSignatures)) - for i, sig := range xdrSignatures { - signatures[i] = base64.StdEncoding.EncodeToString(sig.Signature) - } - // Soroban fees and resources // Note: MaxFee and FeeCharged is the sum of base transaction fees + Soroban fees // Breakdown of Soroban fees can be calculated by the config_setting resource pricing * the resources used @@ -230,7 +224,7 @@ func TransformTransaction(transaction ingest.LedgerTransaction, lhe xdr.LedgerHe TotalNonRefundableResourceFeeCharged: outputTotalNonRefundableResourceFeeCharged, TotalRefundableResourceFeeCharged: outputTotalRefundableResourceFeeCharged, RentFeeCharged: outputRentFeeCharged, - Signatures: signatures, + Signatures: getSignatures(transaction.Envelope.Signatures()), } // Add Muxed Account Details, if exists @@ -255,6 +249,8 @@ func TransformTransaction(transaction ingest.LedgerTransaction, lhe xdr.LedgerHe innerHash := transaction.Result.InnerHash() transformedTransaction.InnerTransactionHash = hex.EncodeToString(innerHash[:]) transformedTransaction.NewMaxFee = uint32(transaction.Envelope.FeeBumpFee()) + + transformedTransaction.Signatures = getSignatures(transaction.Envelope.FeeBump.Signatures) } return transformedTransaction, nil @@ -302,3 +298,12 @@ func formatSigners(s []xdr.SignerKey) pq.StringArray { return signers } + +func getSignatures(xdrSignatures []xdr.DecoratedSignature) []string { + signatures := make([]string, len(xdrSignatures)) + for i, sig := range xdrSignatures { + signatures[i] = base64.StdEncoding.EncodeToString(sig.Signature) + } + + return signatures +} diff --git a/internal/transform/transaction_test.go b/internal/transform/transaction_test.go index e0500dc..8cad7e3 100644 --- a/internal/transform/transaction_test.go +++ b/internal/transform/transaction_test.go @@ -136,7 +136,7 @@ func makeTransactionTestOutput() (output []TransactionOutput, err error) { SorobanResourcesReadBytes: 0, SorobanResourcesWriteBytes: 0, TransactionResultCode: "TransactionResultCodeTxFeeBumpInnerSuccess", //inner fee bump success - Signatures: []string{}, + Signatures: []string{"9GuLXL2cz09UOAJGSxbtMmTyn7Eb8EJ6ti29TgV/Gj2z7uVMIM56DZqFlJUd+jCELFajOCAsS1fi+0wEO7aECA=="}, }, { TxEnvelope: "AAAAAgAAAAAcR0GXGO76pFs4y38vJVAanjnLg4emNun7zAx0pHcDGAAAAGQBpLyvsiV6gwAAAAIAAAABAAAAAAAAAAAAAAAAXwardAAAAAEAAAAFAAAACgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAMCAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAABdITDVhQ2dvelFISVc3c1NjNVhkY2ZtUgAAAAABAAAAAQAAAABrWN1saJMLbQMdxbv64j76HsPwu1jCvI2TjUfB37O+cwAAAAIAAAAAAAAAAAAAAAAAAAAAAQIDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFjQq+PAAAAQPRri1y9nM9PVDgCRksW7TJk8p+xG/BCerYtvU4Ffxo9s+7lTCDOeg2ahZSVHfowhCxWozggLEtX4vtMBDu2hAg=",