Skip to content

Commit

Permalink
feat: fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Maldonado <[email protected]>
  • Loading branch information
md0x committed Nov 8, 2024
1 parent d973250 commit a34ec72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contracts/chain-adapters/Solana_Adapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ contract Solana_Adapter is AdapterInterface, CircleCCTPAdapter {
cctpMessageTransmitter = _cctpMessageTransmitter;

SOLANA_SPOKE_POOL_BYTES32 = solanaSpokePool;
SOLANA_SPOKE_POOL_ADDRESS = solanaSpokePool.toAddress();
SOLANA_SPOKE_POOL_ADDRESS = solanaSpokePool.toAddressUnchecked();

SOLANA_USDC_BYTES32 = solanaUsdc;
SOLANA_USDC_ADDRESS = solanaUsdc.toAddress();
SOLANA_USDC_ADDRESS = solanaUsdc.toAddressUnchecked();

SOLANA_SPOKE_POOL_USDC_VAULT = solanaSpokePoolUsdcVault;
}
Expand Down
4 changes: 4 additions & 0 deletions contracts/libraries/AddressConverters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ library Bytes32ToAddress {
}
return address(uint160(uint256(_bytes32)));
}

function toAddressUnchecked(bytes32 _bytes32) internal pure returns (address) {
return address(uint160(uint256(_bytes32)));
}
}

library AddressToBytes32 {
Expand Down
2 changes: 1 addition & 1 deletion test/evm/hardhat/chain-adapters/Solana_Adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("Solana Chain Adapter", function () {
const functionCallData = mockSpoke.interface.encodeFunctionData("setCrossDomainAdmin", [newAdmin]);
expect(await hubPool.relaySpokePoolAdminFunction(solanaChainId, functionCallData))
.to.emit(solanaAdapter.attach(hubPool.address), "MessageRelayed")
.withArgs(solanaSpokePoolAddress, functionCallData);
.withArgs(solanaSpokePoolAddress.toLowerCase(), functionCallData);
expect(cctpMessageTransmitter.sendMessage).to.have.been.calledWith(
solanaDomainId,
solanaSpokePoolBytes32,
Expand Down

0 comments on commit a34ec72

Please sign in to comment.