Skip to content

Commit 81828d7

Browse files
fix broken tests (#106)
1 parent b64dfe5 commit 81828d7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

eth/tracers/js/tracer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type vmContext struct {
5757
}
5858

5959
func testCtx() *vmContext {
60-
return &vmContext{blockCtx: vm.BlockContext{BlockNumber: big.NewInt(1), Time: big.NewInt(1)}, txCtx: vm.TxContext{GasPrice: big.NewInt(100000)}}
60+
return &vmContext{blockCtx: vm.BlockContext{BlockNumber: big.NewInt(1), Time: 1}, txCtx: vm.TxContext{GasPrice: big.NewInt(100000)}}
6161
}
6262

6363
func runTrace(tracer tracers.Tracer, vmctx *vmContext, chaincfg *params.ChainConfig, contractCode []byte) (json.RawMessage, error) {
@@ -180,7 +180,7 @@ func TestHaltBetweenSteps(t *testing.T) {
180180
if err != nil {
181181
t.Fatal(err)
182182
}
183-
env := vm.NewEVM(vm.BlockContext{BlockNumber: big.NewInt(1), Time: big.NewInt(1)}, vm.TxContext{GasPrice: big.NewInt(1)}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
183+
env := vm.NewEVM(vm.BlockContext{BlockNumber: big.NewInt(1), Time: 1}, vm.TxContext{GasPrice: big.NewInt(1)}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
184184
scope := &vm.ScopeContext{
185185
Contract: vm.NewContract(&account{}, &account{}, big.NewInt(0), 0),
186186
}
@@ -204,7 +204,7 @@ func TestNoStepExec(t *testing.T) {
204204
if err != nil {
205205
t.Fatal(err)
206206
}
207-
env := vm.NewEVM(vm.BlockContext{BlockNumber: big.NewInt(1), Time: big.NewInt(1)}, vm.TxContext{GasPrice: big.NewInt(100)}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
207+
env := vm.NewEVM(vm.BlockContext{BlockNumber: big.NewInt(1), Time: 1}, vm.TxContext{GasPrice: big.NewInt(100)}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: tracer})
208208
tracer.CaptureStart(env, common.Address{}, common.Address{}, false, []byte{}, 1000, big.NewInt(0))
209209
tracer.CaptureEnd(nil, 0, nil)
210210
ret, err := tracer.GetResult()
@@ -239,7 +239,7 @@ func TestIsPrecompile(t *testing.T) {
239239
t.Fatal(err)
240240
}
241241

242-
blockCtx := vm.BlockContext{BlockNumber: big.NewInt(150), Time: big.NewInt(150)}
242+
blockCtx := vm.BlockContext{BlockNumber: big.NewInt(150), Time: 150}
243243
res, err := runTrace(tracer, &vmContext{blockCtx, txCtx}, chaincfg, nil)
244244
if err != nil {
245245
t.Error(err)
@@ -249,7 +249,7 @@ func TestIsPrecompile(t *testing.T) {
249249
}
250250

251251
tracer, _ = newJsTracer("{addr: toAddress('0000000000000000000000000000000000000009'), res: null, step: function() { this.res = isPrecompiled(this.addr); }, fault: function() {}, result: function() { return this.res; }}", nil, nil)
252-
blockCtx = vm.BlockContext{BlockNumber: big.NewInt(250), Time: big.NewInt(250)}
252+
blockCtx = vm.BlockContext{BlockNumber: big.NewInt(250), Time: 250}
253253
res, err = runTrace(tracer, &vmContext{blockCtx, txCtx}, chaincfg, nil)
254254
if err != nil {
255255
t.Error(err)

eth/tracers/logger/logger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (*dummyStatedb) SetState(_ common.Address, _ common.Hash, _ common.Hash) {}
5555
func TestStoreCapture(t *testing.T) {
5656
var (
5757
logger = NewStructLogger(nil)
58-
env = vm.NewEVM(vm.BlockContext{Time: big.NewInt(0)}, vm.TxContext{}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: logger})
58+
env = vm.NewEVM(vm.BlockContext{Time: 0}, vm.TxContext{}, &dummyStatedb{}, params.TestChainConfig, vm.Config{Debug: true, Tracer: logger})
5959
contract = vm.NewContract(&dummyContractRef{}, &dummyContractRef{}, new(big.Int), 100000)
6060
)
6161
contract.Code = []byte{byte(vm.PUSH1), 0x1, byte(vm.PUSH1), 0x0, byte(vm.SSTORE)}

les/catalyst/api_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func TestShardingExecutePayloadV1(t *testing.T) {
174174
defer n.Close()
175175

176176
api := NewConsensusAPI(lesService)
177-
fcState := beacon.ForkchoiceStateV1{
177+
fcState := engine.ForkchoiceStateV1{
178178
HeadBlockHash: postBlocks[0].Hash(),
179179
SafeBlockHash: common.Hash{},
180180
FinalizedBlockHash: common.Hash{},
@@ -204,7 +204,7 @@ func TestShardingExecutePayloadV1(t *testing.T) {
204204
ExcessDataGas: block.ExcessDataGas(),
205205
}, nil, nil, nil, trie.NewStackTrie(nil))
206206

207-
_, err := api.ExecutePayloadV1(beacon.ExecutableData{
207+
_, err := api.ExecutePayloadV1(engine.ExecutableData{
208208
ParentHash: fakeBlock.ParentHash(),
209209
FeeRecipient: fakeBlock.Coinbase(),
210210
StateRoot: fakeBlock.Root(),
@@ -228,7 +228,7 @@ func TestShardingExecutePayloadV1(t *testing.T) {
228228
if headHeader.Number.Uint64() != fakeBlock.NumberU64()-1 {
229229
t.Fatal("Unexpected chain head update")
230230
}
231-
fcState = beacon.ForkchoiceStateV1{
231+
fcState = engine.ForkchoiceStateV1{
232232
HeadBlockHash: fakeBlock.Hash(),
233233
SafeBlockHash: common.Hash{},
234234
FinalizedBlockHash: common.Hash{},

0 commit comments

Comments
 (0)