Skip to content

Commit

Permalink
Merge branch 'main' of ssh://github.com/OffchainLabs/arbitrum-sdk int…
Browse files Browse the repository at this point in the history
…o non18-decimal-v4
  • Loading branch information
brtkx committed Oct 15, 2024
2 parents 6f93771 + 9a30062 commit 5ea3124
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
11 changes: 10 additions & 1 deletion tests/integration/eth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ describe('Ether', async () => {
childSigner.provider!
)

const l1ToL2Messages = await rec.getEthDeposits(childSigner.provider!)
expect(l1ToL2Messages.length).to.eq(1, 'failed to find 1 l1 to l2 message')
const l1ToL2Message = l1ToL2Messages[0]

const walletAddress = await parentSigner.getAddress()
expect(l1ToL2Message.to).to.eq(walletAddress, 'message inputs value error')
expect(l1ToL2Message.value.toString(), 'message inputs value error').to.eq(
parseEther(amount).toString()
)

const parentToChildMessages = await rec.getEthDeposits(
childSigner.provider!
)
Expand All @@ -152,7 +162,6 @@ describe('Ether', async () => {
)
const parentToChildMessage = parentToChildMessages[0]

const walletAddress = await parentSigner.getAddress()
expect(parentToChildMessage.to).to.eq(
walletAddress,
'message inputs value error'
Expand Down
27 changes: 22 additions & 5 deletions tests/integration/l1l3Bridger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,16 @@ describe('L1 to L3 Bridging', () => {

itOnlyWhenCustomGasToken(
'should throw getting l1 gas token address when it is unavailable',
async () => {
async function () {
const decimals = await getNativeTokenDecimals({
parentProvider: l1Signer.provider!,
childNetwork: l3Network,
})

if (decimals !== 18) {
this.skip()
}

const networkCopy = JSON.parse(
JSON.stringify(l3Network)
) as ArbitrumNetwork
Expand Down Expand Up @@ -950,11 +959,19 @@ describe('L1 to L3 Bridging', () => {
await testHappyPathNonFeeOrStandard(depositParams)
})

it('happy path weth', async () => {
assertArbitrumNetworkHasTokenBridge(l2Network)
it('happy path weth', async function () {
const decimals = await getNativeTokenDecimals({
parentProvider: l1Signer.provider!,
childNetwork: l3Network,
})

if (decimals !== 18) {
this.skip()
}

const l3Recipient = ethers.utils.hexlify(ethers.utils.randomBytes(20))
const weth = AeWETH__factory.connect(
l2Network.tokenBridge.parentWeth,
l2Network.tokenBridge!.parentWeth,
l1Signer
)

Expand All @@ -971,7 +988,7 @@ describe('L1 to L3 Bridging', () => {
).wait()

const depositParams: Erc20L1L3DepositRequestParams = {
erc20L1Address: l2Network.tokenBridge.parentWeth,
erc20L1Address: l2Network.tokenBridge!.parentWeth,
destinationAddress: l3Recipient,
amount,
l2Provider: l2Signer.provider!,
Expand Down

0 comments on commit 5ea3124

Please sign in to comment.