Skip to content

Commit

Permalink
fix: fix relayArbitrumMessage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-woof-software committed Jun 13, 2024
1 parent 6314494 commit 9f20622
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 0 additions & 6 deletions scenario/CrossChainGovernanceScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,18 @@ scenario.only(
filter: async ctx => matchesDeployment(ctx, [{network: 'arbitrum'}, {network: 'arbitrum-goerli'}])
},
async ({ comet, configurator, proxyAdmin, timelock: oldLocalTimelock, bridgeReceiver: oldBridgeReceiver }, context, world) => {
console.log('debug')
const dm = world.deploymentManager;
const governanceDeploymentManager = world.auxiliaryDeploymentManager;
console.log('governanceDeploymentManager', !!governanceDeploymentManager)
if (!governanceDeploymentManager) {
throw new Error('cannot execute governance without governance deployment manager');
}

console.log('before new bridge receiver')
// Deploy new ArbitrumBridgeReceiver
const newBridgeReceiver = await dm.deploy<ArbitrumBridgeReceiver, []>(
'newBridgeReceiver',
'bridges/arbitrum/ArbitrumBridgeReceiver.sol',
[]
);
console.log('after new bridge receiver')
console.log({address: newBridgeReceiver.address})
console.log({newBridgeReceiver})

// Deploy new local Timelock
const secondsPerDay = 24 * 60 * 60;
Expand Down
8 changes: 7 additions & 1 deletion scenario/utils/relayArbitrumMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ export async function relayArbitrumMessage(
const wordLength = 2 * 32;
const innnerData = header + data.slice(headerLength + (11 * wordLength));
const toValue = data.slice(headerLength + (2 * wordLength), headerLength + (3 * wordLength));
const toAddress = BigNumber.from(`0x${toValue}`).toHexString();
let toAddress = BigNumber.from(`0x${toValue}`).toHexString();

// if lenght of toAddress is less than 42, then it is padded with 0s and we need to add them after 0x
if(toAddress.length < 42) {
toAddress = `0x${toAddress.slice(2).padStart(40, '0')}`;
}

const messageNum = topics[1];
return {
data: innnerData,
Expand Down

0 comments on commit 9f20622

Please sign in to comment.