Skip to content

Commit

Permalink
added a mock gateway for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Jul 28, 2023
1 parent 8d91ce2 commit 4d38af4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions core/packages/contracts/test/GatewayUpgradeMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
pragma solidity 0.8.20;

import {Channel, InboundMessage, OperatingMode, ParaID, Config, Command} from "../src/Types.sol";
import {IGateway} from "../src/interfaces/IGateway.sol";
import {Verification} from "../src/Verification.sol";

contract GatewayUpgradeMock is IGateway {
/**
* Getters
*/

function operatingMode() external pure returns (OperatingMode) { return OperatingMode.Normal; }
function channelOperatingModeOf(ParaID) external pure returns (OperatingMode) { return OperatingMode.Normal; }
function channelFeeRewardOf(ParaID) external pure returns (uint256, uint256) { return (0, 0); }
function channelNoncesOf(ParaID) external pure returns (uint64, uint64) { return (0, 0); }
function agentOf(bytes32) external pure returns (address) { return address(0); }
function implementation() external pure returns (address) { return address(0); }

function submitInbound( InboundMessage calldata, bytes32[] calldata, Verification.Proof calldata) external {}

function registerToken(address) external payable {}
function sendToken(address, ParaID, bytes32, uint128) external payable{}
function sendToken(address, ParaID, address, uint128) external payable {}

event Initialized(uint d0, uint d1);
function initialize(bytes memory data) external {
// Just decode and exit
(uint d0, uint d1) = abi.decode(data, (uint, uint));
emit Initialized(d0, d1);
}
}

0 comments on commit 4d38af4

Please sign in to comment.