Skip to content

Commit 782787b

Browse files
authored
feat(test): add repro issue8566 testcase (#9617)
* feat(test): add Issue8566 testcase Signed-off-by: 9547 <[email protected]> * bump alloy to 0.8.18 Signed-off-by: 9547 <[email protected]> --------- Signed-off-by: 9547 <[email protected]>
1 parent dc8d980 commit 782787b

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ alloy-node-bindings = { version = "0.9.0", default-features = false }
210210
alloy-network-primitives = { version = "0.9.0", default-features = false }
211211

212212
## alloy-core
213-
alloy-dyn-abi = "0.8.14"
214-
alloy-json-abi = "0.8.14"
215-
alloy-primitives = { version = "0.8.14", features = [
213+
alloy-dyn-abi = "0.8.18"
214+
alloy-json-abi = "0.8.18"
215+
alloy-primitives = { version = "0.8.18", features = [
216216
"getrandom",
217217
"rand",
218218
"map-foldhash",
219219
] }
220-
alloy-sol-macro-expander = "0.8.14"
221-
alloy-sol-macro-input = "0.8.14"
222-
alloy-sol-types = "0.8.14"
223-
syn-solidity = "0.8.14"
220+
alloy-sol-macro-expander = "0.8.18"
221+
alloy-sol-macro-input = "0.8.18"
222+
alloy-sol-types = "0.8.18"
223+
syn-solidity = "0.8.18"
224224

225225
alloy-chains = "0.1"
226226
alloy-rlp = "0.3"

crates/forge/tests/it/repros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,6 @@ test_repro!(8971; |config| {
389389

390390
// https://github.com/foundry-rs/foundry/issues/8639
391391
test_repro!(8639);
392+
393+
// https://github.com/foundry-rs/foundry/issues/8566
394+
test_repro!(8566);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
pragma solidity ^0.8.18;
3+
4+
import "ds-test/test.sol";
5+
import "cheats/Vm.sol";
6+
7+
// https://github.com/foundry-rs/foundry/issues/8566
8+
contract Issue8566Test is DSTest {
9+
Vm constant vm = Vm(HEVM_ADDRESS);
10+
11+
function testParseJsonUint() public {
12+
string memory json =
13+
"{ \"1284\": { \"addRewardInfo\": { \"amount\": 74258.225772486694040708e18, \"rewardPerSec\": 0.03069536448928848133e20 } } }";
14+
15+
assertEq(74258225772486694040708, vm.parseJsonUint(json, ".1284.addRewardInfo.amount"));
16+
assertEq(3069536448928848133, vm.parseJsonUint(json, ".1284.addRewardInfo.rewardPerSec"));
17+
}
18+
}

0 commit comments

Comments
 (0)