Skip to content

Instantly share code, notes, and snippets.

@bshastry
Created November 29, 2023 06:04
Show Gist options
  • Save bshastry/5b82a1800365367fee2657042ab80a04 to your computer and use it in GitHub Desktop.
Save bshastry/5b82a1800365367fee2657042ab80a04 to your computer and use it in GitHub Desktop.
Compiling fe-test-runner v0.26.0 (/home/bhargava/work/github/fe/crates/test-runner)
Compiling libfuzzer-sys v0.4.7
error[E0432]: unresolved import `revm::primitives::B160`
--> /home/bhargava/work/github/fe/crates/test-runner/src/lib.rs:5:81
|
5 | use revm::primitives::{AccountInfo, Bytecode, Env, ExecutionResult, TransactTo, B160, U256};
| ^^^^ no `B160` in the root
error[E0308]: mismatched types
--> /home/bhargava/work/github/fe/crates/test-runner/src/lib.rs:116:38
|
116 | let bytecode = Bytecode::new_raw(Bytes::copy_from_slice(&hex::decode(bytecode).unwrap()));
| ----------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `revm::revm_precompile::Bytes`, found `bytes::Bytes`
| |
| arguments to this function are incorrect
|
= note: `bytes::Bytes` and `revm::revm_precompile::Bytes` have similar names, but are actually distinct types
note: `bytes::Bytes` is defined in crate `bytes`
--> /home/bhargava/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-1.5.0/src/bytes.rs:100:1
|
100 | pub struct Bytes {
| ^^^^^^^^^^^^^^^^
note: `revm::revm_precompile::Bytes` is defined in crate `alloy_primitives`
--> /home/bhargava/.cargo/registry/src/github.com-1ecc6299db9ec823/alloy-primitives-0.4.2/src/bytes/mod.rs:17:1
|
17 | pub struct Bytes(pub bytes::Bytes);
| ^^^^^^^^^^^^^^^^
note: associated function defined here
--> /home/bhargava/.cargo/registry/src/github.com-1ecc6299db9ec823/revm-primitives-1.3.0/src/bytecode.rs:99:12
|
99 | pub fn new_raw(bytecode: Bytes) -> Self {
| ^^^^^^^
help: try wrapping the expression in `revm::revm_precompile::Bytes`
|
116 | let bytecode = Bytecode::new_raw(revm::revm_precompile::Bytes(Bytes::copy_from_slice(&hex::decode(bytecode).unwrap())));
| +++++++++++++++++++++++++++++ +
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
--> /home/bhargava/work/github/fe/crates/test-runner/src/lib.rs:120:21
|
120 | let test_info = AccountInfo::new(U256::ZERO, 0, bytecode);
| ^^^^^^^^^^^^^^^^ -------- an argument of type `revm::revm_primitives::FixedBytes<32>` is missing
|
note: associated function defined here
--> /home/bhargava/.cargo/registry/src/github.com-1ecc6299db9ec823/revm-primitives-1.3.0/src/state.rs:201:12
|
201 | pub fn new(balance: U256, nonce: u64, code_hash: B256, code: Bytecode) -> Self {
| ^^^
help: provide the argument
|
120 | let test_info = AccountInfo::new(U256::ZERO, 0, /* revm::revm_primitives::FixedBytes<32> */, bytecode);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0599]: no method named `as_bytes` found for reference `&revm::revm_primitives::FixedBytes<32>` in the current scope
--> /home/bhargava/work/github/fe/crates/test-runner/src/lib.rs:138:65
|
138 | .map(|sig| events.get(&Hash::from_slice(sig.as_bytes())))
| ^^^^^^^^ method not found in `&FixedBytes<32>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
1 | use zerocopy::AsBytes;
|
error[E0599]: no method named `as_bytes` found for reference `&revm::revm_primitives::FixedBytes<32>` in the current scope
--> /home/bhargava/work/github/fe/crates/test-runner/src/lib.rs:143:61
|
143 | .map(|topic| Hash::from_slice(topic.as_bytes()))
| ^^^^^^^^ method not found in `&FixedBytes<32>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
1 | use zerocopy::AsBytes;
|
Some errors have detailed explanations: E0061, E0308, E0432, E0599.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `fe-test-runner` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
Error: failed to build fuzz script: ASAN_OPTIONS="detect_odr_violation=0" RUSTFLAGS="-Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-pc-table -Cllvm-args=-sanitizer-coverage-trace-compares --cfg fuzzing -Clink-dead-code -Zsanitizer=address -Cllvm-args=-sanitizer-coverage-stack-depth -Cdebug-assertions -C codegen-units=1" "cargo" "build" "--manifest-path" "/home/bhargava/work/github/fe/fuzz/Cargo.toml" "--target" "x86_64-unknown-linux-gnu" "--release" "--bin" "single_file_fuzzer"
@HudsonGraeme
Copy link

Were you able to find a solution to this issue? Ran into this one today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment