github.com/Finschia/finschia-sdk@v0.49.1/x/feegrant/fees.go (about) 1 package feegrant 2 3 import ( 4 sdk "github.com/Finschia/finschia-sdk/types" 5 ) 6 7 // FeeAllowance implementations are tied to a given fee delegator and delegatee, 8 // and are used to enforce fee grant limits. 9 type FeeAllowanceI interface { 10 // Accept can use fee payment requested as well as timestamp of the current block 11 // to determine whether or not to process this. This is checked in 12 // Keeper.UseGrantedFees and the return values should match how it is handled there. 13 // 14 // If it returns an error, the fee payment is rejected, otherwise it is accepted. 15 // The FeeAllowance implementation is expected to update it's internal state 16 // and will be saved again after an acceptance. 17 // 18 // If remove is true (regardless of the error), the FeeAllowance will be deleted from storage 19 // (eg. when it is used up). (See call to RevokeAllowance in Keeper.UseGrantedFees) 20 Accept(ctx sdk.Context, fee sdk.Coins, msgs []sdk.Msg) (remove bool, err error) 21 22 // ValidateBasic should evaluate this FeeAllowance for internal consistency. 23 // Don't allow negative amounts, or negative periods for example. 24 ValidateBasic() error 25 }