File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -110,9 +110,14 @@ func (reqctx *requestContext) consumeRequest() {
110
110
111
111
senderBaseTokens := req .Assets ().BaseTokens () + reqctx .GetBaseTokensBalanceDiscardRemainder (sender )
112
112
113
- minReqCost := reqctx .ChainInfo ().GasFeePolicy .MinFee (isc .RequestGasPrice (reqctx .req ), parameters .BaseTokenDecimals )
114
- if senderBaseTokens < minReqCost {
115
- panic (vmexceptions .ErrNotEnoughFundsForMinFee )
113
+ // check if the sender has enough balance to cover the minimum gas fee
114
+ if reqctx .shouldChargeGasFee () {
115
+ minReqCost := reqctx .ChainInfo ().GasFeePolicy .MinFee (isc .RequestGasPrice (reqctx .req ), parameters .BaseTokenDecimals )
116
+ if senderBaseTokens < minReqCost {
117
+ // TODO: this should probably not skip the request, and also the check
118
+ // should be done in L1 so the request is rejected before it reaches the mempool
119
+ panic (vmexceptions .ErrNotEnoughFundsForMinFee )
120
+ }
116
121
}
117
122
118
123
reqctx .creditObjectsToAccount (sender , req .Assets ().Objects .Sorted ())
You can’t perform that action at this time.
0 commit comments