Skip to content

Commit

Permalink
Integrate jsontests to CI (#212)
Browse files Browse the repository at this point in the history
* Integrate jsontests to CI

* cargo test -> cargo run

* Run cargo fmt

* Test CI #1

* Test CI #2

* Test CI #3
  • Loading branch information
sorpaas committed Nov 10, 2023
1 parent a9ca4ba commit bc94954
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
jsontests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
path: jsontests/res/ethtests
repository: ethereum/tests
ref: 428f218d7d6f4a52544e12684afbfe6e2882ffbf
- name: Run tests
run: |
cargo run --release --verbose -p jsontests -- \
jsontests/res/ethtests/GeneralStateTests/stExample/add11.json
12 changes: 6 additions & 6 deletions interpreter/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ pub trait RuntimeBackend: RuntimeBaseBackend {
fn set_code(&mut self, address: H160, code: Vec<u8>);
/// Reset balance of an account.
fn reset_balance(&mut self, address: H160);
fn deposit(&mut self, target: H160, value: U256);
fn withdrawal(&mut self, source: H160, value: U256) -> Result<(), ExitError>;
fn deposit(&mut self, target: H160, value: U256);
fn withdrawal(&mut self, source: H160, value: U256) -> Result<(), ExitError>;
/// Initiate a transfer.
fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError> {
self.withdrawal(transfer.source, transfer.value)?;
self.deposit(transfer.target, transfer.value);
Ok(())
}
self.withdrawal(transfer.source, transfer.value)?;
self.deposit(transfer.target, transfer.value);
Ok(())
}
/// Increase the nonce value.
fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError>;
}

0 comments on commit bc94954

Please sign in to comment.