Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test): add repro issue8566 testcase #9617

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ alloy-node-bindings = { version = "0.9.0", default-features = false }
alloy-network-primitives = { version = "0.9.0", default-features = false }

## alloy-core
alloy-dyn-abi = "0.8.14"
alloy-json-abi = "0.8.14"
alloy-primitives = { version = "0.8.14", features = [
alloy-dyn-abi = "0.8.18"
alloy-json-abi = "0.8.18"
alloy-primitives = { version = "0.8.18", features = [
"getrandom",
"rand",
"map-foldhash",
] }
alloy-sol-macro-expander = "0.8.14"
alloy-sol-macro-input = "0.8.14"
alloy-sol-types = "0.8.14"
syn-solidity = "0.8.14"
alloy-sol-macro-expander = "0.8.18"
alloy-sol-macro-input = "0.8.18"
alloy-sol-types = "0.8.18"
syn-solidity = "0.8.18"

alloy-chains = "0.1"
alloy-rlp = "0.3"
Expand Down
3 changes: 3 additions & 0 deletions crates/forge/tests/it/repros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,6 @@ test_repro!(8971; |config| {

// https://github.com/foundry-rs/foundry/issues/8639
test_repro!(8639);

// https://github.com/foundry-rs/foundry/issues/8566
test_repro!(8566);
18 changes: 18 additions & 0 deletions testdata/default/repros/Issue8566.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.18;

import "ds-test/test.sol";
import "cheats/Vm.sol";

// https://github.com/foundry-rs/foundry/issues/8566
contract Issue8566Test is DSTest {
Vm constant vm = Vm(HEVM_ADDRESS);

function testParseJsonUint() public {
string memory json =
"{ \"1284\": { \"addRewardInfo\": { \"amount\": 74258.225772486694040708e18, \"rewardPerSec\": 0.03069536448928848133e20 } } }";

assertEq(74258225772486694040708, vm.parseJsonUint(json, ".1284.addRewardInfo.amount"));
assertEq(3069536448928848133, vm.parseJsonUint(json, ".1284.addRewardInfo.rewardPerSec"));
}
}
Loading