Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikiyer56 committed Nov 21, 2024
1 parent 66abef5 commit fb94fdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ingest/ledger_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (t *LedgerTransaction) GetChanges() ([]Change, error) {
for _, change := range opChanges {
op, found := t.GetOperation(uint32(opIdx))
if !found {
return []Change{}, errors.New("could not find operation")
continue
}
results, _ := t.Result.OperationResults()
operationResult := results[opIdx].MustTr()
Expand Down Expand Up @@ -115,7 +115,7 @@ func (t *LedgerTransaction) GetChanges() ([]Change, error) {
for _, change := range opChanges {
op, found := t.GetOperation(uint32(opIdx))
if !found {
return []Change{}, errors.New("could not find operation")
continue
}
results, _ := t.Result.OperationResults()
operationResult := results[opIdx].MustTr()
Expand Down Expand Up @@ -194,7 +194,7 @@ func (t *LedgerTransaction) operationChanges(ops []xdr.OperationMeta, index uint
for _, change := range changes {
op, found := t.GetOperation(index)
if !found {
return []Change{}, errors.New("could not find operation")
continue
}
results, _ := t.Result.OperationResults()
operationResult := results[index].MustTr()
Expand Down
4 changes: 4 additions & 0 deletions xdr/transaction_envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func (e TransactionEnvelope) Preconditions() Preconditions {
// Note for fee bump transactions, Operations() returns the operations
// of the inner transaction
func (e TransactionEnvelope) Operations() []Operation {
// This is not expected to happen.
if (e == TransactionEnvelope{}) {
return []Operation{}
}
switch e.Type {
case EnvelopeTypeEnvelopeTypeTxFeeBump:
return e.FeeBump.Tx.InnerTx.V1.Tx.Operations
Expand Down

0 comments on commit fb94fdf

Please sign in to comment.