@latticexyz/world 2.2.23-2ade90f493b15b4dbe56c08e97e4f8e97b716c3f → 2.2.23-7cd553a4588f2ddaeb4047393381cdd6ac91430f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.js +10 -6
- package/dist/node.js.map +1 -1
- package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -1
- package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -1
- package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -1
- package/out/BatchCallSystemLib.sol/BatchCallSystemLib.json +1 -1
- package/out/BatchCallSystemLib.sol/_batchCallFrom_SystemCallFromDataArray.json +1 -1
- package/out/BatchCallSystemLib.sol/_batchCall_SystemCallDataArray.json +1 -1
- package/out/InitModule.sol/InitModule.json +1 -1
- package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/WorldRegistrationSystemLib.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerDelegation_address_ResourceId_bytes.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerFunctionSelector_ResourceId_string.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerNamespaceDelegation_ResourceId_ResourceId_bytes.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerNamespace_ResourceId.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerRootFunctionSelector_ResourceId_string_string.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerSystemHook_ResourceId_ISystemHook_uint8.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_registerSystem_ResourceId_System_bool.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterDelegation_address.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterNamespaceDelegation_ResourceId.json +1 -1
- package/out/WorldRegistrationSystemLib.sol/_unregisterSystemHook_ResourceId_ISystemHook.json +1 -1
- package/out/build-info/{bf27acd14b2b959864c0abf4ffaa7965.json → e6f011585aed24d85d685c8bc5326202.json} +1 -1
- package/package.json +9 -9
- package/src/codegen/experimental/systems/BatchCallSystemLib.sol +16 -4
- package/src/codegen/experimental/systems/WorldRegistrationSystemLib.sol +16 -4
package/dist/node.js
CHANGED
@@ -275,7 +275,8 @@ function renderSystemLibrary(options) {
|
|
275
275
|
const functions = functionsInput.map((func) => ({
|
276
276
|
...func,
|
277
277
|
// Format parameters (add auxiliary argument names, replace calldata location)
|
278
|
-
parameters: formatParams(func.parameters),
|
278
|
+
parameters: formatParams("__auxArg", func.parameters),
|
279
|
+
returnParameters: formatParams("__auxRet", func.returnParameters),
|
279
280
|
// Remove `payable` from stateMutability for library functions
|
280
281
|
stateMutability: func.stateMutability.replace("payable", "")
|
281
282
|
}));
|
@@ -513,19 +514,22 @@ function renderAbiDecode(expression, returnParameters) {
|
|
513
514
|
const returnTypes = returnParameters.map((param) => param.split(" ")[0]).join(", ");
|
514
515
|
return `
|
515
516
|
bytes memory result = ${expression};
|
516
|
-
|
517
|
+
// skip decoding an empty result, which can happen after expectRevert
|
518
|
+
if (result.length != 0) {
|
519
|
+
return abi.decode(result, (${returnTypes}));
|
520
|
+
}
|
517
521
|
`;
|
518
522
|
}
|
519
523
|
function renderReturnParameters2(returnParameters) {
|
520
524
|
if (returnParameters.length == 0) return "";
|
521
525
|
return `returns (${renderArguments2(returnParameters)})`;
|
522
526
|
}
|
523
|
-
function formatParams(params) {
|
527
|
+
function formatParams(auxPrefix, params) {
|
524
528
|
let auxCount = 0;
|
525
|
-
return params.map((arg) => arg.replace(/ calldata /, " memory
|
529
|
+
return params.map((arg) => arg.replace(/ calldata( |$)/, " memory$1")).map((arg) => {
|
526
530
|
const items = arg.split(" ");
|
527
|
-
const needsAux = items.length === 1 || items.length === 2 && items[1]
|
528
|
-
return needsAux ? `${arg}
|
531
|
+
const needsAux = items.length === 1 || items.length === 2 && ["memory", "payable"].includes(items[1]);
|
532
|
+
return needsAux ? `${arg} ${auxPrefix}${auxCount++}` : arg;
|
529
533
|
});
|
530
534
|
}
|
531
535
|
|