*: fix linter gofmt errors

```
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 <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-09-26 11:56:53 +03:00
parent cf4d3b25d7
commit cf2e6296b7
3 changed files with 25 additions and 25 deletions

View file

@ -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})
}

View file

@ -582,8 +582,8 @@ 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
}{
{
@ -591,9 +591,9 @@ func TestSetAdmin(t *testing.T) {
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,
},
@ -604,11 +604,11 @@ 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",
@ -616,7 +616,7 @@ func TestSetAdmin(t *testing.T) {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetAdminTransaction(name, admin)
},
want: txMock,
@ -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,
@ -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,
@ -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,
@ -681,8 +681,8 @@ 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
}{
{
@ -690,9 +690,9 @@ func TestSetRecord(t *testing.T) {
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,
},
@ -703,11 +703,11 @@ 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",
@ -715,7 +715,7 @@ func TestSetRecord(t *testing.T) {
ta.err = nil
ta.tx = txMock
},
testFunc: func() (interface{}, error) {
testFunc: func() (any, error) {
return c.SetRecordTransaction(name, typev, data)
},
want: txMock,
@ -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,
@ -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,
@ -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,

View file

@ -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 {