Skip to content

Commit e49a163

Browse files
author
Darren Kelly
committed
chore: add extra formatters
1 parent a7c8ed9 commit e49a163

259 files changed

Lines changed: 475 additions & 184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@ issues:
5353
formatters:
5454
enable:
5555
- goimports
56+
- gofmt
57+
- gofumpt
5658
settings:
5759
gofmt:
5860
simplify: true
61+
goimports:
62+
local-prefixes:
63+
- github.com/vechain/thor
5964
exclusions:
6065
generated: lax
6166
paths:

abi/abi.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"errors"
1111

1212
ethabi "github.com/ethereum/go-ethereum/accounts/abi"
13+
1314
"github.com/vechain/thor/v2/thor"
1415
)
1516

abi/abi_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"github.com/ethereum/go-ethereum/common"
1313
"github.com/stretchr/testify/assert"
14+
1415
"github.com/vechain/thor/v2/abi"
1516
"github.com/vechain/thor/v2/builtin/gen"
1617
"github.com/vechain/thor/v2/thor"

abi/event.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package abi
77

88
import (
99
ethabi "github.com/ethereum/go-ethereum/accounts/abi"
10+
1011
"github.com/vechain/thor/v2/thor"
1112
)
1213

api/account_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package api
88
import (
99
"github.com/ethereum/go-ethereum/common/hexutil"
1010
"github.com/ethereum/go-ethereum/common/math"
11+
1112
"github.com/vechain/thor/v2/runtime"
1213
"github.com/vechain/thor/v2/thor"
1314
)

api/accounts/accounts.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/ethereum/go-ethereum/common/math"
1616
"github.com/gorilla/mux"
1717
"github.com/pkg/errors"
18+
1819
"github.com/vechain/thor/v2/api"
1920
"github.com/vechain/thor/v2/api/restutil"
2021
"github.com/vechain/thor/v2/bft"
@@ -195,7 +196,7 @@ func (a *Accounts) handleCallContract(w http.ResponseWriter, req *http.Request)
195196
}
196197
addr = &address
197198
}
198-
var batchCallData = &api.BatchCallData{
199+
batchCallData := &api.BatchCallData{
199200
Clauses: api.Clauses{
200201
&api.Clause{
201202
To: addr,

api/accounts/accounts_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/gorilla/mux"
2020
"github.com/stretchr/testify/assert"
2121
"github.com/stretchr/testify/require"
22+
2223
"github.com/vechain/thor/v2/api"
2324
"github.com/vechain/thor/v2/block"
2425
"github.com/vechain/thor/v2/genesis"
@@ -151,7 +152,7 @@ func getAccount(t *testing.T) {
151152
require.NoError(t, err)
152153
assert.Equal(t, http.StatusBadRequest, statusCode, "bad revision")
153154

154-
//revision is optional default `best`
155+
// revision is optional default `best`
155156
res, statusCode, err := tclient.RawHTTPClient().RawHTTPGet("/accounts/" + addr.String())
156157
require.NoError(t, err)
157158
var acc api.Account
@@ -217,7 +218,7 @@ func getCode(t *testing.T) {
217218
require.NoError(t, err)
218219
assert.Equal(t, http.StatusBadRequest, statusCode, "bad revision")
219220

220-
//revision is optional defaut `best`
221+
// revision is optional defaut `best`
221222
res, statusCode, err := tclient.RawHTTPClient().RawHTTPGet("/accounts/" + contractAddr.String() + "/code")
222223
require.NoError(t, err)
223224
var code map[string]string
@@ -255,7 +256,7 @@ func getStorage(t *testing.T) {
255256
require.NoError(t, err)
256257
assert.Equal(t, http.StatusBadRequest, statusCode, "bad revision")
257258

258-
//revision is optional defaut `best`
259+
// revision is optional defaut `best`
259260
res, statusCode, err := tclient.RawHTTPClient().RawHTTPGet("/accounts/" + contractAddr.String() + "/storage/" + storageKey.String())
260261
require.NoError(t, err)
261262
var value map[string]string
@@ -342,7 +343,7 @@ func deployContractWithCall(t *testing.T) {
342343
require.NoError(t, err)
343344
assert.Equal(t, http.StatusBadRequest, statusCode, "bad revision")
344345

345-
//revision is optional defaut `best`
346+
// revision is optional defaut `best`
346347
res, _, err := tclient.RawHTTPClient().RawHTTPPost("/accounts", reqBody)
347348
require.NoError(t, err)
348349
var output *api.CallResult
@@ -443,7 +444,8 @@ func batchCall(t *testing.T) {
443444
To: &contractAddr,
444445
Data: "data2",
445446
Value: nil,
446-
}},
447+
},
448+
},
447449
}
448450
_, statusCode, err = tclient.RawHTTPClient().RawHTTPPost("/accounts/*", badBody)
449451
require.NoError(t, err)
@@ -488,7 +490,8 @@ func batchCall(t *testing.T) {
488490
To: &contractAddr,
489491
Data: hexutil.Encode(input),
490492
Value: nil,
491-
}},
493+
},
494+
},
492495
}
493496

494497
// 'next' revisoun should be valid

api/admin/admin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"github.com/gorilla/handlers"
1414
"github.com/gorilla/mux"
15+
1516
"github.com/vechain/thor/v2/api/admin/apilogs"
1617
"github.com/vechain/thor/v2/api/admin/loglevel"
1718

api/admin/apilogs/api_logs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync/atomic"
1212

1313
"github.com/gorilla/mux"
14+
1415
"github.com/vechain/thor/v2/api"
1516
"github.com/vechain/thor/v2/api/restutil"
1617
"github.com/vechain/thor/v2/log"

api/admin/apilogs/api_logs_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/gorilla/mux"
1717
"github.com/stretchr/testify/assert"
18+
1819
"github.com/vechain/thor/v2/api"
1920
)
2021

0 commit comments

Comments
 (0)