Skip to content

Commit

Permalink
evm: fixes build and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scnale committed Oct 1, 2024
1 parent f93d976 commit 4f9ae53
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
14 changes: 9 additions & 5 deletions evm/src/Tbr.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ contract Tbr is TbrDispatcher {
function _proxyConstructor(bytes calldata args) internal override {
uint offset = 0;

address owner;
address admin;
address feeRecipient;
(owner, offset) = args.asAddressCdUnchecked(offset);
(admin, offset) = args.asAddressCdUnchecked(offset);
address owner;
(feeRecipient, offset) = args.asAddressCdUnchecked(offset);
(owner, offset) = args.asAddressCdUnchecked(offset);
uint8 adminCount;
(adminCount, offset) = args.asUint8CdUnchecked(offset);
address[] memory admins = new address[](adminCount);
for (uint i = 0; i < adminCount; ++i) {
(admins[i], offset) = args.asAddressCdUnchecked(offset);
}

args.checkLengthCd(offset);

_accessControlConstruction(owner, admin);
_accessControlConstruction(owner, admins);
_configConstruction(payable(feeRecipient));
}
}
14 changes: 8 additions & 6 deletions evm/test/utils/TbrTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ contract TbrTestBase is Test {
function setUp() public {
uint fakeChainId = 0;
vm.mockCall(
oracle,
abi.encodeWithSelector(priceOracle.get1959.selector),
oracle,
abi.encodeWithSelector(priceOracle.get1959.selector),
abi.encode(abi.encodePacked(uint16(fakeChainId)))
);

vm.mockCall(
address(wormholeCore),
abi.encodeWithSelector(wormholeCore.chainId.selector),
address(wormholeCore),
abi.encodeWithSelector(wormholeCore.chainId.selector),
abi.encode(fakeChainId)
);

Expand All @@ -91,9 +91,10 @@ contract TbrTestBase is Test {
tbr = Tbr(payable(new Proxy(
tbrImplementation,
abi.encodePacked(
feeRecipient,
owner,
admin,
feeRecipient
uint8(1),
admin
)
)));

Expand Down Expand Up @@ -157,6 +158,7 @@ contract TbrTestBase is Test {
address(new PriceOracle(EVM_CHAIN_ID)),
abi.encodePacked(
owner,
uint8(1),
admin,
assistant,
EVM_CHAIN_ID,
Expand Down
2 changes: 1 addition & 1 deletion lib/relayer-infra-contracts

0 comments on commit 4f9ae53

Please sign in to comment.