Skip to content

Commit

Permalink
add auth to ormp mock
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Nov 13, 2023
1 parent 3a97d95 commit fb10111
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/ORMP.m.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ import "../src/Verifier.sol";

contract ORMPMock is Verifier {
ORMP ormp;
address oracle = 0x0000000000ba03146Cc235509E802873D418a6bc;
address immutable caller;
address immutable self = address(this);
address constant oracle = 0x0000000000ba03146Cc235509E802873D418a6bc;

struct P {
Message message;
bytes proof;
}

constructor() {
caller = msg.sender;
ormp = new ORMP(self);
ormp.setDefaultConfig(self, self);
}
Expand All @@ -53,6 +55,7 @@ contract ORMPMock is Verifier {
}

function dryrun_recv(bytes memory input) public {
require(caller == msg.sender, "!auth");
IVerifier(oracle).merkleRoot(46, 0);
P memory p = abi.decode(input, (P));
ormp.recv(p.message, p.proof);
Expand Down

0 comments on commit fb10111

Please sign in to comment.