wip: fix lint errors
This commit is contained in:
parent
ddd01ccd8a
commit
c72302d078
@ -130,7 +130,7 @@ func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins s
|
||||
|
||||
bond := types.Bond{Id: bondID, Owner: ownerAddress.String(), Balance: coins}
|
||||
if bond.Balance.IsAnyGT(maxBondAmount) {
|
||||
return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "Max bond amount exceeded")
|
||||
return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "max bond amount exceeded")
|
||||
}
|
||||
|
||||
// Move funds into the bond account module.
|
||||
@ -331,7 +331,7 @@ func (k Keeper) GetBondModuleBalances(ctx sdk.Context) sdk.Coins {
|
||||
// TransferCoinsToModuleAccount moves funds from the bonds module account to another module account.
|
||||
func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id, moduleAccount string, coins sdk.Coins) error {
|
||||
if !k.HasBond(ctx, id) {
|
||||
return errors.Wrap(sdkerrors.ErrUnauthorized, "Bond not found.")
|
||||
return errors.Wrap(sdkerrors.ErrUnauthorized, "bond not found")
|
||||
}
|
||||
|
||||
bondObj := k.GetBond(ctx, id)
|
||||
|
@ -32,7 +32,7 @@ func (msg MsgCreateBond) ValidateBasic() error {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer)
|
||||
}
|
||||
if len(msg.Coins) == 0 || !msg.Coins.IsValid() {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.")
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -71,7 +71,7 @@ func (msg MsgRefillBond) ValidateBasic() error {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer)
|
||||
}
|
||||
if len(msg.Coins) == 0 || !msg.Coins.IsValid() {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.")
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -110,7 +110,7 @@ func (msg MsgWithdrawBond) ValidateBasic() error {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer)
|
||||
}
|
||||
if len(msg.Coins) == 0 || !msg.Coins.IsValid() {
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.")
|
||||
return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type
|
||||
resourceSignBytes, _ := record.GetSignBytes()
|
||||
cid, err := record.GetCID()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON")
|
||||
return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid record JSON")
|
||||
}
|
||||
|
||||
record.ID = cid
|
||||
@ -256,13 +256,13 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type
|
||||
pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey))
|
||||
if err != nil {
|
||||
fmt.Println("Error decoding pubKey from bytes: ", err)
|
||||
return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.")
|
||||
return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "invalid public key")
|
||||
}
|
||||
|
||||
sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig))
|
||||
if !sigOK {
|
||||
fmt.Println("Signature mismatch: ", sig.PubKey)
|
||||
return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.")
|
||||
return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "invalid signature")
|
||||
}
|
||||
record.Owners = append(record.Owners, pubKey.Address().String())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user