Boilertalk / Web3.swift

A pure swift Ethereum Web3 library
MIT License
643 stars 189 forks source link

Fix 2/7 failing test cases by getting latest block #99

Open brettfazio opened 3 years ago

brettfazio commented 3 years ago

A full-node running without archive mode will prune generated state to conserve disk space. This helps with the sync time of a node and greatly reduces storage and computation cost. Because of the way account and contract storage works in Ethereum, this means that only an archive node can serve API request for certain RPC methods older than 128 blocks. thus the reason for these cases failing before.

brettfazio commented 3 years ago

I suppose the problem is accurately asserting the balance like here since the block number will be a different one every time.

But I do believe this new solution to be better as all the tests were failing before.