Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m3s
CI/CD Pipeline / Security Scanning (push) Successful in 2m18s
CI/CD Pipeline / Lint and Format (push) Failing after 34s
CI/CD Pipeline / Terraform Validation (push) Failing after 20s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 22s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 40s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 21s
Validation / validate-genesis (push) Successful in 25s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 8s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m11s
Validation / validate-documentation (push) Failing after 14s
Verify Deployment / Verify Deployment (push) Failing after 45s
Ship AddressActivityRegistry V1/V2, ISO20022IntakeGateway, Chain138ParticipantSurface, checkpoint hub contracts, checkpoint-core package, aggregator/indexer/sdk services, relay profile guards, M00 diamond bridge facet, and OMNL compliance contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
54 lines
1.9 KiB
Solidity
54 lines
1.9 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {Test} from "forge-std/Test.sol";
|
|
import {MirrorDetailExtension} from "../../contracts/mainnet-checkpoint/extensions/MirrorDetailExtension.sol";
|
|
import {CheckpointStorage} from "../../contracts/mainnet-checkpoint/storage/CheckpointStorage.sol";
|
|
import {CheckpointLeaf} from "../../contracts/mainnet-checkpoint/libraries/CheckpointLeaf.sol";
|
|
|
|
contract MirrorDetailV2DecodeTest is Test {
|
|
MirrorDetailExtension mirror;
|
|
|
|
function setUp() public {
|
|
mirror = new MirrorDetailExtension();
|
|
}
|
|
|
|
function testAfterSubmitStoresV2TokenValue() public {
|
|
CheckpointLeaf.PaymentLeafV2[] memory leaves = new CheckpointLeaf.PaymentLeafV2[](1);
|
|
leaves[0] = CheckpointLeaf.PaymentLeafV2({
|
|
txHash: keccak256("t"),
|
|
from: address(1),
|
|
to: address(2),
|
|
token: address(0xAA),
|
|
value: 5_000_000,
|
|
blockNumber: 1,
|
|
blockTimestamp: 2,
|
|
gasUsed: 3,
|
|
success: true,
|
|
logIndex: 0
|
|
});
|
|
bytes memory data = abi.encode(bytes1(0x02), leaves);
|
|
CheckpointStorage.CheckpointHeader memory header = CheckpointStorage.CheckpointHeader({
|
|
batchId: 1,
|
|
previousBatchId: 0,
|
|
chainId: 138,
|
|
checkpointBlock: 1,
|
|
startBlock: 1,
|
|
endBlock: 1,
|
|
blockHash: bytes32(0),
|
|
stateRoot: bytes32(0),
|
|
paymentsRoot: bytes32(0),
|
|
receiptsRoot: bytes32(0),
|
|
txCount: 1,
|
|
flags: 0,
|
|
submittedAt: 0,
|
|
submitter: address(0),
|
|
contentURI: bytes32(0)
|
|
});
|
|
mirror.afterSubmit(header, data);
|
|
(, , , uint256 value, , , , ) = mirror.transactions(leaves[0].txHash);
|
|
assertEq(value, 5_000_000);
|
|
assertEq(mirror.txToken(leaves[0].txHash), address(0xAA));
|
|
}
|
|
}
|