Skip to content

Commit

Permalink
Fixed tests and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Dec 9, 2024
1 parent 293b148 commit c210b71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pkg/solana/txm/txm_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ func TestTxm_disabled_confirm_timeout_with_retention(t *testing.T) {
// check transaction status which should still be stored
status, err := txm.GetTransactionStatus(ctx, testTxID)
require.NoError(t, err)
require.Equal(t, types.Failed, status)
require.Equal(t, types.Fatal, status)

// Sleep until retention period has passed for transaction and for another reap cycle to run
time.Sleep(15 * time.Second)
Expand Down Expand Up @@ -1089,7 +1089,7 @@ func TestTxm_compute_unit_limit_estimation(t *testing.T) {
// tx should be stored in-memory and moved to errored state
status, err := txm.GetTransactionStatus(ctx, txID)
require.NoError(t, err)
require.Equal(t, commontypes.Failed, status)
require.Equal(t, commontypes.Fatal, status)
})
}

Expand Down
26 changes: 13 additions & 13 deletions pkg/solana/txm/txm_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,20 @@ func TestTxm_ProcessError(t *testing.T) {
})
t.Run("process unknown error", func(t *testing.T) {
t.Parallel()
err := map[string][]interface{}{
"MadeUpError": {
0, map[string]int{"Custom": 6003},
},
}
// returns fatal error if InstructionError encountered during simulation
txState, errType := txm.ProcessError(solana.Signature{}, err, true)
require.Equal(t, solanatxm.TxFailSimOther, errType)
require.Equal(t, solanatxm.Errored, txState) // default enum value
err := map[string][]interface{}{
"MadeUpError": {
0, map[string]int{"Custom": 6003},
},
}
// returns fatal error if InstructionError encountered during simulation
txState, errType := txm.ProcessError(solana.Signature{}, err, true)
require.Equal(t, solanatxm.TxFailSimOther, errType)
require.Equal(t, solanatxm.Errored, txState) // default enum value

// returns fatal error if InstructionError encountered during normal processing
txState, errType = txm.ProcessError(solana.Signature{}, err, false)
require.Equal(t, solanatxm.TxFailRevert, errType)
require.Equal(t, solanatxm.Errored, txState) // default enum value
// returns fatal error if InstructionError encountered during normal processing
txState, errType = txm.ProcessError(solana.Signature{}, err, false)
require.Equal(t, solanatxm.TxFailRevert, errType)
require.Equal(t, solanatxm.Errored, txState) // default enum value
})
}

Expand Down

0 comments on commit c210b71

Please sign in to comment.