Skip to content

Commit

Permalink
*: fix linter gofmt errors
Browse files Browse the repository at this point in the history
```
pkg/vm/stackitem/json_test.go:11                   gofmt       File is
not `gofmt`-ed with `-s` `-r 'interface{} -> any'`
pkg/core/native/native_test/cryptolib_test.go:471  gofmt       File is
not `gofmt`-ed with `-s` `-r 'interface{} -> any'`
pkg/rpcclient/nns/contract_test.go:585             gofmt       File is
not `gofmt`-ed with `-s` `-r 'interface{} -> any'`

```

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Sep 26, 2024
1 parent cf4d3b2 commit cf2e629
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/core/native/native_test/cryptolib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,5 +468,5 @@ func TestVerifyGroth16Proof(t *testing.T) {
publicWitness := make([]byte, fr.Bytes)

// Verify.
validatorInvoker.Invoke(t, true, "verifyProof", argA, argB, argC, []interface{}{publicWitness})
validatorInvoker.Invoke(t, true, "verifyProof", argA, argB, argC, []any{publicWitness})
}
44 changes: 22 additions & 22 deletions pkg/rpcclient/nns/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,18 +582,18 @@ func TestSetAdmin(t *testing.T) {
testCases := []struct {
name string
setup func()
testFunc func() (interface{}, error)
want interface{}
testFunc func() (any, error)
want any
wantErr bool
}{
{
name: "SetAdmin - Error",
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
txh, vub, err := c.SetAdmin(name, admin)
return []interface{}{txh, vub}, err
return []any{txh, vub}, err
},
wantErr: true,
},
Expand All @@ -604,19 +604,19 @@ func TestSetAdmin(t *testing.T) {
ta.txh = txhMock
ta.vub = 42
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
txh, vub, err := c.SetAdmin(name, admin)
return []interface{}{txh, vub}, err
return []any{txh, vub}, err
},
want: []interface{}{txhMock, uint32(42)},
want: []any{txhMock, uint32(42)},
},
{
name: "SetAdminTransaction - Success",
setup: func() {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetAdminTransaction(name, admin)
},
want: txMock,
Expand All @@ -626,7 +626,7 @@ func TestSetAdmin(t *testing.T) {
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetAdminTransaction(name, admin)
},
wantErr: true,
Expand All @@ -637,7 +637,7 @@ func TestSetAdmin(t *testing.T) {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetAdminUnsigned(name, admin)
},
want: txMock,
Expand All @@ -647,7 +647,7 @@ func TestSetAdmin(t *testing.T) {
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetAdminUnsigned(name, admin)
},
wantErr: true,
Expand Down Expand Up @@ -681,18 +681,18 @@ func TestSetRecord(t *testing.T) {
testCases := []struct {
name string
setup func()
testFunc func() (interface{}, error)
want interface{}
testFunc func() (any, error)
want any
wantErr bool
}{
{
name: "SetRecord - Error",
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
txh, vub, err := c.SetRecord(name, typev, data)
return []interface{}{txh, vub}, err
return []any{txh, vub}, err
},
wantErr: true,
},
Expand All @@ -703,19 +703,19 @@ func TestSetRecord(t *testing.T) {
ta.txh = txhMock
ta.vub = 42
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
txh, vub, err := c.SetRecord(name, typev, data)
return []interface{}{txh, vub}, err
return []any{txh, vub}, err
},
want: []interface{}{txhMock, uint32(42)},
want: []any{txhMock, uint32(42)},
},
{
name: "SetRecordTransaction - Success",
setup: func() {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetRecordTransaction(name, typev, data)
},
want: txMock,
Expand All @@ -725,7 +725,7 @@ func TestSetRecord(t *testing.T) {
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetRecordTransaction(name, typev, data)
},
wantErr: true,
Expand All @@ -736,7 +736,7 @@ func TestSetRecord(t *testing.T) {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetRecordUnsigned(name, typev, data)
},
want: txMock,
Expand All @@ -746,7 +746,7 @@ func TestSetRecord(t *testing.T) {
setup: func() {
ta.err = errors.New("test error")
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetRecordUnsigned(name, typev, data)
},
wantErr: true,
Expand Down
4 changes: 2 additions & 2 deletions pkg/vm/stackitem/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"github.com/stretchr/testify/require"
)

func getTestDecodeFunc(js string, expected ...interface{}) func(t *testing.T) {
func getTestDecodeFunc(js string, expected ...any) func(t *testing.T) {
return getTestDecodeEncodeFunc(js, true, expected...)
}

func getTestDecodeEncodeFunc(js string, needEncode bool, expected ...interface{}) func(t *testing.T) {
func getTestDecodeEncodeFunc(js string, needEncode bool, expected ...any) func(t *testing.T) {
return func(t *testing.T) {
actual, err := FromJSON([]byte(js), 20, true)
if expected[0] == nil {
Expand Down

0 comments on commit cf2e629

Please sign in to comment.