Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Nov 7, 2024
1 parent 1f623a8 commit 929709f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/protocol/contracts/shared/common/DefaultResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract DefaultResolver is EssentialContract, ResolverBase {
uint256 indexed chainId, bytes32 indexed name, address newAddress, address oldAddress
);

error AM_ADDRESS_ALREADY_SET(); // TODO: rename
error AM_ADDRESS_ALREADY_SET(bytes32 name); // TODO: rename
error RESOLVED_ADDRESS_ZERO(); // TODO: rename

/// @notice Initializes the contract.
Expand All @@ -45,7 +45,7 @@ contract DefaultResolver is EssentialContract, ResolverBase {
onlyOwner
{
address oldAddress = __addresses[_chainId][_name];
require(_newAddress != oldAddress, AM_ADDRESS_ALREADY_SET());
require(_newAddress != oldAddress, AM_ADDRESS_ALREADY_SET(_name));
__addresses[_chainId][_name] = _newAddress;
emit AddressSet(_chainId, _name, _newAddress, oldAddress);
}
Expand Down
35 changes: 23 additions & 12 deletions packages/protocol/test/shared/bridge/Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,38 @@ contract BridgeTest is TaikoTest {
vm.startPrank(Alice);
vm.deal(Alice, 100 ether);

uint64 l1ChainId = uint64(block.chainid);

// Deploy on local chain
resolver = deployDefaultResolver();

address bridgeImpl = address(new Bridge());
bridge = deployBridge(resolver, bridgeImpl);
destChainBridge = deployBridge(resolver, bridgeImpl);
bridge = deployBridge(resolver, address(new Bridge()));
signalService = deploySignalService(resolver, address(new SignalService()));
untrustedSenderContract = new UntrustedSendMessageRelayer();
vm.deal(address(untrustedSenderContract), 10 ether);


uint64 l1ChainId = uint64(block.chainid);
// vm.chainId(l1ChainId);

// Deploy on destination chain
vm.chainId(destChainId);
signalServiceNoProofCheck = deploySignalService(resolver, address(new SignalServiceNoProofCheck()));
signalService = deploySignalService(resolver, address(new SignalService()));

destChainBridge = deployBridge(resolver, address(new Bridge()));
vm.deal(address(destChainBridge), 100 ether);
vm.chainId(l1ChainId);

vm.deal(address(destChainBridge), 100 ether);

untrustedSenderContract = new UntrustedSendMessageRelayer();
vm.deal(address(untrustedSenderContract), 10 ether);
resolver.setAddress(destChainId, "signal_service", address(signalServiceNoProofCheck));
resolver.setAddress(destChainId, "bridge", address(destChainBridge));
// Register contracts from destination chain
// resolver.setAddress(destChainId, "signal_service", address(signalServiceNoProofCheck));
// resolver.setAddress(destChainId, "bridge", address(destChainBridge));
resolver.setAddress(destChainId, "taiko", address(uint160(123)));
resolver.setAddress(destChainId, "bridge_watchdog", address(uint160(123)));







vm.stopPrank();
}

Expand Down

0 comments on commit 929709f

Please sign in to comment.