Skip to content

Commit 7e385b0

Browse files
committed
test: partially revert e9764bb
1 parent a472129 commit 7e385b0

File tree

3 files changed

+39
-46
lines changed

3 files changed

+39
-46
lines changed

crates/cast/tests/cli/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ casttest!(mktx_raw_unsigned_no_from_missing_nonce, |_prj, cmd| {
16861686
"--chain",
16871687
"1",
16881688
"--gas-limit",
1689-
"21000",
1689+
"21000",
16901690
"--gas-price",
16911691
"20000000000",
16921692
"0x742d35Cc6634C0532925a3b8D6Ac6F67C9c2b7FD",
@@ -3384,7 +3384,7 @@ Traces:
33843384
│ ├─ [2553] 0x2Ce6311ddAE708829bc0784C967b7d77D19FD779::balanceOf(0xA12384c5E52fD646E7BC7F6B3b33A605651F566E) [delegatecall]
33853385
│ │ └─ ← [Return] 0x000000000000000000000000000000000000000000000000000000000000f3b9
33863386
│ └─ ← [Return] 0x000000000000000000000000000000000000000000000000000000000000f3b9
3387-
├─ [65442] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::fulfillBasicOrder_efficient_6GL6yc()
3387+
├─ [65442] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::00000000(00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a12384c5e52fd646e7bc7f6b3b33a605651f566e000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f0000000000000000000000000000000000000000000000000000000000036cd000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000327a25ad5cfe5c4d4339c1a4267d4a83e8c93312000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000b55b053230e4effb6609de652fca73fd1c2980400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
33883388
│ ├─ [25070] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::unwrapAndValidateSignature(0x290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff, 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00) [staticcall]
33893389
│ │ ├─ [22067] 0x0B55b053230E4EFFb6609de652fCa73Fd1C29804::unwrapAndValidateSignature(0x290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff, 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00) [delegatecall]
33903390
│ │ │ ├─ [2369] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::pauseFlag() [staticcall]
@@ -3418,7 +3418,7 @@ Traces:
34183418
│ │ ├─ [553] 0x2Ce6311ddAE708829bc0784C967b7d77D19FD779::balanceOf(0x327a25aD5Cfe5c4D4339C1A4267D4a83E8c93312) [delegatecall]
34193419
│ │ │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000009c9a
34203420
│ │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000009c9a
3421-
│ ├─ [5675] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::multicallN2M_001Taw5z()
3421+
│ ├─ [5675] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::00000001(00000000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a12384c5e52fd646e7bc7f6b3b33a605651f566e000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f0000000000000000000000000000000000000000000000000000000000036cd000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000327a25ad5cfe5c4d4339c1a4267d4a83e8c93312000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000b55b053230e4effb6609de652fca73fd1c2980400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
34223422
│ │ ├─ [4148] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::execute(0x0100000000007821000100000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b)
34233423
│ │ │ ├─ [3693] 0x0B55b053230E4EFFb6609de652fCa73Fd1C29804::execute(0x0100000000007821000100000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b) [delegatecall]
34243424
│ │ │ │ ├─ [435] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::fallback()
@@ -3586,12 +3586,12 @@ forgetest_async!(cast_send_create_with_constructor_args, |prj, cmd| {
35863586
contract ConstructorContract {
35873587
uint256 public value;
35883588
string public name;
3589-
3589+
35903590
constructor(uint256 _value, string memory _name) {
35913591
value = _value;
35923592
name = _name;
35933593
}
3594-
3594+
35953595
function getValue() public view returns (uint256) {
35963596
return value;
35973597
}
@@ -3665,7 +3665,7 @@ casttest!(cast_estimate_create_with_constructor_args, |prj, cmd| {
36653665
contract EstimateContract {
36663666
uint256 public value;
36673667
string public name;
3668-
3668+
36693669
constructor(uint256 _value, string memory _name) {
36703670
value = _value;
36713671
name = _name;
@@ -3767,13 +3767,13 @@ contract ComplexContract {
37673767
address public owner;
37683768
uint256[] public values;
37693769
bool public active;
3770-
3770+
37713771
constructor(address _owner, uint256[] memory _values, bool _active) {
37723772
owner = _owner;
37733773
values = _values;
37743774
active = _active;
37753775
}
3776-
3776+
37773777
function getValuesLength() public view returns (uint256) {
37783778
return values.length;
37793779
}

crates/cast/tests/cli/selectors.rs

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
casttest!(
2-
#[ignore = "selector missing upstream"]
3-
error_decode_with_sourcify,
4-
|prj, cmd| {
5-
prj.clear_cache();
6-
cmd.args(["decode-error",
7-
"0xcf47918100000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000100000000"
8-
]).assert_success().stdout_eq(str![[r#" InsufficientBalance(uint256,uint256)
9-
256
10-
4294967296 [4.294e9]
1+
casttest!(error_decode_with_openchain, |prj, cmd| {
2+
prj.clear_cache();
3+
cmd.args(["decode-error", "0x7a0e198500000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000064"]).assert_success().stdout_eq(str![[r#"
4+
ValueTooHigh(uint256,uint256)
5+
101
6+
100
117
128
"#]]);
13-
}
14-
);
9+
});
1510

1611
casttest!(fourbyte, |_prj, cmd| {
1712
cmd.args(["4byte", "0xa9059cbb"]).assert_success().stdout_eq(str![[r#"
1813
transfer(address,uint256)
19-
_____$_$__$___$$$___$$___$__$$(address,uint256)
2014
2115
"#]]);
2216
});
@@ -30,46 +24,45 @@ For more information, try '--help'.
3024
"#]]);
3125
});
3226

33-
casttest!(
34-
#[ignore = "selector missing upstream"]
35-
fourbyte_calldata,
36-
|_prj, cmd| {
37-
cmd.args(["4byte-calldata",
38-
"0xa9059cbb0000000000000000000000000a2ac0c368dc8ec680a0c98c907656bd970675950000000000000000000000000000000000000000000000000000000767954a79"
39-
]).assert_success().stdout_eq(str![[r#"
27+
casttest!(fourbyte_calldata, |_prj, cmd| {
28+
cmd.args(["4byte-calldata", "0xa9059cbb0000000000000000000000000a2ac0c368dc8ec680a0c98c907656bd970675950000000000000000000000000000000000000000000000000000000767954a79"]).assert_success().stdout_eq(str![[r#"
4029
1) "transfer(address,uint256)"
4130
0x0A2AC0c368Dc8eC680a0c98C907656BD97067595
4231
31802608249 [3.18e10]
4332
4433
"#]]);
45-
}
46-
);
34+
});
4735

4836
casttest!(fourbyte_calldata_only_selector, |_prj, cmd| {
4937
cmd.args(["4byte-calldata", "0xa9059cbb"]).assert_success().stdout_eq(str![[r#"
5038
transfer(address,uint256)
51-
_____$_$__$___$$$___$$___$__$$(address,uint256)
5239
5340
"#]]);
5441
});
5542

5643
casttest!(fourbyte_calldata_alias, |_prj, cmd| {
57-
cmd
58-
.stdin(b"1\n")
59-
.args(["4byte-decode", "0xa9059cbb0000000000000000000000000a2ac0c368dc8ec680a0c98c907656bd970675950000000000000000000000000000000000000000000000000000000767954a79"]).assert_success().stdout_eq(str![[r#"
44+
cmd.args(["4byte-decode", "0xa9059cbb0000000000000000000000000a2ac0c368dc8ec680a0c98c907656bd970675950000000000000000000000000000000000000000000000000000000767954a79"]).assert_success().stdout_eq(str![[r#"
6045
1) "transfer(address,uint256)"
61-
2) "_____$_$__$___$$$___$$___$__$$(address,uint256)"
62-
Select a function signature by number: 0x0A2AC0c368Dc8eC680a0c98C907656BD97067595
46+
0x0A2AC0c368Dc8eC680a0c98C907656BD97067595
6347
31802608249 [3.18e10]
6448
6549
"#]]);
6650
});
6751

6852
casttest!(fourbyte_event, |_prj, cmd| {
69-
cmd.args(["4byte-event", "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"])
53+
cmd.args(["4byte-event", "0x7e1db2a1cd12f0506ecd806dba508035b290666b84b096a87af2fd2a1516ede6"])
54+
.assert_success()
55+
.stdout_eq(str![[r#"
56+
updateAuthority(address,uint8)
57+
58+
"#]]);
59+
});
60+
61+
casttest!(fourbyte_event_2, |_prj, cmd| {
62+
cmd.args(["4byte-event", "0xb7009613e63fb13fd59a2fa4c206a992c1f090a44e5d530be255aa17fed0b3dd"])
7063
.assert_success()
7164
.stdout_eq(str![[r#"
72-
Transfer(address,address,uint256)
65+
canCall(address,address,bytes4)
7366
7467
"#]]);
7568
});
@@ -91,8 +84,8 @@ casttest!(event_decode_with_sig, |_prj, cmd| {
9184
"#]]);
9285
});
9386

94-
// tests cast can decode event with Sourcify API
95-
casttest!(event_decode, |prj, cmd| {
87+
// tests cast can decode event with Openchain API
88+
casttest!(event_decode_with_openchain, |prj, cmd| {
9689
prj.clear_cache();
9790
cmd.args(["decode-event", "0xe27c4c1372396a3d15a9922f74f9dfc7c72b1ad6d63868470787249c356454c1000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000dd00000004e"]).assert_success().stdout_eq(str![[r#"
9891
BaseCurrencySet(address,uint256)

crates/evm/traces/src/identifier/signatures.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use eyre::Result;
44
use foundry_common::{
55
abi::{get_error, get_event, get_func},
66
fs,
7-
selectors::{SelectorKind, SourcifyClient},
7+
selectors::{OpenChainClient, SelectorKind},
88
};
99
use foundry_config::Config;
1010
use serde::{Deserialize, Serialize};
@@ -147,7 +147,7 @@ impl SignaturesCache {
147147
}
148148

149149
/// An identifier that tries to identify functions and events using signatures found at
150-
/// `https://sourcify.dev` or a local cache.
150+
/// `https://openchain.xyz` or a local cache.
151151
#[derive(Clone, Debug)]
152152
pub struct SignaturesIdentifier(Arc<SignaturesIdentifierInner>);
153153

@@ -157,8 +157,8 @@ struct SignaturesIdentifierInner {
157157
cache: RwLock<SignaturesCache>,
158158
/// Location where to save the signature cache.
159159
cache_path: Option<PathBuf>,
160-
/// The Sourcify client to fetch signatures from. `None` if disabled on construction.
161-
client: Option<SourcifyClient>,
160+
/// The OpenChain client to fetch signatures from. `None` if disabled on construction.
161+
client: Option<OpenChainClient>,
162162
}
163163

164164
impl SignaturesIdentifier {
@@ -175,9 +175,9 @@ impl SignaturesIdentifier {
175175
/// Creates a new `SignaturesIdentifier`.
176176
///
177177
/// - `cache_dir` is the cache directory to store the signatures.
178-
/// - `offline` disables the Sourcify client.
178+
/// - `offline` disables the OpenChain client.
179179
pub fn new_with(cache_dir: Option<&Path>, offline: bool) -> Result<Self> {
180-
let client = if !offline { Some(SourcifyClient::new()?) } else { None };
180+
let client = if !offline { Some(OpenChainClient::new()?) } else { None };
181181
let (cache, cache_path) = if let Some(cache_dir) = cache_dir {
182182
let path = cache_dir.join("signatures");
183183
let cache = SignaturesCache::load(&path);

0 commit comments

Comments
 (0)