diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index 2b57d4181c..7741de30c2 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -94,7 +94,7 @@ func (e *EthEndpoints) Call(arg *types.TxArgs, blockArg *types.BlockNumberOrHash return rpcErrorResponse(types.DefaultErrorCode, "failed to convert arguments into an unsigned transaction", err) } - result, err := e.state.ProcessUnsignedTransaction(ctx, tx, sender, blockToProcess, false, dbTx) + result, err := e.state.ProcessUnsignedTransaction(ctx, tx, sender, blockToProcess, true, dbTx) if err != nil { return rpcErrorResponse(types.DefaultErrorCode, "failed to execute the unsigned transaction", err) } diff --git a/jsonrpc/endpoints_eth_test.go b/jsonrpc/endpoints_eth_test.go index ed688b9032..cb18bd3095 100644 --- a/jsonrpc/endpoints_eth_test.go +++ b/jsonrpc/endpoints_eth_test.go @@ -170,7 +170,7 @@ func TestCall(t *testing.T) { m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumOneUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumOneUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -214,7 +214,7 @@ func TestCall(t *testing.T) { }) m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumOneUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumOneUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -256,7 +256,7 @@ func TestCall(t *testing.T) { m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -298,7 +298,7 @@ func TestCall(t *testing.T) { }) m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumTenUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumTenUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -338,7 +338,7 @@ func TestCall(t *testing.T) { m.State.On("GetL2BlockByNumber", context.Background(), blockNumTenUint64, m.DbTx).Return(block, nil).Once() m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumTenUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, &blockNumTenUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -377,7 +377,7 @@ func TestCall(t *testing.T) { block := ethTypes.NewBlockWithHeader(ðTypes.Header{Number: blockNumOne, Root: blockRoot}) m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, common.HexToAddress(c.DefaultSenderAddress), nilUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, common.HexToAddress(c.DefaultSenderAddress), nilUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -416,7 +416,7 @@ func TestCall(t *testing.T) { block := ethTypes.NewBlockWithHeader(ðTypes.Header{Number: blockNumOne, Root: blockRoot}) m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, common.HexToAddress(c.DefaultSenderAddress), nilUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, common.HexToAddress(c.DefaultSenderAddress), nilUint64, true, m.DbTx). Return(&runtime.ExecutionResult{ReturnValue: testCase.expectedResult}, nil). Once() }, @@ -480,7 +480,7 @@ func TestCall(t *testing.T) { m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, true, m.DbTx). Return(&runtime.ExecutionResult{Err: errors.New("failed to process unsigned transaction")}, nil). Once() }, @@ -522,7 +522,7 @@ func TestCall(t *testing.T) { m.State.On("GetL2BlockByNumber", context.Background(), blockNumOneUint64, m.DbTx).Return(block, nil).Once() m.State.On("GetNonce", context.Background(), *txArgs.From, blockRoot).Return(nonce, nil).Once() m.State. - On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, false, m.DbTx). + On("ProcessUnsignedTransaction", context.Background(), txMatchBy, *txArgs.From, nilUint64, true, m.DbTx). Return(&runtime.ExecutionResult{Err: runtime.ErrExecutionReverted}, nil). Once() },