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

Make sure Tx is being updated with latest TxAttempt details #1326

Merged
Changes from all commits
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
8 changes: 8 additions & 0 deletions core/store/orm/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ func TestORM_AddTxAttempt(t *testing.T) {
assert.Equal(t, tx.ID, txAttempt.TxID)
assert.Equal(t, tx.Attempts[1], txAttempt)

tx, err = store.FindTx(tx.ID)
require.NoError(t, err)
assert.Equal(t, tx.Hash, txAttempt.Hash)

// Another attempt with exact same EthTx still generates a new attempt record
txAttempt, err = store.AddTxAttempt(tx, ethTxWithNewNonce, 1)
assert.NoError(t, err)
Expand All @@ -637,6 +641,10 @@ func TestORM_AddTxAttempt(t *testing.T) {
assert.Equal(t, tx.Attempts[3], txAttempt)
assert.Equal(t, tx.Hash, txAttempt.Hash)
assert.Equal(t, tx.SignedRawTx, txAttempt.SignedRawTx)

tx, err = store.FindTx(tx.ID)
require.NoError(t, err)
assert.Equal(t, tx.Hash, txAttempt.Hash)
}

func TestORM_FindBridge(t *testing.T) {
Expand Down