Web3.swift
Web3.swift copied to clipboard
Fix 2/7 failing test cases by getting latest block
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.
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.