Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
fix misprints
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkolegov committed Apr 9, 2022
1 parent c6efc91 commit 063b8ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion chain/consensus/common/cns_validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func BlockSanityChecks(ctype hierarchical.ConsensusType, h *types.BlockHeader) e
}
case hierarchical.Tendermint:
if h.Ticket == nil {
return xerrors.Errorf("Tendermint-backed block must have a ticket: ", h.Ticket)
return xerrors.Errorf("Tendermint-backed block must have a ticket")
}
default:
// FIXME: We currently support PoW and delegated, thus the
Expand Down
25 changes: 1 addition & 24 deletions chain/consensus/tendermint/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
secp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/ipfs/go-cid"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
tmcrypto "github.com/tendermint/tendermint/crypto"
tmsecp "github.com/tendermint/tendermint/crypto/secp256k1"
tmjson "github.com/tendermint/tendermint/libs/json"
Expand Down Expand Up @@ -115,7 +114,7 @@ func GetTendermintID(ctx context.Context) (address.Address, error) {
return addr, nil
}

func findValidatorPubKeyByAddress(validators []*tmtypes.Validator, addr crypto.Address) []byte {
func findValidatorPubKeyByAddress(validators []*tmtypes.Validator, addr tmcrypto.Address) []byte {
for _, v := range validators {
if bytes.Equal(v.Address.Bytes(), addr.Bytes()) {
return v.PubKey.Bytes()
Expand Down Expand Up @@ -184,28 +183,6 @@ func getValidatorsInfo(ctx context.Context, c *tmclient.HTTP) (string, []byte, a
return validatorAddress, validatorPubKey, clientAddress, nil
}

// registerNetworkViaTxCommit registers a new network using the BroadcastTxCommit method that is unrecommended.
func registerNetworkViaTxCommit(
ctx context.Context,
c *tmclient.HTTP,
regReq []byte,
) (*RegistrationMessageResponse, error) {
// TODO: explore whether we need to remove registration functionality or improve it
// https://github.com/tendermint/tendermint/issues/7678
// https://github.com/tendermint/tendermint/issues/3414

regResp, err := c.BroadcastTxCommit(ctx, regReq)
if err != nil {
return nil, xerrors.Errorf("unable to broadcast registration request: %s", err)
}

regSubnetMsg, err := DecodeRegistrationMessageResponse(regResp.DeliverTx.Data)
if err != nil {
return nil, xerrors.Errorf("unable to decode registration response: %w", err)
}
return regSubnetMsg, nil
}

// registerNetworkViaTxSync registers a new network using the BroadcastTxSync method.
func registerNetworkViaTxSync(
ctx context.Context,
Expand Down

0 comments on commit 063b8ae

Please sign in to comment.