web3swift icon indicating copy to clipboard operation
web3swift copied to clipboard

Cover EIP-1559 PRs with more tests

Open yaroslavyaroslav opened this issue 2 years ago • 2 comments

Cover EIP-1559 PRs with more tests. #509 #510 — this one covered by tests with design and logic inspired of geth yet.

yaroslavyaroslav avatar Mar 29 '22 17:03 yaroslavyaroslav

#509 includes a suite of tests added into LocalTests/web3TransactionsTests.swift These tests take a JSON representation of a signed transaction and converts it into a EtereumTransaction via the Decodable protocol. It then validates the transaction hash, which is calculated by re-encoding the decoded data and hashing it, thus the encoder is tested here as well. Finally it validates that the Signing sender address is correctly recovered. This process is then repeated for an raw (RLP) Input bytestream. I do this process to test all transaction forms/types from Fallback all the way up to EIP-1559 with accessList data present. (the signed references were created in ethers.js)

The only things not tested there is signing, and the JSON encoding. I hadn't gotten that far yet.

mloit avatar Mar 29 '22 18:03 mloit

signing tests have now been added

mloit avatar Apr 05 '22 06:04 mloit