From 23d2dc0b837da34180de69172d96835dc3a90a01 Mon Sep 17 00:00:00 2001 From: Sam MacPherson Date: Mon, 12 Aug 2024 09:25:21 -0400 Subject: [PATCH] exports should group by name instead of all into one --- lib/forge-std | 2 +- src/ScriptTools.sol | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/forge-std b/lib/forge-std index 978ac6f..74cfb77 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 978ac6fadb62f5f0b723c996f64be52eddba6801 +Subproject commit 74cfb77e308dd188d2f58864aaf44963ae6b88b1 diff --git a/src/ScriptTools.sol b/src/ScriptTools.sol index c44af96..733f0aa 100644 --- a/src/ScriptTools.sol +++ b/src/ScriptTools.sol @@ -137,7 +137,7 @@ library ScriptTools { */ function exportContract(string memory name, string memory label, address addr) internal { name = vm.envOr("FOUNDRY_EXPORTS_NAME", name); - string memory json = vm.serializeAddress(EXPORT_JSON_KEY, label, addr); + string memory json = vm.serializeAddress(string(abi.encodePacked(EXPORT_JSON_KEY, "_", name)), label, addr); _doExport(name, json); } @@ -162,7 +162,7 @@ library ScriptTools { */ function exportValue(string memory name, string memory label, uint256 val) internal { name = vm.envOr("FOUNDRY_EXPORTS_NAME", name); - string memory json = vm.serializeUint(EXPORT_JSON_KEY, label, val); + string memory json = vm.serializeUint(string(abi.encodePacked(EXPORT_JSON_KEY, "_", name)), label, val); _doExport(name, json); } @@ -187,7 +187,7 @@ library ScriptTools { */ function exportValue(string memory name, string memory label, string memory val) internal { name = vm.envOr("FOUNDRY_EXPORTS_NAME", name); - string memory json = vm.serializeString(EXPORT_JSON_KEY, label, val); + string memory json = vm.serializeString(string(abi.encodePacked(EXPORT_JSON_KEY, "_", name)), label, val); _doExport(name, json); }