Skip to content

Commit

Permalink
populate for cl rate limits
Browse files Browse the repository at this point in the history
  • Loading branch information
hashxtree committed Dec 30, 2024
1 parent a818ea0 commit 4110f0e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/setup/chainlink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ task('setup-ccip-apply-updates', 'Apply CCIP token pool updates')
.addOptionalParam('inboundLimitCap')
.addOptionalParam('outboundLimitRate')
.addOptionalParam('outboundLimitCap')
.addFlag('populate')
.setAction(async (taskArgs, hre, network) => {
const { ethers } = hre;

const {
clAdapter,
remoteSelector,
populate,

inboundLimitRate,
inboundLimitCap,
Expand All @@ -135,6 +137,25 @@ task('setup-ccip-apply-updates', 'Apply CCIP token pool updates')
await adapter.tokenPool()
);

if (populate) {
const rawTx =
await tokenPool.setChainRateLimiterConfig.populateTransaction(
remoteSelector,
{
isEnabled: outboundLimitRate && outboundLimitCap,
capacity: outboundLimitCap,
rate: outboundLimitRate,
},
{
isEnabled: inboundLimitRate && inboundLimitCap,
capacity: inboundLimitCap,
rate: inboundLimitRate,
}
);
console.log(`Tx: ${JSON.stringify(rawTx, null, 2)}`);
return;
}

await tokenPool.setChainRateLimiterConfig(
remoteSelector,
{
Expand Down

0 comments on commit 4110f0e

Please sign in to comment.