diff --git a/api/autoswag/main.go b/api/autoswag/main.go index 8a264e11c..20b824583 100644 --- a/api/autoswag/main.go +++ b/api/autoswag/main.go @@ -173,7 +173,7 @@ func UpdateRouterTags(fset *token.FileSet, parsedFile *ast.File, fmap map[string for _, pm := range pms { line := &ast.Comment{ Text: fmt.Sprintf("//\t@Router %s [%s]", pm.path, pm.method), - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, } list = append(list, line) } @@ -201,23 +201,23 @@ func InitComments(fset *token.FileSet, parsedFile *ast.File, fmap map[string][]P list := []*ast.Comment{} list = append(list, &ast.Comment{ Text: fmt.Sprintf("// %s", x.Name.Name), - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, }) list = append(list, &ast.Comment{ Text: "//", - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, }) list = append(list, &ast.Comment{ Text: "// @Summary TODO", - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, }) list = append(list, &ast.Comment{ Text: "// @Description TODO", - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, }) list = append(list, &ast.Comment{ Text: "// @Success 200 {object} object", - Slash: token.Pos(int(x.Pos() - 1)), + Slash: x.Pos() - 1, }) cmap[x] = []*ast.CommentGroup{ diff --git a/apiclient/client.go b/apiclient/client.go index 71a5949c4..ab40c6861 100644 --- a/apiclient/client.go +++ b/apiclient/client.go @@ -141,7 +141,7 @@ func (c *HTTPclient) SetHostAddr(addr *url.URL) error { return nil } -// Request performs a `method` type raw request to the endpoint specyfied in urlPath parameter. +// Request performs a `method` type raw request to the endpoint specified in urlPath parameter. // Method is either GET or POST. If POST, a JSON struct should be attached. Returns the response, // the status code and an error. func (c *HTTPclient) Request(method string, jsonBody any, urlPath ...string) ([]byte, int, error) { diff --git a/apiclient/helpers.go b/apiclient/helpers.go index cb1c4dd23..fbe528b3b 100644 --- a/apiclient/helpers.go +++ b/apiclient/helpers.go @@ -162,7 +162,7 @@ func (c *HTTPclient) WaitUntilTxIsMined(ctx context.Context, } } -// GetFaucetPackageFromDefaultDevService returns a faucet package. +// GetFaucetPackageFromDevService returns a faucet package. // Needs just the destination wallet address, the URL and bearer token are hardcoded func GetFaucetPackageFromDevService(account string) (*models.FaucetPackage, error) { return GetFaucetPackageFromRemoteService( diff --git a/cmd/cli/main.go b/cmd/cli/main.go index b80eaa4dc..c708f80dc 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -516,7 +516,7 @@ func accountSetMetadata(cli *vocdoniCLI) error { } func electionHandler(cli *vocdoniCLI) error { - infoPrint.Printf("preparing the eletion template...\n") + infoPrint.Printf("preparing the election template...\n") description := api.ElectionDescription{ Title: map[string]string{"default": "election title"}, Description: map[string]string{"default": "election description"}, diff --git a/cmd/end2endtest/account.go b/cmd/end2endtest/account.go index fedf72385..5c801676b 100644 --- a/cmd/end2endtest/account.go +++ b/cmd/end2endtest/account.go @@ -192,12 +192,12 @@ func testSendTokens(api *apiclient.HTTPclient, aliceKeys, bobKeys *ethereum.Sign // now check the resulting state err = checkAccountNonceAndBalance(alice, aliceAcc.Nonce+1, - (aliceAcc.Balance - amountAtoB - uint64(txCost) + amountBtoA)) + (aliceAcc.Balance - amountAtoB - txCost + amountBtoA)) if err != nil { return err } err = checkAccountNonceAndBalance(bob, bobAcc.Nonce+1, - (bobAcc.Balance - amountBtoA - uint64(txCost) + amountAtoB)) + (bobAcc.Balance - amountBtoA - txCost + amountAtoB)) if err != nil { return err } diff --git a/cmd/vochaintest/vochaintest.go b/cmd/vochaintest/vochaintest.go index 158086ec6..ed99fce84 100644 --- a/cmd/vochaintest/vochaintest.go +++ b/cmd/vochaintest/vochaintest.go @@ -1289,7 +1289,7 @@ func (c *testClient) testSetAccountDelegate(signer, signer2 *ethereum.SignKeys) } addedDelegate := common.BytesToAddress(acc.DelegateAddrs[0]) if addedDelegate != signer2.Address() { - log.Fatalf("expeted delegate to be %s got %s", signer2.Address(), addedDelegate) + log.Fatalf("expected delegate to be %s got %s", signer2.Address(), addedDelegate) } // delete delegate acc, err = c.GetAccount(signer.Address()) diff --git a/cmd/voconed/voconed.go b/cmd/voconed/voconed.go index 229d83252..ce52b7cd5 100644 --- a/cmd/voconed/voconed.go +++ b/cmd/voconed/voconed.go @@ -49,7 +49,7 @@ func main() { flag.IntVar(&config.port, "port", 9095, "network port for the HTTP API") flag.StringVar(&config.path, "urlPath", "/api", "HTTP path for the API rest") flag.IntVar(&config.blockSeconds, "blockPeriod", int(vocone.DefaultBlockTimeTarget.Seconds()), "block time target in seconds") - flag.IntVar(&config.blockSize, "blockSize", int(vocone.DefaultTxsPerBlock), "max number of transactions per block") + flag.IntVar(&config.blockSize, "blockSize", vocone.DefaultTxsPerBlock, "max number of transactions per block") setTxCosts := flag.Bool("setTxCosts", false, "if true, transaction costs are set to the value of txCosts flag") flag.Uint64Var(&config.txCosts, "txCosts", vocone.DefaultTxCosts, "transaction costs for all types") flag.Uint64Var(&config.enableFaucetWithAmount, "enableFaucet", 0, "enable faucet API service for the given amount") diff --git a/vochain/transaction/vote_tx.go b/vochain/transaction/vote_tx.go index 956316915..7d6b7a5d9 100644 --- a/vochain/transaction/vote_tx.go +++ b/vochain/transaction/vote_tx.go @@ -197,7 +197,7 @@ func (t *TransactionHandler) VoteTxCheck(vtx *vochaintx.VochainTx, forCommit boo return vote, nil } -// initializeZkVote initializes a zkSNARK vote. It does not check the proof nor includes the the weight of the vote. +// initializeZkVote initializes a zkSNARK vote. It does not check the proof nor includes the weight of the vote. func initializeZkVote(voteEnvelope *models.VoteEnvelope, height uint32) *vstate.Vote { return &vstate.Vote{ Height: height, @@ -208,7 +208,7 @@ func initializeZkVote(voteEnvelope *models.VoteEnvelope, height uint32) *vstate. } } -// initializeSignedVote initializes a signed vote. It does not check the proof nor includes the the weight of the vote. +// initializeSignedVote initializes a signed vote. It does not check the proof nor includes the weight of the vote. func initializeSignedVote(voteEnvelope *models.VoteEnvelope, signedBody, signature []byte, height uint32) (*vstate.Vote, error) { // Create a new vote object with the provided parameters