Skip to content

Commit

Permalink
Fix receiver address when nil on test-vector (0xPolygonHermez#1131)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Sep 7, 2022
1 parent 68c63fa commit 47c9c85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,12 @@ func TestExecutorTxHashAndRLP(t *testing.T) {
require.NoError(t, err)

for x, testCase := range testCases {
var receiverAddress = common.HexToAddress(testCase.To)
var stateRoot = state.ZeroHash
var receiverAddress = common.HexToAddress(testCase.To)
receiver := &receiverAddress
if testCase.To == "0x" {
receiver = nil
}

v, ok := new(big.Int).SetString(testCase.V, 0)
require.Equal(t, true, ok)
Expand Down Expand Up @@ -1242,7 +1246,7 @@ func TestExecutorTxHashAndRLP(t *testing.T) {
// Create transaction
tx := types.NewTx(&types.LegacyTx{
Nonce: nonce.Uint64(),
To: &receiverAddress,
To: receiver,
Value: value,
Gas: gasLimit.Uint64(),
GasPrice: gasPrice,
Expand Down

0 comments on commit 47c9c85

Please sign in to comment.