Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Test cases for gas, ether transfers and state changes. #13

Open
YashKarthik opened this issue May 17, 2023 · 0 comments
Open

RFC: Test cases for gas, ether transfers and state changes. #13

YashKarthik opened this issue May 17, 2023 · 0 comments

Comments

@YashKarthik
Copy link

Hey w1nt3r,

First of all, thank you for the open sourcing this repo. The tests (and hints) have been very useful to me while building and testing Tiviem (Typescript EVM). I very recently passed all the test cases in this repo. However, I noticed that there are no test cases for testing gas, ether transfers, and state changes.

I am planning to write some tests to cover the above cases but I wanted to know if you have any plans / specifics about how to implement them.

My evm() function returns a Result object, as of now only success, stack, logs and returndata are tested against the expected values.

type Result = {
  success: boolean,
  stack: bigint[],
  memory: Uint8Array,
  gas: number,
  returndata: Uint8Array,
  logs: Log[],
  state: Map<bigint, AccountState>, // address -> AccountState
}

type AccountState = {
  balance: bigint,
  code?: {
    asm?: string,
    bin: Uint8Array
  },
  storage?: Map<bigint, bigint>,
  nonce: bigint
}

My plan I to compare test gas and state in a similar manner.

I just wanted to put this out there to thank you for open sourcing this repo and wanted some insight into if/how you plan on implementing the remaining tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant