Skip to content

Commit

Permalink
More test
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Apr 9, 2024
1 parent ec33548 commit 32f8d86
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion contracts/test/Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
import {WETH9} from "canonical-weth/WETH9.sol";
import "./mocks/GatewayUpgradeMock.sol";
import {UD60x18, ud60x18, convert} from "prb/math/src/UD60x18.sol";
import {ERC20} from "../src/ERC20.sol";

contract GatewayTest is Test {
// Emitted when token minted/burnt/transfered
Expand Down Expand Up @@ -938,15 +939,23 @@ contract GatewayTest is Test {
function testAgentMintDot() public {
testAgentRegisterDot();

uint256 amount = 1000;

AgentExecuteParams memory params = AgentExecuteParams({
agentID: assetHubAgentID,
payload: abi.encode(AgentExecuteCommand.MintToken, abi.encode(bytes32(uint256(1)), account1, 1000))
payload: abi.encode(AgentExecuteCommand.MintToken, abi.encode(bytes32(uint256(1)), account1, amount))
});

vm.expectEmit(true, true, false, false);
emit Transfer(address(0), account1, 1000);

GatewayMock(address(gateway)).agentExecutePublic(abi.encode(params));

address dotToken = GatewayMock(address(gateway)).tokenAddressOf(dotTokenID);

uint256 balance = ERC20(dotToken).balanceOf(account1);

assertEq(balance, amount);
}

function testSendRelayTokenToAssetHub() public {
Expand Down

0 comments on commit 32f8d86

Please sign in to comment.