mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-05 13:46:38 +00:00
fixed linter issues
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
0835ab4b46
commit
5adaab3b14
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user