Skip to content

Commit 83e4759

Browse files
committed
chore: address comments
1 parent 8ecc863 commit 83e4759

5 files changed

Lines changed: 6 additions & 14 deletions

File tree

node/node.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,13 @@ func New(cfg *Config, version string, logLevel *log.Level) (*Node, error) {
204204
services := make([]service.Service, 0)
205205
earlyServices := make([]service.Service, 0)
206206

207-
opts := make([]blockchain.Option, 0, 1)
207+
opts := make([]blockchain.Option, 0, 2)
208208
if cfg.Metrics {
209209
opts = append(opts, blockchain.WithListener(makeBlockchainMetrics()))
210210
}
211-
if cfg.NewState {
212-
opts = append(opts, blockchain.WithNewState(
213-
cfg.NewState,
214-
))
215-
}
211+
opts = append(opts, blockchain.WithNewState(
212+
cfg.NewState,
213+
))
216214
chain := blockchain.New(database, &cfg.Network, opts...)
217215

218216
// Verify that cfg.Network is compatible with the database.

rpc/v10/storage_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ func TestStorageProof(t *testing.T) {
822822
mockReader.EXPECT().BlockHeaderByNumber(blockNumber).
823823
Return(headBlock.Header, nil)
824824
mockState.EXPECT().ContractClassHash(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(1)
825-
mockState.EXPECT().ContractNonce(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(0)
826825

827826
proof, rpcErr := handler.StorageProof(&blockLatest, nil, []felt.Felt{*noSuchKey}, nil)
828827
require.Nil(t, rpcErr)

rpc/v8/storage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ func TestStorageProof(t *testing.T) {
451451
mockReader.EXPECT().BlockHeaderByNumber(blockNumber).
452452
Return(headBlock.Header, nil)
453453
mockState.EXPECT().ContractClassHash(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(1)
454-
mockState.EXPECT().ContractNonce(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(0)
454+
455455
proof, rpcErr := handler.StorageProof(&blockLatest, nil, []felt.Felt{*noSuchKey}, nil)
456456
require.Nil(t, rpcErr)
457457
require.NotNil(t, proof)

rpc/v9/storage_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ func TestStorageProof(t *testing.T) {
481481
mockReader.EXPECT().BlockHeaderByNumber(blockNumber).
482482
Return(headBlock.Header, nil)
483483
mockState.EXPECT().ContractClassHash(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(1)
484-
mockState.EXPECT().ContractNonce(noSuchKey).Return(felt.Zero, db.ErrKeyNotFound).Times(0)
485484

486485
proof, rpcErr := handler.StorageProof(&blockLatest, nil, []felt.Felt{*noSuchKey}, nil)
487486
require.Nil(t, rpcErr)

vm/vm_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,5 @@ func NewState(
439439
}
440440
triedb := triedb.New(testDB, nil)
441441
stateDB := state.NewStateDB(testDB, triedb)
442-
state, err := state.New(stateRoot, stateDB, batch)
443-
if err != nil {
444-
return nil, err
445-
}
446-
return state, nil
442+
return state.New(stateRoot, stateDB, batch)
447443
}

0 commit comments

Comments
 (0)