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>
81 lines
2.6 KiB
Solidity
81 lines
2.6 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {Test} from "forge-std/Test.sol";
|
|
import {AddressActivityRegistryV2} from "../../contracts/mainnet-checkpoint/AddressActivityRegistryV2.sol";
|
|
|
|
contract AddressActivityRegistryV2Test is Test {
|
|
AddressActivityRegistryV2 registry;
|
|
address admin = address(0xA11CE);
|
|
|
|
event PaymentAttested(
|
|
bytes32 indexed chain138TxHash,
|
|
bytes32 indexed instructionId,
|
|
address indexed creditor,
|
|
address debtor,
|
|
bytes32 uetr,
|
|
uint64 batchId,
|
|
uint8 msgTypeCode,
|
|
uint256 valueWei,
|
|
uint64 valueUsdE8,
|
|
bytes32 payloadHash,
|
|
bytes32 endToEndIdHash,
|
|
bytes32 debtorRefHash,
|
|
bytes32 creditorRefHash,
|
|
bytes32 purposeHash,
|
|
bytes32 receiptHash,
|
|
uint256 blockNumber138
|
|
);
|
|
|
|
function setUp() public {
|
|
registry = new AddressActivityRegistryV2(admin);
|
|
}
|
|
|
|
function testRecordBatchEmitsPaymentAttested() public {
|
|
AddressActivityRegistryV2.IsoAttestationRecord[] memory rows =
|
|
new AddressActivityRegistryV2.IsoAttestationRecord[](1);
|
|
rows[0] = AddressActivityRegistryV2.IsoAttestationRecord({
|
|
txHash: keccak256("tx1"),
|
|
from: address(0x1),
|
|
to: address(0x2),
|
|
valueWei: 1 ether,
|
|
blockNumber138: 1943065,
|
|
blockTimestamp138: uint64(block.timestamp),
|
|
valueUsdE8: 1_500_000_000_000_000,
|
|
logCount: 1,
|
|
receiptHash: keccak256("rcpt"),
|
|
instructionId: keccak256("instr1"),
|
|
endToEndIdHash: keccak256("e2e"),
|
|
uetr: keccak256("uetr"),
|
|
payloadHash: keccak256("payload"),
|
|
msgTypeCode: registry.MSG_CHAIN138_SYNTH(),
|
|
debtorRefHash: keccak256("d"),
|
|
creditorRefHash: keccak256("c"),
|
|
purposeHash: keccak256("p")
|
|
});
|
|
|
|
vm.prank(admin);
|
|
vm.expectEmit(true, true, true, false);
|
|
emit PaymentAttested(
|
|
rows[0].txHash,
|
|
rows[0].instructionId,
|
|
rows[0].to,
|
|
rows[0].from,
|
|
rows[0].uetr,
|
|
1,
|
|
rows[0].msgTypeCode,
|
|
rows[0].valueWei,
|
|
rows[0].valueUsdE8,
|
|
rows[0].payloadHash,
|
|
rows[0].endToEndIdHash,
|
|
rows[0].debtorRefHash,
|
|
rows[0].creditorRefHash,
|
|
rows[0].purposeHash,
|
|
rows[0].receiptHash,
|
|
rows[0].blockNumber138
|
|
);
|
|
registry.recordBatch(1, rows);
|
|
assertTrue(registry.recorded(rows[0].txHash));
|
|
}
|
|
}
|