TestCustomConsistencyLevel.t.sol 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: Apache-2.0
  2. pragma solidity ^0.8.0;
  3. import {Test, console} from "forge-std/Test.sol";
  4. import {TestCustomConsistencyLevel} from
  5. "../contracts/custom_consistency_level/TestCustomConsistencyLevel.sol";
  6. import {CustomConsistencyLevel} from
  7. "../contracts/custom_consistency_level/CustomConsistencyLevel.sol";
  8. import {ConfigMakers} from "../contracts/custom_consistency_level/libraries/ConfigMakers.sol";
  9. contract TestCustomConsistencyLevelTest is Test {
  10. CustomConsistencyLevel public customConsistencyLevel;
  11. TestCustomConsistencyLevel public testCustomConsistencyLevel;
  12. address public userA = address(0x123);
  13. address public userB = address(0x456);
  14. address public guardian = address(0x789);
  15. address public wormhole = address(0x123456);
  16. function setUp() public {
  17. customConsistencyLevel = new CustomConsistencyLevel();
  18. testCustomConsistencyLevel =
  19. new TestCustomConsistencyLevel(wormhole, address(customConsistencyLevel), 201, 5);
  20. }
  21. function test_configure() public {
  22. vm.startPrank(guardian);
  23. assertEq(
  24. 0x01c9000500000000000000000000000000000000000000000000000000000000,
  25. customConsistencyLevel.getConfiguration(address(testCustomConsistencyLevel))
  26. );
  27. assertEq(bytes32(0), customConsistencyLevel.getConfiguration(userB));
  28. }
  29. }