From 67cbcac64314f13f7fd78c82f5df9ab456191539 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 13 Feb 2019 21:01:10 +0300 Subject: [PATCH] Fix typos (#133) * Fix typos * revert chains/unit_testnet * revert chains * fix review comments (thx @AlexVanin) --- README.md | 4 ++-- cli/wallet/wallet.go | 2 +- config/config.go | 2 +- examples/token-sale/token_sale.go | 2 +- pkg/core/block_base.go | 2 +- pkg/core/cache.go | 2 +- pkg/core/header.go | 4 ++-- pkg/core/storage/leveldb_store.go | 2 +- pkg/core/transaction/output.go | 2 +- pkg/core/transaction/type.go | 2 +- pkg/network/discovery.go | 2 +- pkg/network/payload/inventory.go | 2 +- pkg/rpc/rpc.go | 4 ++-- pkg/rpc/server.go | 2 +- pkg/rpc/types.go | 4 ++-- pkg/util/test_util.go | 2 +- pkg/vm/api/runtime/runtime.go | 4 ++-- pkg/vm/api/storage/storage.go | 2 +- pkg/vm/cli/cli.go | 2 +- pkg/vm/compiler/analysis.go | 4 ++-- pkg/vm/compiler/codegen.go | 10 +++++----- pkg/vm/stack.go | 6 +++--- pkg/vm/vm.go | 4 ++-- pkg/wallet/account.go | 4 ++-- pkg/wallet/wallet.go | 4 ++-- 25 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 88962db43..d6b06371d 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Available network flags: - `--privnet, -p` - `--testnet, -t` -If you want in-depth customization for your node, there are `yaml` config files for each `network` available in the `config` directory. Those files are automaticly loaded, corresponding the provided `netmode` flag. +If you want in-depth customization for your node, there are `yaml` config files for each `network` available in the `config` directory. Those files are automatically loaded, corresponding the provided `netmode` flag. ```yaml ProtocolConfiguration: @@ -134,7 +134,7 @@ Feel free to contribute to this project after reading the [contributing guidelines](https://github.com/CityOfZion/neo-go/blob/master/CONTRIBUTING.md). Before starting to work on a certain topic, create an new issue first, -describing the feauture/topic you are going to implement. +describing the feature/topic you are going to implement. # Contact diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 9f780c3ef..ce500e727 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -76,7 +76,7 @@ func createWallet(ctx *cli.Context) error { } dumpWallet(wall) - fmt.Printf("wallet succesfully created, file location is %s\n", wall.Path()) + fmt.Printf("wallet successfully created, file location is %s\n", wall.Path()) return nil } diff --git a/config/config.go b/config/config.go index b5738584c..72d2061e2 100644 --- a/config/config.go +++ b/config/config.go @@ -37,7 +37,7 @@ type ( ApplicationConfiguration ApplicationConfiguration `yaml:"ApplicationConfiguration"` } - // ProtocolConfiguration represents the protolcol config. + // ProtocolConfiguration represents the protocol config. ProtocolConfiguration struct { Magic NetMode `yaml:"Magic"` AddressVersion int64 `yaml:"AddressVersion"` diff --git a/examples/token-sale/token_sale.go b/examples/token-sale/token_sale.go index 9455cb2b6..4402d8ccc 100644 --- a/examples/token-sale/token_sale.go +++ b/examples/token-sale/token_sale.go @@ -17,7 +17,7 @@ var owner = util.FromAddress("AJX1jGfj3qPBbpAKjY527nPbnrnvSx9nCg") type TokenConfig struct { // Name of the token. Name string - // 3 letter abreviation of the token. + // 3 letter abbreviation of the token. Symbol string // How decimals this token will have. Decimals int diff --git a/pkg/core/block_base.go b/pkg/core/block_base.go index 1823e70b1..0fbc0c0c9 100644 --- a/pkg/core/block_base.go +++ b/pkg/core/block_base.go @@ -33,7 +33,7 @@ type BlockBase struct { // Random number also called nonce ConsensusData uint64 `json:"nonce"` - // Contract addresss of the next miner + // Contract address of the next miner NextConsensus util.Uint160 `json:"next_consensus"` // Padding that is fixed to 1 diff --git a/pkg/core/cache.go b/pkg/core/cache.go index ce0f4a3d7..b2bdec704 100644 --- a/pkg/core/cache.go +++ b/pkg/core/cache.go @@ -51,7 +51,7 @@ func (c *Cache) has(h util.Uint256) bool { return ok } -// Has returns whether the cach contains the given hash. +// Has returns whether the cache contains the given hash. func (c *Cache) Has(h util.Uint256) bool { c.lock.Lock() defer c.lock.Unlock() diff --git a/pkg/core/header.go b/pkg/core/header.go index 92ba72654..79b0e56ed 100644 --- a/pkg/core/header.go +++ b/pkg/core/header.go @@ -14,7 +14,7 @@ type Header struct { _ uint8 } -// DecodeBinary impelements the Payload interface. +// DecodeBinary implements the Payload interface. func (h *Header) DecodeBinary(r io.Reader) error { if err := h.BlockBase.DecodeBinary(r); err != nil { return err @@ -32,7 +32,7 @@ func (h *Header) DecodeBinary(r io.Reader) error { return nil } -// EncodeBinary impelements the Payload interface. +// EncodeBinary implements the Payload interface. func (h *Header) EncodeBinary(w io.Writer) error { if err := h.BlockBase.EncodeBinary(w); err != nil { return err diff --git a/pkg/core/storage/leveldb_store.go b/pkg/core/storage/leveldb_store.go index a847a3db3..e05ea9881 100644 --- a/pkg/core/storage/leveldb_store.go +++ b/pkg/core/storage/leveldb_store.go @@ -6,7 +6,7 @@ import ( "github.com/syndtr/goleveldb/leveldb/util" ) -// LevelDBStore is the official storage implementation for storing and retreiving +// LevelDBStore is the official storage implementation for storing and retrieving // blockchain data. type LevelDBStore struct { db *leveldb.DB diff --git a/pkg/core/transaction/output.go b/pkg/core/transaction/output.go index 05716b9d2..f061f3d4f 100644 --- a/pkg/core/transaction/output.go +++ b/pkg/core/transaction/output.go @@ -15,7 +15,7 @@ type Output struct { // Amount of AssetType send or received. Amount util.Fixed8 - // The address of the remittee. + // The address of the recipient. ScriptHash util.Uint160 } diff --git a/pkg/core/transaction/type.go b/pkg/core/transaction/type.go index e0008115e..e049b3720 100644 --- a/pkg/core/transaction/type.go +++ b/pkg/core/transaction/type.go @@ -43,6 +43,6 @@ func (t TXType) String() string { case InvocationType: return "InvocationTransaction" default: - return "UnkownTransaction" + return "UnknownTransaction" } } diff --git a/pkg/network/discovery.go b/pkg/network/discovery.go index 0257877a3..f8edc7dd8 100644 --- a/pkg/network/discovery.go +++ b/pkg/network/discovery.go @@ -9,7 +9,7 @@ const ( ) // Discoverer is an interface that is responsible for maintaining -// a healty connection pool. +// a healthy connection pool. type Discoverer interface { BackFill(...string) PoolCount() int diff --git a/pkg/network/payload/inventory.go b/pkg/network/payload/inventory.go index 2d161c43e..9a9da7efd 100644 --- a/pkg/network/payload/inventory.go +++ b/pkg/network/payload/inventory.go @@ -8,7 +8,7 @@ import ( ) // The node can broadcast the object information it owns by this message. -// The message can be sent automatically or can be used to answer getbloks messages. +// The message can be sent automatically or can be used to answer getblock messages. // InventoryType is the type of an object in the Inventory message. type InventoryType uint8 diff --git a/pkg/rpc/rpc.go b/pkg/rpc/rpc.go index a90f8be54..a4c09aa49 100644 --- a/pkg/rpc/rpc.go +++ b/pkg/rpc/rpc.go @@ -38,8 +38,8 @@ func (c *Client) GetAccountState(address string) (*AccountStateResponse, error) return resp, nil } -// InvokeScipt returns the result of the given script after running it true the VM. -// NOTE: This is a test invoke and will not affect the blokchain. +// InvokeScript returns the result of the given script after running it true the VM. +// NOTE: This is a test invoke and will not affect the blockchain. func (c *Client) InvokeScript(script string) (*InvokeScriptResponse, error) { var ( params = newParams(script) diff --git a/pkg/rpc/server.go b/pkg/rpc/server.go index 677993be8..7bcdb548c 100644 --- a/pkg/rpc/server.go +++ b/pkg/rpc/server.go @@ -53,7 +53,7 @@ func (s *Server) Start(errChan chan error) { errChan <- s.ListenAndServe() } -// Shutdown overrride the http.Server Shutdown +// Shutdown override the http.Server Shutdown // method. func (s *Server) Shutdown() error { log.WithFields(log.Fields{ diff --git a/pkg/rpc/types.go b/pkg/rpc/types.go index 073123f7f..25b0e50af 100644 --- a/pkg/rpc/types.go +++ b/pkg/rpc/types.go @@ -23,7 +23,7 @@ type AccountStateResponse struct { Result *Account `json:"result"` } -// Account respresents details about a NEO account. +// Account represents details about a NEO account. type Account struct { Version int `json:"version"` ScriptHash string `json:"script_hash"` @@ -33,7 +33,7 @@ type Account struct { Balances []*Balance } -// Balance respresents details about a NEO account balance. +// Balance represents details about a NEO account balance. type Balance struct { Asset string `json:"asset"` Value string `json:"value"` diff --git a/pkg/util/test_util.go b/pkg/util/test_util.go index 76c56a943..d4f69992f 100644 --- a/pkg/util/test_util.go +++ b/pkg/util/test_util.go @@ -18,7 +18,7 @@ func RandomString(n int) string { return string(b) } -// RandomInt returns a ramdom integer betweeen min and max. +// RandomInt returns a random integer between min and max. func RandomInt(min, max int) int { return min + rand.Intn(max-min) } diff --git a/pkg/vm/api/runtime/runtime.go b/pkg/vm/api/runtime/runtime.go index 3d8c50a16..685db4937 100644 --- a/pkg/vm/api/runtime/runtime.go +++ b/pkg/vm/api/runtime/runtime.go @@ -15,7 +15,7 @@ func Notify(arg interface{}) int { return 0 } -// Log intructs the VM to log the given message. +// Log instructs the VM to log the given message. func Log(message string) {} // Application returns the application trigger type. @@ -39,7 +39,7 @@ func Serialize(item interface{}) []byte { return nil } -// Deserializes an item from a bytearray. +// Deserialize an item from a bytearray. func Deserialize(b []byte) interface{} { return nil } diff --git a/pkg/vm/api/storage/storage.go b/pkg/vm/api/storage/storage.go index d3360d50a..ed8cea536 100644 --- a/pkg/vm/api/storage/storage.go +++ b/pkg/vm/api/storage/storage.go @@ -15,5 +15,5 @@ func Get(ctx interface{}, key interface{}) interface{} { return 0 } // Delete removes a stored key value pair. func Delete(ctx interface{}, key interface{}) {} -// Find entrys somewhat matching the given key. +// Find entries somewhat matching the given key. func Find(ctx interface{}, key interface{}) interface{} { return 0 } diff --git a/pkg/vm/cli/cli.go b/pkg/vm/cli/cli.go index ebeb2da71..b3d4efb36 100644 --- a/pkg/vm/cli/cli.go +++ b/pkg/vm/cli/cli.go @@ -19,7 +19,7 @@ import ( // command describes a VM command. type command struct { - // number of minimun arguments the command needs. + // number of minimum arguments the command needs. args int // description of the command. usage string diff --git a/pkg/vm/compiler/analysis.go b/pkg/vm/compiler/analysis.go index 039a07a45..10ee90242 100644 --- a/pkg/vm/compiler/analysis.go +++ b/pkg/vm/compiler/analysis.go @@ -53,11 +53,11 @@ func typeAndValueForField(fld *types.Var) types.TypeAndValue { } // countGlobals counts the global variables in the program to add -// them with the stacksize of the function. +// them with the stack size of the function. func countGlobals(f ast.Node) (i int64) { ast.Inspect(f, func(node ast.Node) bool { switch node.(type) { - // Skip all functio declarations. + // Skip all function declarations. case *ast.FuncDecl: return false // After skipping all funcDecls we are sure that each value spec diff --git a/pkg/vm/compiler/codegen.go b/pkg/vm/compiler/codegen.go index e8ac49cfa..8f482e399 100644 --- a/pkg/vm/compiler/codegen.go +++ b/pkg/vm/compiler/codegen.go @@ -162,7 +162,7 @@ func (c *codegen) convertFuncDecl(file ast.Node, decl *ast.FuncDecl) { // The method receiver will be passed in as first argument. // We check if this declaration has a receiver and load it into scope. // - // FIXME: For now we will hard cast this to a struct. We can later finetune this + // FIXME: For now we will hard cast this to a struct. We can later fine tune this // to support other types. if decl.Recv != nil { for _, arg := range decl.Recv.List { @@ -356,7 +356,7 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor { // The AST package will try to resolve all basic literals for us. // If the typeinfo.Value is not nil we know that the expr is resolved // and needs no further action. e.g. x := 2 + 2 + 2 will be resolved to 6. - // NOTE: Constants will also be automagically resolved be the AST parser. + // NOTE: Constants will also be automatically resolved be the AST parser. // example: // const x = 10 // x + 2 will results into 12 @@ -570,8 +570,8 @@ func (c *codegen) convertBuiltin(expr *ast.CallExpr) { emitOpcode(c.prog, vm.Ohash160) case "FromAddress": // We can be sure that this is a ast.BasicLit just containing a simple - // address string. Note that the string returned from callin Value will - // contain double qoutes that need to be stripped. + // address string. Note that the string returned from calling Value will + // contain double quotes that need to be stripped. addressStr := expr.Args[0].(*ast.BasicLit).Value addressStr = strings.Replace(addressStr, "\"", "", 2) uint160, err := crypto.Uint160DecodeAddress(addressStr) @@ -720,7 +720,7 @@ func CodeGen(info *buildInfo) (*bytes.Buffer, error) { for _, decl := range f.Decls { switch n := decl.(type) { case *ast.FuncDecl: - // Dont convert the function if its not used. This will save alot + // Dont convert the function if its not used. This will save a lot // of bytecode space. if n.Name.Name != mainIdent && funUsage.funcUsed(n.Name.Name) { c.convertFuncDecl(f, n) diff --git a/pkg/vm/stack.go b/pkg/vm/stack.go index 276388e37..fd1bd275f 100644 --- a/pkg/vm/stack.go +++ b/pkg/vm/stack.go @@ -58,7 +58,7 @@ func (e *Element) Prev() *Element { } // BigInt attempts to get the underlying value of the element as a big integer. -// Will panic if the assertion failed which will be catched by the VM. +// Will panic if the assertion failed which will be caught by the VM. func (e *Element) BigInt() *big.Int { switch t := e.value.(type) { case *BigIntegerItem: @@ -70,7 +70,7 @@ func (e *Element) BigInt() *big.Int { } // Bool attempts to get the underlying value of the element as a boolean. -// Will panic if the assertion failed which will be catched by the VM. +// Will panic if the assertion failed which will be caught by the VM. func (e *Element) Bool() bool { if v, ok := e.value.Value().(*big.Int); ok { return v.Int64() == 1 @@ -79,7 +79,7 @@ func (e *Element) Bool() bool { } // Bytes attempts to get the underlying value of the element as a byte array. -// Will panic if the assertion failed which will be catched by the VM. +// Will panic if the assertion failed which will be caught by the VM. func (e *Element) Bytes() []byte { return e.value.Value().([]byte) } diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index c48b6c0d6..9876ab5f0 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -66,7 +66,7 @@ func (v *VM) RegisterInteropFunc(name string, f InteropFunc) { v.interop[name] = f } -// Estack will return the evalutation stack so interop hooks can utilize this. +// Estack will return the evaluation stack so interop hooks can utilize this. func (v *VM) Estack() *Stack { return v.estack } @@ -295,7 +295,7 @@ func (v *VM) execute(ctx *Context, op Opcode) { panic("XSWAP: invalid length") } - // Swap values of elements instead of reordening stack elements. + // Swap values of elements instead of reordering stack elements. if n > 0 { a := v.estack.Peek(n) b := v.estack.Peek(0) diff --git a/pkg/wallet/account.go b/pkg/wallet/account.go index 8d35c6320..6d8c19e49 100644 --- a/pkg/wallet/account.go +++ b/pkg/wallet/account.go @@ -14,7 +14,7 @@ type Account struct { // Account import file. wif string - // NEO public addresss. + // NEO public address. Address string `json:"address"` // Encrypted WIF of the account also known as the key. @@ -35,7 +35,7 @@ type Account struct { Default bool `json:"isDefault"` } -// Contract represents a subset of the smartcontract to embedd in the +// Contract represents a subset of the smartcontract to embed in the // Account so it's NEP-6 compliant. type Contract struct { // Script hash of the contract deployed on the blockchain. diff --git a/pkg/wallet/wallet.go b/pkg/wallet/wallet.go index a0d472e82..eb990e306 100644 --- a/pkg/wallet/wallet.go +++ b/pkg/wallet/wallet.go @@ -11,7 +11,7 @@ const ( walletVersion = "1.0" ) -// Wallet respresents a NEO (NEP-2, NEP-6) compliant wallet. +// Wallet represents a NEO (NEP-2, NEP-6) compliant wallet. type Wallet struct { // Version of the wallet, used for later upgrades. Version string `json:"version"` @@ -72,7 +72,7 @@ func newWallet(rw io.ReadWriter) *Wallet { } } -// CreatAccount generates a new account for the end user and ecrypts +// CreatAccount generates a new account for the end user and encrypts // the private key with the given passphrase. func (w *Wallet) CreateAccount(name, passphrase string) error { acc, err := NewAccount()