diff --git a/cmd/bitxhub/client/http.go b/cmd/bitxhub/client/http.go index 94f6f3928..157753783 100644 --- a/cmd/bitxhub/client/http.go +++ b/cmd/bitxhub/client/http.go @@ -35,12 +35,12 @@ func httpGet(ctx *cli.Context, url string) ([]byte, error) { c, err := ioutil.ReadAll(resp.Body) if err != nil { - return nil, fmt.Errorf("read reponse body error: %w", err) + return nil, fmt.Errorf("read response body error: %w", err) } err = resp.Body.Close() if err != nil { - return nil, fmt.Errorf("close reponse body failed: %w", err) + return nil, fmt.Errorf("close response body failed: %w", err) } return c, nil @@ -65,7 +65,7 @@ func httpPost(ctx *cli.Context, url string, data []byte) ([]byte, error) { /* #nosec */ resp, err := client.Post(url, "application/json", buffer) if err != nil { - return nil, fmt.Errorf("get reponse from http POST request failed: %w", err) + return nil, fmt.Errorf("get response from http POST request failed: %w", err) } c, err := ioutil.ReadAll(resp.Body) if err != nil { @@ -74,7 +74,7 @@ func httpPost(ctx *cli.Context, url string, data []byte) ([]byte, error) { err = resp.Body.Close() if err != nil { - return nil, fmt.Errorf("close reponse body failed: %w", err) + return nil, fmt.Errorf("close response body failed: %w", err) } return c, nil diff --git a/cmd/bitxhub/client/node_manage.go b/cmd/bitxhub/client/node_manage.go index 916aecf84..c7e7747e0 100644 --- a/cmd/bitxhub/client/node_manage.go +++ b/cmd/bitxhub/client/node_manage.go @@ -153,7 +153,7 @@ func registerNode(ctx *cli.Context) error { pid := ctx.String("pid") vpNodeId := ctx.Uint64("id") name := ctx.String("name") - permisssion := ctx.String("permission") + permission := ctx.String("permission") reason := ctx.String("reason") receipt, err := invokeBVMContract(ctx, constant.NodeManagerContractAddr.Address().String(), "RegisterNode", @@ -162,11 +162,11 @@ func registerNode(ctx *cli.Context) error { pb.String(pid), pb.Uint64(vpNodeId), pb.String(name), - pb.String(permisssion), + pb.String(permission), pb.String(reason)) if err != nil { return fmt.Errorf("invoke BVM contract failed when register node \" account=%s,typ=%s,pid=%s,vpNodeId=%d,name=%s,permission=%s,reason=%s \": %w", - account, typ, pid, vpNodeId, name, permisssion, reason, err) + account, typ, pid, vpNodeId, name, permission, reason, err) } if receipt.IsSuccess() { @@ -181,17 +181,17 @@ func registerNode(ctx *cli.Context) error { func updateNode(ctx *cli.Context) error { account := ctx.String("account") name := ctx.String("name") - permisssion := ctx.String("permission") + permission := ctx.String("permission") reason := ctx.String("reason") receipt, err := invokeBVMContract(ctx, constant.NodeManagerContractAddr.Address().String(), "UpdateNode", pb.String(account), pb.String(name), - pb.String(permisssion), + pb.String(permission), pb.String(reason)) if err != nil { return fmt.Errorf("invoke BVM contract failed when update node \" account=%s,name=%s, permission=%s,reason=%s \": %w", - account, name, permisssion, reason, err) + account, name, permission, reason, err) } if receipt.IsSuccess() { diff --git a/internal/executor/contracts/dapp_manager.go b/internal/executor/contracts/dapp_manager.go index 1f26d1715..564cf45f6 100644 --- a/internal/executor/contracts/dapp_manager.go +++ b/internal/executor/contracts/dapp_manager.go @@ -132,7 +132,7 @@ func (d *Dapp) setFSM(lastStatus governance.GovernanceStatus) { ) } -// GovernancePre checks if the dapp can do the event. (only check, not modify infomation) +// GovernancePre checks if the dapp can do the event. (only check, not modify information) func (dm *DappManager) governancePre(dappID string, event governance.EventType) (*Dapp, *boltvm.BxhError) { dapp := &Dapp{} if ok := dm.GetObject(DappKey(dappID), dapp); !ok { diff --git a/internal/executor/contracts/dapp_manager_test.go b/internal/executor/contracts/dapp_manager_test.go index dee773f60..193440479 100644 --- a/internal/executor/contracts/dapp_manager_test.go +++ b/internal/executor/contracts/dapp_manager_test.go @@ -142,7 +142,7 @@ func TestDappManager_RegisterDapp(t *testing.T) { res = dm.RegisterDapp(dapps[1].Name, string(dapps[0].Type), dapps[0].Desc, "url", "123", "-", reason) assert.Equal(t, false, res.Ok, string(res.Result)) res = dm.RegisterDapp(dapps[1].Name, string(dapps[0].Type), dapps[0].Desc, "url", conAddr2, "-", reason) - // premission + // permission res = dm.RegisterDapp(dapps[1].Name, string(dapps[0].Type), dapps[0].Desc, "url", conAddr1, "-", reason) assert.Equal(t, false, res.Ok, string(res.Result)) diff --git a/internal/executor/contracts/proposal_strategy.go b/internal/executor/contracts/proposal_strategy.go index d238849da..09a9f3bfb 100644 --- a/internal/executor/contracts/proposal_strategy.go +++ b/internal/executor/contracts/proposal_strategy.go @@ -216,7 +216,7 @@ func (g *GovStrategy) governancePre(module, event string) (*ProposalStrategy, *b // update proposal strategy for a proposal type func (g *GovStrategy) UpdateProposalStrategy(module string, typ string, strategyExtra string, reason string) *boltvm.Response { - // 1. check premission + // 1. check permission if err := g.checkPermission([]string{string(PermissionAdmin)}, module, g.CurrentCaller(), nil); err != nil { return boltvm.Error(boltvm.ProposalStrategyNoPermissionCode, fmt.Sprintf(string(boltvm.ProposalStrategyNoPermissionMsg), g.CurrentCaller(), fmt.Sprintf("check permission error:%v", err))) } @@ -294,7 +294,7 @@ func (g *GovStrategy) UpdateProposalStrategy(module string, typ string, strategy func (g *GovStrategy) UpdateAllProposalStrategy(typ string, strategyExtra string, reason string) *boltvm.Response { pt := repo.AllMgr - // 1. check premission + // 1. check permission if err := g.checkPermission([]string{string(PermissionAdmin)}, pt, g.CurrentCaller(), nil); err != nil { return boltvm.Error(boltvm.ProposalStrategyNoPermissionCode, fmt.Sprintf(string(boltvm.ProposalStrategyNoPermissionMsg), g.CurrentCaller(), fmt.Sprintf("check permission error:%v", err))) } @@ -380,7 +380,7 @@ func (g *GovStrategy) UpdateAllProposalStrategy(typ string, strategyExtra string // update proposal strategy for a proposal type func (g *GovStrategy) UpdateProposalStrategyByRolesChange(availableNum uint64) *boltvm.Response { - // 1. check premission + // 1. check permission specificAddrs := []string{constant.RoleContractAddr.Address().String()} addrsData, err := json.Marshal(specificAddrs) if err != nil { diff --git a/internal/executor/contracts/role.go b/internal/executor/contracts/role.go index 09fd0514a..c107c2fd1 100644 --- a/internal/executor/contracts/role.go +++ b/internal/executor/contracts/role.go @@ -128,7 +128,7 @@ func (role *Role) setFSM(lastStatus governance.GovernanceStatus) { ) } -// GovernancePre checks if the role can do the event. (only check, not modify infomation) +// GovernancePre checks if the role can do the event. (only check, not modify information) func (rm *RoleManager) governancePre(roleId string, event governance.EventType) (*Role, *boltvm.BxhError) { role := &Role{}