*: fix misspellings found in Go Report Card

This commit is contained in:
Roman Khimov 2020-08-14 12:16:24 +03:00
parent f6a308f7f6
commit e7d13e6db2
12 changed files with 27 additions and 27 deletions
cli/wallet
pkg
core
interop
blockchain
util
rpc
client
response/result
smartcontract/manifest

View file

@ -125,7 +125,7 @@ func newNEP5Commands() []cli.Command {
},
{
Name: "multitransfer",
Usage: "transfer NEP5 tokens to multiple recepients",
Usage: "transfer NEP5 tokens to multiple recipients",
UsageText: `multitransfer --wallet <path> --rpc-endpoint <node> --timeout <time> --from <addr>` +
` <token1>:<addr1>:<amount1> [<token2>:<addr2>:<amount2> [...]]`,
Action: multiTransferNEP5,
@ -357,9 +357,9 @@ func multiTransferNEP5(ctx *cli.Context) error {
}
if ctx.NArg() == 0 {
return cli.NewExitError("empty recepients list", 1)
return cli.NewExitError("empty recipients list", 1)
}
var recepients []client.TransferTarget
var recipients []client.TransferTarget
cache := make(map[string]*wallet.Token)
for i := 0; i < ctx.NArg(); i++ {
arg := ctx.Args().Get(i)
@ -387,14 +387,14 @@ func multiTransferNEP5(ctx *cli.Context) error {
if err != nil {
return cli.NewExitError(fmt.Errorf("invalid amount: %w", err), 1)
}
recepients = append(recepients, client.TransferTarget{
recipients = append(recipients, client.TransferTarget{
Token: token.Hash,
Address: addr,
Amount: amount,
})
}
return signAndSendTransfer(ctx, c, acc, recepients)
return signAndSendTransfer(ctx, c, acc, recipients)
}
func transferNEP5(ctx *cli.Context) error {
@ -442,10 +442,10 @@ func transferNEP5(ctx *cli.Context) error {
}})
}
func signAndSendTransfer(ctx *cli.Context, c *client.Client, acc *wallet.Account, recepients []client.TransferTarget) error {
func signAndSendTransfer(ctx *cli.Context, c *client.Client, acc *wallet.Account, recipients []client.TransferTarget) error {
gas := flags.Fixed8FromContext(ctx, "gas")
tx, err := c.CreateNEP5MultiTransferTx(acc, int64(gas), recepients...)
tx, err := c.CreateNEP5MultiTransferTx(acc, int64(gas), recipients...)
if err != nil {
return cli.NewExitError(err, 1)
}

View file

@ -1367,7 +1367,7 @@ func (bc *Blockchain) GetStandByValidators() keys.PublicKeys {
return bc.sbCommittee[:bc.config.ValidatorsCount].Copy()
}
// GetStandByCommittee returns standby commitee from the configuration.
// GetStandByCommittee returns standby committee from the configuration.
func (bc *Blockchain) GetStandByCommittee() keys.PublicKeys {
return bc.sbCommittee.Copy()
}

View file

@ -458,7 +458,7 @@ func TestContractCall(t *testing.T) {
ic.VM.Estack().PushVal(args[i])
}
// interops can both return error and panic,
// we don't care which kind of error has occured
// we don't care which kind of error has occurred
require.Panics(t, func() {
err := contractCall(ic)
if err != nil {

View file

@ -9,7 +9,7 @@ import (
)
// GetProof returns a proof that key belongs to t.
// Proof consist of serialized nodes occuring on path from the root to the leaf of key.
// Proof consist of serialized nodes occurring on path from the root to the leaf of key.
func (t *Trie) GetProof(key []byte) ([][]byte, error) {
var proof [][]byte
path := toNibbles(key)

View file

@ -326,7 +326,7 @@ const (
)
// ModifyAccountVotes modifies votes of the specified account by value (can be negative).
// typ specifies if this modify is occuring during transfer or vote (with old or new validator).
// typ specifies if this modify is occurring during transfer or vote (with old or new validator).
func (n *NEO) ModifyAccountVotes(acc *state.NEOBalanceState, d dao.DAO, value *big.Int, typ int) error {
if acc.VoteTo != nil {
key := makeValidatorKey(acc.VoteTo)

View file

@ -13,7 +13,7 @@ type NEP5Tracker struct {
// Balance is the current balance of the account.
Balance big.Int
// LastUpdatedBlock is a number of block when last `transfer` to or from the
// account occured.
// account occurred.
LastUpdatedBlock uint32
}
@ -35,9 +35,9 @@ type NEP5Transfer struct {
// Amount is the amount of tokens transferred.
// It is negative when tokens are sent and positive if they are received.
Amount big.Int
// Block is a number of block when the event occured.
// Block is a number of block when the event occurred.
Block uint32
// Timestamp is the timestamp of the block where transfer occured.
// Timestamp is the timestamp of the block where transfer occurred.
Timestamp uint64
// Tx is a hash the transaction.
Tx util.Uint256

View file

@ -48,7 +48,7 @@ type Block struct {
Timestamp int
// Index represents the height of the block.
Index int
// NextConsensus representes contract address of the next miner (160 bit BE
// NextConsensus represents contract address of the next miner (160 bit BE
// value in a 20 byte slice).
NextConsensus []byte
// TransactionsLength represents the length of block's transactions array.

View file

@ -5,7 +5,7 @@ package util
// FromAddress is an utility function that converts a Neo address to its hash
// (160 bit BE value in a 20 byte slice). It can only be used for strings known
// at compilation time, because the convertion is actually being done by the
// at compilation time, because the conversion is actually being done by the
// compiler.
func FromAddress(address string) []byte {
return nil

View file

@ -122,16 +122,16 @@ func (c *Client) CreateNEP5TransferTx(acc *wallet.Account, to util.Uint160, toke
}
// CreateNEP5MultiTransferTx creates an invocation transaction for performing NEP5 transfers
// from a single sender to multiple recepients.
func (c *Client) CreateNEP5MultiTransferTx(acc *wallet.Account, gas int64, recepients ...TransferTarget) (*transaction.Transaction, error) {
// from a single sender to multiple recipients.
func (c *Client) CreateNEP5MultiTransferTx(acc *wallet.Account, gas int64, recipients ...TransferTarget) (*transaction.Transaction, error) {
from, err := address.StringToUint160(acc.Address)
if err != nil {
return nil, fmt.Errorf("bad account address: %w", err)
}
w := io.NewBufBinWriter()
for i := range recepients {
emit.AppCallWithOperationAndArgs(w.BinWriter, recepients[i].Token, "transfer", from,
recepients[i].Address, recepients[i].Amount)
for i := range recipients {
emit.AppCallWithOperationAndArgs(w.BinWriter, recipients[i].Token, "transfer", from,
recipients[i].Address, recipients[i].Amount)
emit.Opcode(w.BinWriter, opcode.ASSERT)
}
return c.CreateTxFromScript(w.Bytes(), acc, gas)
@ -189,9 +189,9 @@ func (c *Client) TransferNEP5(acc *wallet.Account, to util.Uint160, token util.U
return c.SendRawTransaction(tx)
}
// MultiTransferNEP5 is similar to TransferNEP5, buf allows to have multiple recepients.
func (c *Client) MultiTransferNEP5(acc *wallet.Account, gas int64, recepients ...TransferTarget) (util.Uint256, error) {
tx, err := c.CreateNEP5MultiTransferTx(acc, gas, recepients...)
// MultiTransferNEP5 is similar to TransferNEP5, buf allows to have multiple recipients.
func (c *Client) MultiTransferNEP5(acc *wallet.Account, gas int64, recipients ...TransferTarget) (util.Uint256, error) {
tx, err := c.CreateNEP5MultiTransferTx(acc, gas, recipients...)
if err != nil {
return util.Uint256{}, err
}

View file

@ -19,7 +19,7 @@ type NEP5Balance struct {
LastUpdated uint32 `json:"lastupdatedblock"`
}
// nep5Balance is an auxilliary struct for proper Asset marshaling.
// nep5Balance is an auxiliary struct for proper Asset marshaling.
type nep5Balance struct {
Asset string `json:"assethash"`
Amount string `json:"amount"`

View file

@ -18,7 +18,7 @@ type TransactionOutputRaw struct {
TransactionMetadata
}
// TransactionMetadata is an auxilliary struct for proper TransactionOutputRaw marshaling.
// TransactionMetadata is an auxiliary struct for proper TransactionOutputRaw marshaling.
type TransactionMetadata struct {
Blockhash util.Uint256 `json:"blockhash,omitempty"`
Confirmations int `json:"confirmations,omitempty"`

View file

@ -43,7 +43,7 @@ type Method struct {
ReturnType smartcontract.ParamType `json:"returntype"`
}
// NewParameter returns new paramter with the specified name and type.
// NewParameter returns new parameter of specified name and type.
func NewParameter(name string, typ smartcontract.ParamType) Parameter {
return Parameter{
Name: name,