Skip to content

Commit

Permalink
trying to build
Browse files Browse the repository at this point in the history
  • Loading branch information
yashnevatia committed Nov 26, 2024
1 parent ce0a82a commit dc6de3b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions core/chains/evm/client/simulated_backend_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ func (c *SimulatedBackendClient) SubscribeFilterLogs(ctx context.Context, q ethe

// currentBlockNumber returns index of *pending* block in simulated blockchain
func (c *SimulatedBackendClient) currentBlockNumber() *big.Int {
return c.b.Blockchain().CurrentBlock().Number
// return c.b.Blockchain().CurrentBlock().Number
return big.NewInt(0)
}

func (c *SimulatedBackendClient) finalizedBlockNumber() *big.Int {
return c.b.Blockchain().CurrentFinalBlock().Number
// return c.b.Blockchain().CurrentFinalBlock().Number
return big.NewInt(0)
}

func (c *SimulatedBackendClient) TokenBalance(ctx context.Context, address common.Address, contractAddress common.Address) (balance *big.Int, err error) {
Expand Down Expand Up @@ -540,12 +542,12 @@ func (c *SimulatedBackendClient) IsL2() bool {

func (c *SimulatedBackendClient) fetchHeader(ctx context.Context, blockNumOrTag string) (*types.Header, error) {
switch blockNumOrTag {
case rpc.SafeBlockNumber.String():
return c.b.Blockchain().CurrentSafeBlock(), nil
case rpc.LatestBlockNumber.String():
return c.b.Blockchain().CurrentHeader(), nil
case rpc.FinalizedBlockNumber.String():
return c.b.Blockchain().CurrentFinalBlock(), nil
// case rpc.SafeBlockNumber.String():
// return c.b.Blockchain().CurrentSafeBlock(), nil
// case rpc.LatestBlockNumber.String():
// return c.b.Blockchain().CurrentHeader(), nil
// case rpc.FinalizedBlockNumber.String():
// return c.b.Blockchain().CurrentFinalBlock(), nil
default:
blockNum, ok := new(big.Int).SetString(blockNumOrTag, 0)
if !ok {
Expand Down

0 comments on commit dc6de3b

Please sign in to comment.