Skip to content

Commit

Permalink
ref(test): use function_selector in receiver mock
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Dec 10, 2024
1 parent bf2216d commit 22f6316
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions examples/erc1155-supply/tests/mock/receiver.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
#![allow(dead_code)]
#![cfg(feature = "e2e")]
use alloc::vec::Vec;

Check failure on line 3 in examples/erc1155-supply/tests/mock/receiver.rs

View workflow job for this annotation

GitHub Actions / tests

failed to resolve: use of undeclared crate or module `alloc`

use alloy::{
primitives::{fixed_bytes, Address, FixedBytes},
primitives::{fixed_bytes, Address, FixedBytes, U256},

Check warning on line 6 in examples/erc1155-supply/tests/mock/receiver.rs

View workflow job for this annotation

GitHub Actions / tests

unused import: `fixed_bytes`
sol,
};
use e2e::Wallet;
use stylus_sdk::{abi::Bytes, function_selector};

const REC_RETVAL: FixedBytes<4> = FixedBytes(function_selector!(
"onERC1155Received",
Address,
Address,
U256,
U256,
Bytes
));

const REC_RETVAL: FixedBytes<4> = fixed_bytes!("f23a6e61");
const BAT_RETVAL: FixedBytes<4> = fixed_bytes!("bc197c81");
const BAT_RETVAL: FixedBytes<4> = FixedBytes(function_selector!(
"onERC1155BatchReceived",
Address,
Address,
Vec<U256>,
Vec<U256>,
Bytes
));

sol! {
#[allow(missing_docs)]
Expand Down

0 comments on commit 22f6316

Please sign in to comment.