mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
Merge feat/record_transaction branch and fix comments.
This commit is contained in:
@@ -117,7 +117,7 @@ type ScrollTxOrm interface {
|
||||
SaveScrollTx(id, sender string, txType types.ScrollTxType, tx *etypes.Transaction, extraData string) error
|
||||
SetScrollTxConfirmedByID(hash string, txHash string) error
|
||||
GetScrollTxs(fields map[string]interface{}, args ...string) ([]*types.ScrollTx, error)
|
||||
GetTxByID(id string) (*types.ScrollTx, error)
|
||||
GetScrollTxByID(id string) (*types.ScrollTx, error)
|
||||
GetL1TxMessages(fields map[string]interface{}, args ...string) (uint64, []*types.ScrollTx, error)
|
||||
GetL2TxMessages(fields map[string]interface{}, args ...string) (uint64, []*types.ScrollTx, error)
|
||||
GetBlockBatchTxMessages(fields map[string]interface{}, args ...string) (uint64, []*types.ScrollTx, error)
|
||||
|
||||
@@ -78,8 +78,8 @@ func (t *scrollTxOrm) GetScrollTxs(fields map[string]interface{}, args ...string
|
||||
return txMsgs, nil
|
||||
}
|
||||
|
||||
// GetTxByID returns tx message by message id.
|
||||
func (t *scrollTxOrm) GetTxByID(id string) (*stypes.ScrollTx, error) {
|
||||
// GetScrollTxByID returns tx message by message id.
|
||||
func (t *scrollTxOrm) GetScrollTxByID(id string) (*stypes.ScrollTx, error) {
|
||||
db := t.db
|
||||
row := db.QueryRowx(db.Rebind("SELECT id, tx_hash, sender, nonce, target, value, data FROM scroll_transaction WHERE id = ?"), id)
|
||||
txMsg := &stypes.ScrollTx{}
|
||||
|
||||
@@ -479,7 +479,7 @@ func testTxOrmSaveTxAndGetTxByHash(t *testing.T) {
|
||||
err = ormTx.SetScrollTxConfirmedByID("1", signedTx.Hash().String())
|
||||
assert.NoError(t, err)
|
||||
|
||||
savedTx, err := ormTx.GetTxByID("1")
|
||||
savedTx, err := ormTx.GetScrollTxByID("1")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, signedTx.Hash().String(), savedTx.TxHash.String)
|
||||
|
||||
Reference in New Issue
Block a user