Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
feat: update account and paymaster validation return format
Browse files Browse the repository at this point in the history
  • Loading branch information
sm-stack committed Aug 26, 2024
1 parent bf5613e commit d18870f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions packages/contracts-bedrock/test/mocks/TestAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 7 additions & 6 deletions packages/contracts-bedrock/test/mocks/TestPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
}
}

0 comments on commit d18870f

Please sign in to comment.