-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: no register support for payee and counterpartyPayee
- Loading branch information
Showing
8 changed files
with
133 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import {IRelayerFunctions} from "./src/RelayerFunctions.sol"; | ||
|
||
contract TestRelayer { | ||
address constant relayer = 0x0000000000000000000000000000000000000065; | ||
address constant relayerContract = 0x0000000000000000000000000000000000000065; | ||
IRelayerFunctions relayer = IRelayerFunctions(relayerContract); | ||
address payee; | ||
address counterpartyPayee; | ||
|
||
function batchCall(bytes[] memory payloads) public { | ||
for (uint256 i = 0; i < payloads.length; i++) { | ||
(bool success,) = relayer.call(payloads[i]); | ||
(bool success,) = relayerContract.call(payloads[i]); | ||
require(success); | ||
} | ||
} | ||
|
||
function callRegisterPayee(string calldata portID, string calldata channelID, address relayerAddr) public returns (bool) { | ||
require(payee == address(0) || payee == msg.sender, "register fail"); | ||
bool result = relayer.registerPayee(portID, channelID, relayerAddr); | ||
require(result, "call failed"); | ||
payee = msg.sender; | ||
} | ||
|
||
function callRegisterCounterpartyPayee(string calldata portID, string calldata channelID, address relayerAddr) public returns (bool) { | ||
require(counterpartyPayee == address(0) || counterpartyPayee == msg.sender, "register fail"); | ||
bool result = relayer.registerCounterpartyPayee(portID, channelID, relayerAddr); | ||
require(result, "call failed"); | ||
counterpartyPayee = msg.sender; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.