From d18870f9d6769092d62845f41fdaf20180a50a8a Mon Sep 17 00:00:00 2001 From: sm-stack Date: Fri, 23 Aug 2024 11:09:48 +0900 Subject: [PATCH] feat: update account and paymaster validation return format --- .../contracts-bedrock/test/mocks/TestAccount.sol | 13 +++++++------ .../contracts-bedrock/test/mocks/TestPaymaster.sol | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/contracts-bedrock/test/mocks/TestAccount.sol b/packages/contracts-bedrock/test/mocks/TestAccount.sol index 6cd2ccc392fa..f6edef572294 100644 --- a/packages/contracts-bedrock/test/mocks/TestAccount.sol +++ b/packages/contracts-bedrock/test/mocks/TestAccount.sol @@ -19,12 +19,13 @@ contract TestAccount { { (version, txHash, transaction); // limited to 48 bits - uint64 validUntil = type(uint64).max & 0xFFFFFFFFFFFF; - uint64 validAfter = 0; - validationData = - (bytes32(MAGIC_VALUE_SENDER) | - bytes32(uint256(validUntil) << (6 * 8)) | - bytes32(uint256(validAfter))); + uint48 validUntil = 0; + uint48 validAfter = 0; + validationData = bytes32( + uint256(uint32(MAGIC_VALUE_SENDER)) | + ((uint256(validUntil)) << 160) | + (uint256(validAfter) << (160 + 48)) + ); } function execute(address dest, uint256 value, bytes calldata func) external { diff --git a/packages/contracts-bedrock/test/mocks/TestPaymaster.sol b/packages/contracts-bedrock/test/mocks/TestPaymaster.sol index fc37c17f4929..7461465ae976 100644 --- a/packages/contracts-bedrock/test/mocks/TestPaymaster.sol +++ b/packages/contracts-bedrock/test/mocks/TestPaymaster.sol @@ -24,11 +24,12 @@ contract TestPaymaster { (version, txHash, transaction); context = new bytes(1); // limited to 48 bits - uint64 validUntil = type(uint64).max & 0xFFFFFFFFFFFF; - uint64 validAfter = 0; - validationData = - (bytes32(MAGIC_VALUE_PAYMASTER) | - bytes32(uint256(validUntil) << (6 * 8)) | - bytes32(uint256(validAfter))); + uint48 validUntil = 0; + uint48 validAfter = 0; + validationData = bytes32( + uint256(uint32(MAGIC_VALUE_PAYMASTER)) | + ((uint256(validUntil)) << 160) | + (uint256(validAfter) << (160 + 48)) + ); } }