Skip to content

Commit

Permalink
Fix bench (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 authored May 30, 2024
1 parent e103a35 commit 2665a54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@msgport/ormp",
"version": "2.1.0",
"version": "2.0.0",
"description": "Oracle and Relayer based Message Protocol",
"repository": "https://github.com/msgport/ORMP",
"author": "Msgport dev",
Expand Down
51 changes: 0 additions & 51 deletions test/ORMP.m.sol

This file was deleted.

11 changes: 4 additions & 7 deletions test/bench/ORMP.b.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import "../../src/eco/Relayer.sol";
contract ORMPBenchmarkTest is Test {
using Chains for uint256;

ORMP ormp = ORMP(0x00000000001523057a05d6293C1e5171eE33eE0A);
Oracle oracle = Oracle(payable(0x0000000003ebeF32D8f0ED406a5CA8805c80AFba));
Relayer relayer = Relayer(payable(0x0000000000808fE9bDCc1d180EfbF5C53552a6b1));
ORMP ormp = ORMP(0xA72d283015c01807bc0788Bf22C1A774bDbFC8fA);
Oracle oracle = Oracle(payable(0x3f938756ceFa33665719Eb528E581FF3f460b7C6));
Relayer relayer = Relayer(payable(0xaC2b224c2E1eD2E8663097a361A05a72d6671C7D));

address immutable self = address(this);
uint256 chain1 = Chains.Darwinia;
Expand Down Expand Up @@ -52,14 +52,11 @@ contract ORMPBenchmarkTest is Test {
}

function perform_recv(Message memory message) public {
bytes32 root = bytes32(0);
uint256 blockNumber = block.number;

vm.createSelectFork(message.toChainId.toChainName());
vm.store(address(oracle), bytes32(uint256(0)), bytes32(uint256(uint160(self))));
assertEq(oracle.owner(), self);
vm.prank(address(oracle.owner()));
oracle.importMessageHash(message.fromChainId, self, blockNumber, root);
oracle.importMessageHash(message.fromChainId, address(ormp), message.index, hash(message));

vm.prank(address(relayer));
ormp.recv(message, "");
Expand Down

0 comments on commit 2665a54

Please sign in to comment.