(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestStoreCapture(t *testing.T) { |
| 50 | var ( |
| 51 | env = NewEVM(Context{}, nil, configs.TestChainConfig, Config{}) |
| 52 | logger = NewStructLogger(nil) |
| 53 | mem = NewMemory() |
| 54 | stack = newstack() |
| 55 | contract = NewContract(&dummyContractRef{}, &dummyContractRef{}, new(big.Int), 0) |
| 56 | ) |
| 57 | stack.push(big.NewInt(1)) |
| 58 | stack.push(big.NewInt(0)) |
| 59 | |
| 60 | var index common.Hash |
| 61 | |
| 62 | logger.CaptureState(env, 0, SSTORE, 0, 0, mem, stack, contract, 0, nil) |
| 63 | if len(logger.changedValues[contract.Address()]) == 0 { |
| 64 | t.Fatalf("expected exactly 1 changed value on address %x, got %d", contract.Address(), len(logger.changedValues[contract.Address()])) |
| 65 | } |
| 66 | exp := common.BigToHash(big.NewInt(1)) |
| 67 | if logger.changedValues[contract.Address()][index] != exp { |
| 68 | t.Errorf("expected %x, got %x", exp, logger.changedValues[contract.Address()][index]) |
| 69 | } |
| 70 | } |
nothing calls this directly
no test coverage detected