Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdubs committed Jul 24, 2024
1 parent 8f64bdc commit c64a185
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
26 changes: 11 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const ERC1271_MOCK_BYTECODE: &[u8] = include_bytes!(concat!(
"/../../../../.foundry/forge/out/Erc1271Mock.sol/Erc1271Mock.bytecode"
));


sol! {
contract ValidateSigOffchain {
constructor (address _signer, bytes32 _hash, bytes memory _signature);
Expand All @@ -60,7 +59,6 @@ sol! {

}


sol! {
struct ERC6492Signature {
address create2_factory;
Expand Down Expand Up @@ -410,17 +408,16 @@ where
.map(|code| !code.is_empty())
.unwrap();
if code_exists {
let call_request =
TransactionRequest::default()
.to(address)
.input(TransactionInput::new(
Erc1271Mock::isValidSignatureCall {
_hash: message,
_signature: signature.into(),
}
.abi_encode()
.into(),
));
let call_request = TransactionRequest::default()
.to(address)
.input(TransactionInput::new(
Erc1271Mock::isValidSignatureCall {
_hash: message,
_signature: signature.into(),
}
.abi_encode()
.into(),
));

let result = provider.call(&call_request).await;

Expand Down Expand Up @@ -523,7 +520,6 @@ mod test {
.await
.unwrap()
.is_valid());

}

#[tokio::test]
Expand Down Expand Up @@ -992,7 +988,7 @@ mod test {
let (_anvil, _rpc_url, provider, _private_key) =
// contract deployed at 0x3e5608baE5e195F7EB12792f0Ba1aEf911F364E9 on base sepolia
spawn_anvil(Some("https://sepolia.base.org"), Some(13037026));

let message = "Example Message";
let hash_message: FixedBytes<32> = eip191_hash_message(message.as_bytes());
let signature:Bytes = alloy::hex::decode("0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000017000000000000000000000000000000000000000000000000000000000000000111d8c5e6edcd92aeac9ee215372ebf3264300a429ae6dd79f93d71781d1a397d747b83a603182db717314be83bf9ae0d18d0652294a09d8d472a0cdd6f4a11c80000000000000000000000000000000000000000000000000000000000000025f9351d6932d2b1c9aca4fee013c4ff2672f712f28e9c37330bac4fa19292b8351d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008f7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2274337659526847564b6258504a476c506e51676d79495950573079442d356b497675536e497a494d485a4d222c226f726967696e223a2268747470733a2f2f6b6579732d626574612e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d0000000000000000000000000000000000").unwrap().into();
Expand Down
2 changes: 1 addition & 1 deletion src/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn spawn_anvil(
block_number: Option<BlockNumber>,
) -> (AnvilInstance, String, ReqwestProvider, SigningKey) {
// let anvil = if fork_url.is_none() && block_number.is_none() {
let anvil = Anvil::at(format_foundry_dir("bin/anvil")).spawn();
let anvil = Anvil::at(format_foundry_dir("bin/anvil")).spawn();
let rpc_url = anvil.endpoint();
let provider = ReqwestProvider::<Ethereum>::new_http(anvil.endpoint_url());
let private_key = anvil.keys().first().unwrap().clone();
Expand Down

0 comments on commit c64a185

Please sign in to comment.