Skip to content

Commit

Permalink
Adding buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Nov 26, 2024
1 parent c3ff616 commit 14ab17b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion deployment/ccip/changeset/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/pkg/errors"
"github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"

"github.com/smartcontractkit/chainlink-ccip/pluginconfig"

commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"
Expand Down Expand Up @@ -400,8 +401,10 @@ func CCIPSendRequest(
if err != nil {
return nil, 0, errors.Wrap(deployment.MaybeDataErr(err), "failed to get fee")
}
bufferedFee := new(big.Int).Mul(fee, big.NewInt(110)) // adding a 10% buffer
bufferedFee.Div(bufferedFee, big.NewInt(100))
if msg.FeeToken == common.HexToAddress("0x0") {
e.Chains[src].DeployerKey.Value = fee
e.Chains[src].DeployerKey.Value = bufferedFee
defer func() { e.Chains[src].DeployerKey.Value = nil }()
}
tx, err := r.CcipSend(
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/ccip/ccip_batching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func genMessages(
Target: sourceRouter.Address(),
AllowFailure: false,
CallData: calldata,
Value: bufferedFee,
Value: bufferedFee,
})
}

Expand Down

0 comments on commit 14ab17b

Please sign in to comment.