fixed linter issues

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-10-10 01:54:09 +02:00
parent 0835ab4b46
commit 5adaab3b14
No known key found for this signature in database
6 changed files with 8 additions and 10 deletions

View File

@ -53,7 +53,7 @@ func GetValidatorCometBFTIdentity(ctx sdk.Context) (string, bool) {
func IsValidatorBlockProposer(ctx sdk.Context, proposerAddress []byte) bool {
validator_identity, valid_result := GetValidatorCometBFTIdentity(ctx)
if valid_result == false {
if !valid_result {
return false
}
hexProposerAddress := hex.EncodeToString(proposerAddress)

View File

@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"errors"
"fmt"
"os/exec"
"strconv"
"strings"
@ -32,8 +31,7 @@ func ReissueAsset(reissue_tx string) (txid string, err error) {
errstr := stderr.String()
if err != nil || len(errstr) > 0 {
fmt.Printf("Error starting command: %s\n", errstr)
err = errors.New("Reissuance of RDDL failed.")
err = errors.New("reissuance of RDDL failed")
} else {
var txobj ReissueResult
json.Unmarshal(stdout.Bytes(), &txobj)

View File

@ -19,10 +19,8 @@ func (k msgServer) ReissueRDDLProposal(goCtx context.Context, msg *types.MsgReis
if err == nil {
// 3. notarize result by notarizing the liquid tx-id
util.SendRDDLReissuanceResult(ctx, msg.GetProposer(), txID, msg.GetBlockheight())
} else {
//reissuance need to be initiated otherwise
}
//TODO: reissuance need to be initiated otherwise
}
var reissuance types.Reissuance

View File

@ -13,7 +13,7 @@ func (k msgServer) ReissueRDDLResult(goCtx context.Context, msg *types.MsgReissu
ctx := sdk.UnwrapSDKContext(goCtx)
reissuance, found := k.LookupReissuance(ctx, msg.GetBlockHeight())
if found != true {
if !found {
return nil, errorsmod.Wrapf(types.ErrReissuanceNotFound, " for provided block height %s", strconv.FormatUint(msg.GetBlockHeight(), 10))
}
if reissuance.GetBlockHeight() != msg.GetBlockHeight() {

View File

@ -1,6 +1,7 @@
package types
import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
@ -42,7 +43,7 @@ func (msg *MsgReissueRDDLProposal) GetSignBytes() []byte {
func (msg *MsgReissueRDDLProposal) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(msg.Creator)
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}
return nil
}

View File

@ -1,6 +1,7 @@
package types
import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
@ -42,7 +43,7 @@ func (msg *MsgReissueRDDLResult) GetSignBytes() []byte {
func (msg *MsgReissueRDDLResult) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(msg.Creator)
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}
return nil
}