unit test passing locally

This commit is contained in:
Michael Shaw 2023-03-16 17:55:55 -04:00
parent 7be0033d12
commit d322709288
7 changed files with 10 additions and 10 deletions

View File

@ -71,7 +71,7 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr) traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr)
transactions := block.Transactions() transactions := block.Transactions()
// Derive any missing fields // Derive any missing fields
if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, transactions); err != nil { if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, block.BaseFee(), transactions); err != nil {
return nil, err return nil, err
} }

View File

@ -140,7 +140,7 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr) traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr)
transactions := block.Transactions() transactions := block.Transactions()
// Derive any missing fields // Derive any missing fields
if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, transactions); err != nil { if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, block.BaseFee(), transactions); err != nil {
return nil, err return nil, err
} }

View File

@ -91,7 +91,7 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr) traceMsg := fmt.Sprintf("indexer stats for statediff at %d with hash %s:\r\n", height, blockHashStr)
transactions := block.Transactions() transactions := block.Transactions()
// Derive any missing fields // Derive any missing fields
if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, transactions); err != nil { if err := receipts.DeriveFields(sdi.chainConfig, blockHash, height, block.BaseFee(), transactions); err != nil {
return nil, err return nil, err
} }

View File

@ -72,7 +72,7 @@ var writeLoopParams = ParamsWithMutex{
type blockChain interface { type blockChain interface {
SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
CurrentBlock() *types.Block CurrentBlock() *types.Header
GetBlockByHash(hash common.Hash) *types.Block GetBlockByHash(hash common.Hash) *types.Block
GetBlockByNumber(number uint64) *types.Block GetBlockByNumber(number uint64) *types.Block
GetReceiptsByHash(hash common.Hash) types.Receipts GetReceiptsByHash(hash common.Hash) types.Receipts
@ -943,7 +943,7 @@ func (sds *Service) WatchAddress(operation types2.OperationType, args []types2.W
defer writeLoopParams.Unlock() defer writeLoopParams.Unlock()
// get the current block number // get the current block number
currentBlockNumber := sds.BlockChain.CurrentBlock().Number() currentBlockNumber := sds.BlockChain.CurrentBlock().Number
switch operation { switch operation {
case types2.Add: case types2.Add:

View File

@ -134,7 +134,7 @@ func (backend *Backend) CurrentHeader() *types.Header {
panic("not implemented") // TODO: Implement panic("not implemented") // TODO: Implement
} }
func (backend *Backend) CurrentBlock() *types.Block { func (backend *Backend) CurrentBlock() *types.Header {
panic("not implemented") // TODO: Implement panic("not implemented") // TODO: Implement
} }
@ -169,7 +169,7 @@ func (backend *Backend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
panic("not implemented") // TODO: Implement panic("not implemented") // TODO: Implement
} }
func (backend *Backend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) { func (backend *Backend) GetEVM(ctx context.Context, msg *core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) {
panic("not implemented") // TODO: Implement panic("not implemented") // TODO: Implement
} }

View File

@ -134,8 +134,8 @@ func (bc *BlockChain) SetCurrentBlock(block *types.Block) {
} }
// CurrentBlock mock method // CurrentBlock mock method
func (bc *BlockChain) CurrentBlock() *types.Block { func (bc *BlockChain) CurrentBlock() *types.Header {
return bc.currentBlock return bc.currentBlock.Header()
} }
func (bc *BlockChain) SetTd(hash common.Hash, blockNum uint64, td *big.Int) { func (bc *BlockChain) SetTd(hash common.Hash, blockNum uint64, td *big.Int) {

View File

@ -350,7 +350,7 @@ func (sds *MockStateDiffService) WatchAddress(operation sdtypes.OperationType, a
defer sds.writeLoopParams.Unlock() defer sds.writeLoopParams.Unlock()
// get the current block number // get the current block number
currentBlockNumber := sds.BlockChain.CurrentBlock().Number() currentBlockNumber := sds.BlockChain.CurrentBlock().Number
switch operation { switch operation {
case sdtypes.Add: case sdtypes.Add: