Fix typos (#133)

* Fix typos

* revert chains/unit_testnet

* revert chains

* fix review comments (thx @AlexVanin)
This commit is contained in:
Evgeniy Kulikov 2019-02-13 21:01:10 +03:00 committed by decentralisedkev
parent 845d719698
commit 67cbcac643
25 changed files with 40 additions and 40 deletions

View file

@ -93,7 +93,7 @@ Available network flags:
- `--privnet, -p` - `--privnet, -p`
- `--testnet, -t` - `--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 ```yaml
ProtocolConfiguration: 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). [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, 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 # Contact

View file

@ -76,7 +76,7 @@ func createWallet(ctx *cli.Context) error {
} }
dumpWallet(wall) 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 return nil
} }

View file

@ -37,7 +37,7 @@ type (
ApplicationConfiguration ApplicationConfiguration `yaml:"ApplicationConfiguration"` ApplicationConfiguration ApplicationConfiguration `yaml:"ApplicationConfiguration"`
} }
// ProtocolConfiguration represents the protolcol config. // ProtocolConfiguration represents the protocol config.
ProtocolConfiguration struct { ProtocolConfiguration struct {
Magic NetMode `yaml:"Magic"` Magic NetMode `yaml:"Magic"`
AddressVersion int64 `yaml:"AddressVersion"` AddressVersion int64 `yaml:"AddressVersion"`

View file

@ -17,7 +17,7 @@ var owner = util.FromAddress("AJX1jGfj3qPBbpAKjY527nPbnrnvSx9nCg")
type TokenConfig struct { type TokenConfig struct {
// Name of the token. // Name of the token.
Name string Name string
// 3 letter abreviation of the token. // 3 letter abbreviation of the token.
Symbol string Symbol string
// How decimals this token will have. // How decimals this token will have.
Decimals int Decimals int

View file

@ -33,7 +33,7 @@ type BlockBase struct {
// Random number also called nonce // Random number also called nonce
ConsensusData uint64 `json:"nonce"` ConsensusData uint64 `json:"nonce"`
// Contract addresss of the next miner // Contract address of the next miner
NextConsensus util.Uint160 `json:"next_consensus"` NextConsensus util.Uint160 `json:"next_consensus"`
// Padding that is fixed to 1 // Padding that is fixed to 1

View file

@ -51,7 +51,7 @@ func (c *Cache) has(h util.Uint256) bool {
return ok 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 { func (c *Cache) Has(h util.Uint256) bool {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()

View file

@ -14,7 +14,7 @@ type Header struct {
_ uint8 _ uint8
} }
// DecodeBinary impelements the Payload interface. // DecodeBinary implements the Payload interface.
func (h *Header) DecodeBinary(r io.Reader) error { func (h *Header) DecodeBinary(r io.Reader) error {
if err := h.BlockBase.DecodeBinary(r); err != nil { if err := h.BlockBase.DecodeBinary(r); err != nil {
return err return err
@ -32,7 +32,7 @@ func (h *Header) DecodeBinary(r io.Reader) error {
return nil return nil
} }
// EncodeBinary impelements the Payload interface. // EncodeBinary implements the Payload interface.
func (h *Header) EncodeBinary(w io.Writer) error { func (h *Header) EncodeBinary(w io.Writer) error {
if err := h.BlockBase.EncodeBinary(w); err != nil { if err := h.BlockBase.EncodeBinary(w); err != nil {
return err return err

View file

@ -6,7 +6,7 @@ import (
"github.com/syndtr/goleveldb/leveldb/util" "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. // blockchain data.
type LevelDBStore struct { type LevelDBStore struct {
db *leveldb.DB db *leveldb.DB

View file

@ -15,7 +15,7 @@ type Output struct {
// Amount of AssetType send or received. // Amount of AssetType send or received.
Amount util.Fixed8 Amount util.Fixed8
// The address of the remittee. // The address of the recipient.
ScriptHash util.Uint160 ScriptHash util.Uint160
} }

View file

@ -43,6 +43,6 @@ func (t TXType) String() string {
case InvocationType: case InvocationType:
return "InvocationTransaction" return "InvocationTransaction"
default: default:
return "UnkownTransaction" return "UnknownTransaction"
} }
} }

View file

@ -9,7 +9,7 @@ const (
) )
// Discoverer is an interface that is responsible for maintaining // Discoverer is an interface that is responsible for maintaining
// a healty connection pool. // a healthy connection pool.
type Discoverer interface { type Discoverer interface {
BackFill(...string) BackFill(...string)
PoolCount() int PoolCount() int

View file

@ -8,7 +8,7 @@ import (
) )
// The node can broadcast the object information it owns by this message. // 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. // InventoryType is the type of an object in the Inventory message.
type InventoryType uint8 type InventoryType uint8

View file

@ -38,8 +38,8 @@ func (c *Client) GetAccountState(address string) (*AccountStateResponse, error)
return resp, nil return resp, nil
} }
// InvokeScipt returns the result of the given script after running it true the VM. // 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 blokchain. // NOTE: This is a test invoke and will not affect the blockchain.
func (c *Client) InvokeScript(script string) (*InvokeScriptResponse, error) { func (c *Client) InvokeScript(script string) (*InvokeScriptResponse, error) {
var ( var (
params = newParams(script) params = newParams(script)

View file

@ -53,7 +53,7 @@ func (s *Server) Start(errChan chan error) {
errChan <- s.ListenAndServe() errChan <- s.ListenAndServe()
} }
// Shutdown overrride the http.Server Shutdown // Shutdown override the http.Server Shutdown
// method. // method.
func (s *Server) Shutdown() error { func (s *Server) Shutdown() error {
log.WithFields(log.Fields{ log.WithFields(log.Fields{

View file

@ -23,7 +23,7 @@ type AccountStateResponse struct {
Result *Account `json:"result"` Result *Account `json:"result"`
} }
// Account respresents details about a NEO account. // Account represents details about a NEO account.
type Account struct { type Account struct {
Version int `json:"version"` Version int `json:"version"`
ScriptHash string `json:"script_hash"` ScriptHash string `json:"script_hash"`
@ -33,7 +33,7 @@ type Account struct {
Balances []*Balance Balances []*Balance
} }
// Balance respresents details about a NEO account balance. // Balance represents details about a NEO account balance.
type Balance struct { type Balance struct {
Asset string `json:"asset"` Asset string `json:"asset"`
Value string `json:"value"` Value string `json:"value"`

View file

@ -18,7 +18,7 @@ func RandomString(n int) string {
return string(b) 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 { func RandomInt(min, max int) int {
return min + rand.Intn(max-min) return min + rand.Intn(max-min)
} }

View file

@ -15,7 +15,7 @@ func Notify(arg interface{}) int {
return 0 return 0
} }
// Log intructs the VM to log the given message. // Log instructs the VM to log the given message.
func Log(message string) {} func Log(message string) {}
// Application returns the application trigger type. // Application returns the application trigger type.
@ -39,7 +39,7 @@ func Serialize(item interface{}) []byte {
return nil return nil
} }
// Deserializes an item from a bytearray. // Deserialize an item from a bytearray.
func Deserialize(b []byte) interface{} { func Deserialize(b []byte) interface{} {
return nil return nil
} }

View file

@ -15,5 +15,5 @@ func Get(ctx interface{}, key interface{}) interface{} { return 0 }
// Delete removes a stored key value pair. // Delete removes a stored key value pair.
func Delete(ctx interface{}, key interface{}) {} 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 } func Find(ctx interface{}, key interface{}) interface{} { return 0 }

View file

@ -19,7 +19,7 @@ import (
// command describes a VM command. // command describes a VM command.
type command struct { type command struct {
// number of minimun arguments the command needs. // number of minimum arguments the command needs.
args int args int
// description of the command. // description of the command.
usage string usage string

View file

@ -53,11 +53,11 @@ func typeAndValueForField(fld *types.Var) types.TypeAndValue {
} }
// countGlobals counts the global variables in the program to add // 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) { func countGlobals(f ast.Node) (i int64) {
ast.Inspect(f, func(node ast.Node) bool { ast.Inspect(f, func(node ast.Node) bool {
switch node.(type) { switch node.(type) {
// Skip all functio declarations. // Skip all function declarations.
case *ast.FuncDecl: case *ast.FuncDecl:
return false return false
// After skipping all funcDecls we are sure that each value spec // After skipping all funcDecls we are sure that each value spec

View file

@ -162,7 +162,7 @@ func (c *codegen) convertFuncDecl(file ast.Node, decl *ast.FuncDecl) {
// The method receiver will be passed in as first argument. // The method receiver will be passed in as first argument.
// We check if this declaration has a receiver and load it into scope. // 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. // to support other types.
if decl.Recv != nil { if decl.Recv != nil {
for _, arg := range decl.Recv.List { 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. // 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 // 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. // 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: // example:
// const x = 10 // const x = 10
// x + 2 will results into 12 // x + 2 will results into 12
@ -570,8 +570,8 @@ func (c *codegen) convertBuiltin(expr *ast.CallExpr) {
emitOpcode(c.prog, vm.Ohash160) emitOpcode(c.prog, vm.Ohash160)
case "FromAddress": case "FromAddress":
// We can be sure that this is a ast.BasicLit just containing a simple // 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 // address string. Note that the string returned from calling Value will
// contain double qoutes that need to be stripped. // contain double quotes that need to be stripped.
addressStr := expr.Args[0].(*ast.BasicLit).Value addressStr := expr.Args[0].(*ast.BasicLit).Value
addressStr = strings.Replace(addressStr, "\"", "", 2) addressStr = strings.Replace(addressStr, "\"", "", 2)
uint160, err := crypto.Uint160DecodeAddress(addressStr) uint160, err := crypto.Uint160DecodeAddress(addressStr)
@ -720,7 +720,7 @@ func CodeGen(info *buildInfo) (*bytes.Buffer, error) {
for _, decl := range f.Decls { for _, decl := range f.Decls {
switch n := decl.(type) { switch n := decl.(type) {
case *ast.FuncDecl: 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. // of bytecode space.
if n.Name.Name != mainIdent && funUsage.funcUsed(n.Name.Name) { if n.Name.Name != mainIdent && funUsage.funcUsed(n.Name.Name) {
c.convertFuncDecl(f, n) c.convertFuncDecl(f, n)

View file

@ -58,7 +58,7 @@ func (e *Element) Prev() *Element {
} }
// BigInt attempts to get the underlying value of the element as a big integer. // 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 { func (e *Element) BigInt() *big.Int {
switch t := e.value.(type) { switch t := e.value.(type) {
case *BigIntegerItem: 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. // 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 { func (e *Element) Bool() bool {
if v, ok := e.value.Value().(*big.Int); ok { if v, ok := e.value.Value().(*big.Int); ok {
return v.Int64() == 1 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. // 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 { func (e *Element) Bytes() []byte {
return e.value.Value().([]byte) return e.value.Value().([]byte)
} }

View file

@ -66,7 +66,7 @@ func (v *VM) RegisterInteropFunc(name string, f InteropFunc) {
v.interop[name] = f 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 { func (v *VM) Estack() *Stack {
return v.estack return v.estack
} }
@ -295,7 +295,7 @@ func (v *VM) execute(ctx *Context, op Opcode) {
panic("XSWAP: invalid length") 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 { if n > 0 {
a := v.estack.Peek(n) a := v.estack.Peek(n)
b := v.estack.Peek(0) b := v.estack.Peek(0)

View file

@ -14,7 +14,7 @@ type Account struct {
// Account import file. // Account import file.
wif string wif string
// NEO public addresss. // NEO public address.
Address string `json:"address"` Address string `json:"address"`
// Encrypted WIF of the account also known as the key. // Encrypted WIF of the account also known as the key.
@ -35,7 +35,7 @@ type Account struct {
Default bool `json:"isDefault"` 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. // Account so it's NEP-6 compliant.
type Contract struct { type Contract struct {
// Script hash of the contract deployed on the blockchain. // Script hash of the contract deployed on the blockchain.

View file

@ -11,7 +11,7 @@ const (
walletVersion = "1.0" 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 { type Wallet struct {
// Version of the wallet, used for later upgrades. // Version of the wallet, used for later upgrades.
Version string `json:"version"` 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. // the private key with the given passphrase.
func (w *Wallet) CreateAccount(name, passphrase string) error { func (w *Wallet) CreateAccount(name, passphrase string) error {
acc, err := NewAccount() acc, err := NewAccount()