Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojtek committed Oct 17, 2023
1 parent 9320e8d commit ca625fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x/asset/ft/keeper/before_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (k Keeper) ApplyRate(ctx sdk.Context, rate sdk.Dec, issuer, sender sdk.AccA
}

// we do not apply burn and commission rate if sender is a smart contract address.
if k.isSmartContract(ctx, sender) {
if k.isSmartContract(sender) {
return sdk.ZeroInt()
}

Expand All @@ -178,7 +178,7 @@ func (k Keeper) ApplyRate(ctx sdk.Context, rate sdk.Dec, issuer, sender sdk.AccA
return rate.MulInt(taxableOutputSum).Ceil().RoundInt()
}

func (k Keeper) isSmartContract(ctx sdk.Context, addr sdk.AccAddress) bool {
func (k Keeper) isSmartContract(addr sdk.AccAddress) bool {
return len(addr) == wasmtypes.ContractAddrLen
}

Expand Down
2 changes: 1 addition & 1 deletion x/asset/ft/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ func (k Keeper) isCoinReceivable(ctx sdk.Context, addr sdk.AccAddress, def types
}

// TODO: To be discussed: Should it be allowed to create such tokens by smart contract?
if def.IsFeatureEnabled(types.Feature_sending_to_smart_contracts_blocked) && !def.IsIssuer(addr) && k.isSmartContract(ctx, addr) {
if def.IsFeatureEnabled(types.Feature_sending_to_smart_contracts_blocked) && !def.IsIssuer(addr) && k.isSmartContract(addr) {
return sdkerrors.Wrapf(cosmoserrors.ErrUnauthorized, "transfers to smart contracts are disabled for %s", def.Denom)
}

Expand Down

0 comments on commit ca625fa

Please sign in to comment.