From a6403dd22c54ed3c35cdc78a0c2381fd93447b9a Mon Sep 17 00:00:00 2001 From: JimboJ <40345116+jimjbrettj@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:39:48 -0700 Subject: [PATCH] chore(mocks): replace github.com/golang/mock with go.uber.org/mock (#3609) --- .github/workflows/mocks.yml | 2 +- .../cmd/scale-down-ecs-service/mocks_test.go | 26 +++--- .../service_scaler_test.go | 2 +- devnet/go.mod | 2 +- devnet/go.sum | 24 +----- dot/core/helpers_test.go | 2 +- dot/core/messages_integration_test.go | 2 +- dot/core/messages_test.go | 2 +- dot/core/mock_runtime_instance_test.go | 34 ++++---- dot/core/mocks_test.go | 54 ++++++------ dot/core/service_integration_test.go | 2 +- dot/core/service_test.go | 2 +- dot/digest/block_import_test.go | 2 +- dot/digest/digest_integration_test.go | 2 +- dot/digest/mock_epoch_state_test.go | 16 ++-- dot/digest/mock_grandpa_test.go | 12 ++- dot/digest/mock_telemetry_test.go | 10 ++- dot/mock_block_state_test.go | 8 +- dot/mock_node_builder_test.go | 36 ++++---- dot/mock_service_builder_test.go | 10 ++- dot/mock_telemetry_test.go | 2 +- dot/mocks_test.go | 14 +-- .../block_announce_integration_test.go | 2 +- dot/network/helpers_test.go | 2 +- dot/network/mock_block_state_test.go | 8 +- dot/network/mock_stream_test.go | 20 +++-- dot/network/mock_syncer_test.go | 14 +-- dot/network/mock_telemetry_test.go | 10 ++- dot/network/mock_transaction_handler_test.go | 10 ++- dot/network/service_integration_test.go | 2 +- dot/network/transaction_integration_test.go | 2 +- dot/network/utils_test.go | 2 +- dot/node_integration_test.go | 2 +- dot/node_test.go | 2 +- dot/rpc/http_test.go | 2 +- dot/rpc/mock_digesthandler_test.go | 2 +- dot/rpc/mock_network_test.go | 12 ++- dot/rpc/mock_telemetry_test.go | 10 ++- dot/rpc/mocks_test.go | 18 ++-- dot/rpc/modules/api_mocks.go | 2 +- dot/rpc/modules/author_integration_test.go | 2 +- dot/rpc/modules/author_test.go | 2 +- dot/rpc/modules/chain_integration_test.go | 2 +- dot/rpc/modules/chain_test.go | 2 +- dot/rpc/modules/childstate_test.go | 2 +- dot/rpc/modules/dev_integration_test.go | 2 +- dot/rpc/modules/dev_test.go | 2 +- dot/rpc/modules/grandpa_integration_test.go | 2 +- dot/rpc/modules/grandpa_test.go | 2 +- dot/rpc/modules/mock_block_state_test.go | 2 +- .../mock_code_substituted_state_test.go | 2 +- dot/rpc/modules/mock_digest_handler_test.go | 2 +- dot/rpc/modules/mock_network_test.go | 2 +- dot/rpc/modules/mock_sync_api_test.go | 8 +- dot/rpc/modules/mock_syncer_test.go | 2 +- .../modules/mock_transaction_handler_test.go | 2 +- dot/rpc/modules/mocks/mocks.go | 86 ++++++++++--------- dot/rpc/modules/mocks_babe_test.go | 10 ++- dot/rpc/modules/mocks_test.go | 52 +++++------ dot/rpc/modules/offchain_integration_test.go | 2 +- dot/rpc/modules/offchain_test.go | 2 +- dot/rpc/modules/payment_integration_test.go | 2 +- dot/rpc/modules/payment_test.go | 2 +- dot/rpc/modules/state_integration_test.go | 2 +- dot/rpc/modules/state_test.go | 2 +- dot/rpc/modules/sync_state_test.go | 2 +- dot/rpc/modules/system_integration_test.go | 2 +- dot/rpc/modules/system_test.go | 2 +- .../listeners_integration_test.go | 2 +- dot/rpc/subscription/mocks_test.go | 12 ++- .../websocket_integration_test.go | 2 +- dot/rpc/websocket_integration_test.go | 2 +- dot/services_integration_test.go | 2 +- dot/services_test.go | 2 +- dot/state/block_race_test.go | 2 +- dot/state/block_test.go | 2 +- dot/state/grandpa_test.go | 2 +- dot/state/mock_counter_test.go | 16 ++-- dot/state/mock_gauge_test.go | 20 +++-- dot/state/mocks_database_test.go | 12 ++- dot/state/mocks_runtime_test.go | 34 ++++---- dot/state/mocks_test.go | 20 +++-- dot/state/service_integration_test.go | 2 +- dot/state/storage_notify_test.go | 2 +- dot/state/storage_test.go | 2 +- dot/state/transaction_test.go | 2 +- dot/state/tries_test.go | 2 +- dot/sync/chain_sync_test.go | 2 +- dot/sync/message_test.go | 2 +- dot/sync/mock_chain_sync_test.go | 12 ++- dot/sync/mock_disjoint_block_set_test.go | 26 +++--- dot/sync/mock_request.go | 10 ++- dot/sync/mock_runtime_test.go | 34 ++++---- dot/sync/mock_telemetry_test.go | 10 ++- dot/sync/mocks_test.go | 58 +++++++------ dot/sync/syncer_integration_test.go | 2 +- dot/sync/syncer_test.go | 2 +- dot/sync/worker_pool_test.go | 2 +- dot/sync/worker_test.go | 2 +- go.mod | 3 +- go.sum | 2 + internal/httpserver/logger_mock_test.go | 14 +-- internal/httpserver/matchers_test.go | 2 +- internal/httpserver/run_test.go | 2 +- internal/httpserver/server_test.go | 2 +- internal/pprof/logger_mock_test.go | 14 +-- internal/pprof/matchers_test.go | 2 +- internal/pprof/runner_mock_test.go | 10 ++- internal/pprof/server_test.go | 2 +- internal/pprof/service_test.go | 2 +- internal/trie/node/branch_encode_test.go | 2 +- internal/trie/node/buffer_mock_test.go | 10 ++- internal/trie/node/encode_test.go | 2 +- internal/trie/node/hash_test.go | 2 +- internal/trie/node/header_test.go | 2 +- internal/trie/node/key_test.go | 2 +- internal/trie/node/reader_mock_test.go | 10 ++- internal/trie/node/writer_mock_test.go | 10 ++- lib/babe/babe_integration_test.go | 2 +- lib/babe/epoch_test.go | 2 +- lib/babe/helpers_test.go | 2 +- lib/babe/mock_state_test.go | 58 +++++++------ lib/babe/mock_telemetry_test.go | 10 ++- lib/babe/mocks/core.go | 14 +-- lib/babe/mocks/runtime.go | 34 ++++---- lib/babe/verify_integration_test.go | 2 +- lib/babe/verify_test.go | 2 +- lib/blocktree/blocktree_test.go | 2 +- lib/blocktree/hashtoruntime_test.go | 2 +- lib/blocktree/mocks_test.go | 34 ++++---- lib/grandpa/finalisation_integration_test.go | 2 +- lib/grandpa/helpers_integration_test.go | 2 +- .../message_handler_integration_test.go | 2 +- lib/grandpa/message_tracker_test.go | 2 +- lib/grandpa/mock_ephemeral_service_test.go | 8 +- lib/grandpa/mock_telemetry_test.go | 10 ++- lib/grandpa/mocks_runtime_test.go | 34 ++++---- lib/grandpa/mocks_test.go | 56 ++++++------ lib/grandpa/network_integration_test.go | 2 +- lib/grandpa/round_integration_test.go | 2 +- lib/grandpa/vote_message_test.go | 2 +- lib/runtime/mocks/mocks.go | 36 ++++---- lib/runtime/mocks_test.go | 22 +++-- lib/runtime/wazero/test_helpers.go | 2 +- lib/services/mocks_test.go | 8 +- lib/services/services_test.go | 2 +- lib/trie/db_getter_mocks_test.go | 10 ++- lib/trie/proof/database_mocks_test.go | 10 ++- lib/trie/proof/generate_test.go | 2 +- lib/trie/trie_test.go | 2 +- 150 files changed, 784 insertions(+), 585 deletions(-) diff --git a/.github/workflows/mocks.yml b/.github/workflows/mocks.yml index 22eff9ba00..1442bb907a 100644 --- a/.github/workflows/mocks.yml +++ b/.github/workflows/mocks.yml @@ -26,7 +26,7 @@ jobs: stable: true check-latest: true - - run: go install github.com/golang/mock/mockgen@v1.6 + - run: go install go.uber.org/mock/mockgen@latest - name: Check devnet module run: | diff --git a/devnet/cmd/scale-down-ecs-service/mocks_test.go b/devnet/cmd/scale-down-ecs-service/mocks_test.go index 99498f0366..845e9425e2 100644 --- a/devnet/cmd/scale-down-ecs-service/mocks_test.go +++ b/devnet/cmd/scale-down-ecs-service/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/devnet/cmd/scale-down-ecs-service/internal (interfaces: ECSAPI) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=main github.com/ChainSafe/gossamer/devnet/cmd/scale-down-ecs-service/internal ECSAPI +// // Package main is a generated GoMock package. package main @@ -10,7 +14,7 @@ import ( request "github.com/aws/aws-sdk-go/aws/request" ecs "github.com/aws/aws-sdk-go/service/ecs" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockECSAPI is a mock of ECSAPI interface. @@ -39,7 +43,7 @@ func (m *MockECSAPI) EXPECT() *MockECSAPIMockRecorder { // DescribeServicesWithContext mocks base method. func (m *MockECSAPI) DescribeServicesWithContext(arg0 context.Context, arg1 *ecs.DescribeServicesInput, arg2 ...request.Option) (*ecs.DescribeServicesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -50,16 +54,16 @@ func (m *MockECSAPI) DescribeServicesWithContext(arg0 context.Context, arg1 *ecs } // DescribeServicesWithContext indicates an expected call of DescribeServicesWithContext. -func (mr *MockECSAPIMockRecorder) DescribeServicesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockECSAPIMockRecorder) DescribeServicesWithContext(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeServicesWithContext", reflect.TypeOf((*MockECSAPI)(nil).DescribeServicesWithContext), varargs...) } // ListServicesWithContext mocks base method. func (m *MockECSAPI) ListServicesWithContext(arg0 context.Context, arg1 *ecs.ListServicesInput, arg2 ...request.Option) (*ecs.ListServicesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -70,16 +74,16 @@ func (m *MockECSAPI) ListServicesWithContext(arg0 context.Context, arg1 *ecs.Lis } // ListServicesWithContext indicates an expected call of ListServicesWithContext. -func (mr *MockECSAPIMockRecorder) ListServicesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockECSAPIMockRecorder) ListServicesWithContext(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServicesWithContext", reflect.TypeOf((*MockECSAPI)(nil).ListServicesWithContext), varargs...) } // UpdateServiceWithContext mocks base method. func (m *MockECSAPI) UpdateServiceWithContext(arg0 context.Context, arg1 *ecs.UpdateServiceInput, arg2 ...request.Option) (*ecs.UpdateServiceOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -90,8 +94,8 @@ func (m *MockECSAPI) UpdateServiceWithContext(arg0 context.Context, arg1 *ecs.Up } // UpdateServiceWithContext indicates an expected call of UpdateServiceWithContext. -func (mr *MockECSAPIMockRecorder) UpdateServiceWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockECSAPIMockRecorder) UpdateServiceWithContext(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceWithContext", reflect.TypeOf((*MockECSAPI)(nil).UpdateServiceWithContext), varargs...) } diff --git a/devnet/cmd/scale-down-ecs-service/service_scaler_test.go b/devnet/cmd/scale-down-ecs-service/service_scaler_test.go index 93c4f3b861..751ef3e05b 100644 --- a/devnet/cmd/scale-down-ecs-service/service_scaler_test.go +++ b/devnet/cmd/scale-down-ecs-service/service_scaler_test.go @@ -14,7 +14,7 @@ import ( "github.com/aws/aws-sdk-go/aws" request "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ecs" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func Test_serviceScaler_findServiceArns(t *testing.T) { diff --git a/devnet/go.mod b/devnet/go.mod index 9188e2e7bb..d9ebf1b913 100644 --- a/devnet/go.mod +++ b/devnet/go.mod @@ -4,8 +4,8 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.42.22 - github.com/golang/mock v1.6.0 github.com/jessevdk/go-flags v1.5.0 + go.uber.org/mock v0.3.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/devnet/go.sum b/devnet/go.sum index 3a5e168ea7..9918671076 100644 --- a/devnet/go.sum +++ b/devnet/go.sum @@ -2,8 +2,6 @@ github.com/aws/aws-sdk-go v1.42.22 h1:EwcM7/+Ytg6xK+jbeM2+f9OELHqPiEiEKetT/GgAr7 github.com/aws/aws-sdk-go v1.42.22/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -14,35 +12,17 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/dot/core/helpers_test.go b/dot/core/helpers_test.go index 4c47371437..a011937672 100644 --- a/dot/core/helpers_test.go +++ b/dot/core/helpers_test.go @@ -24,8 +24,8 @@ import ( "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/centrifuge/go-substrate-rpc-client/v4/signature" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func balanceKey(t *testing.T, pub []byte) (bKey []byte) { diff --git a/dot/core/messages_integration_test.go b/dot/core/messages_integration_test.go index 4f435d850f..ca96856a2c 100644 --- a/dot/core/messages_integration_test.go +++ b/dot/core/messages_integration_test.go @@ -23,9 +23,9 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func createExtrinsic(t *testing.T, rt runtime.Instance, genHash common.Hash, nonce uint64) types.Extrinsic { diff --git a/dot/core/messages_test.go b/dot/core/messages_test.go index d658add304..bd3342d0ca 100644 --- a/dot/core/messages_test.go +++ b/dot/core/messages_test.go @@ -16,10 +16,10 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var errDummyErr = errors.New("dummy error for testing") diff --git a/dot/core/mock_runtime_instance_test.go b/dot/core/mock_runtime_instance_test.go index 0a1f6a7478..6c1bbfd678 100644 --- a/dot/core/mock_runtime_instance_test.go +++ b/dot/core/mock_runtime_instance_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mock_runtime_instance_test.go -package core github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package core is a generated GoMock package. package core @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/dot/core/mocks_test.go b/dot/core/mocks_test.go index 07f6a66b86..9bf4d60c7f 100644 --- a/dot/core/mocks_test.go +++ b/dot/core/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/core (interfaces: BlockState,StorageState,TransactionState,Network,CodeSubstitutedState,Telemetry,BlockImportDigestHandler,GrandpaState) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package core . BlockState,StorageState,TransactionState,Network,CodeSubstitutedState,Telemetry,BlockImportDigestHandler,GrandpaState +// // Package core is a generated GoMock package. package core @@ -15,8 +19,8 @@ import ( runtime "github.com/ChainSafe/gossamer/lib/runtime" storage "github.com/ChainSafe/gossamer/lib/runtime/storage" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. @@ -51,7 +55,7 @@ func (m *MockBlockState) AddBlock(arg0 *types.Block) error { } // AddBlock indicates an expected call of AddBlock. -func (mr *MockBlockStateMockRecorder) AddBlock(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) AddBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlock", reflect.TypeOf((*MockBlockState)(nil).AddBlock), arg0) } @@ -95,7 +99,7 @@ func (m *MockBlockState) GetBlockBody(arg0 common.Hash) (*types.Body, error) { } // GetBlockBody indicates an expected call of GetBlockBody. -func (mr *MockBlockStateMockRecorder) GetBlockBody(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockBody(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockBody", reflect.TypeOf((*MockBlockState)(nil).GetBlockBody), arg0) } @@ -110,7 +114,7 @@ func (m *MockBlockState) GetBlockStateRoot(arg0 common.Hash) (common.Hash, error } // GetBlockStateRoot indicates an expected call of GetBlockStateRoot. -func (mr *MockBlockStateMockRecorder) GetBlockStateRoot(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockStateRoot(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockStateRoot", reflect.TypeOf((*MockBlockState)(nil).GetBlockStateRoot), arg0) } @@ -125,7 +129,7 @@ func (m *MockBlockState) GetRuntime(arg0 common.Hash) (runtime.Instance, error) } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockState)(nil).GetRuntime), arg0) } @@ -139,7 +143,7 @@ func (m *MockBlockState) HandleRuntimeChanges(arg0 *storage.TrieState, arg1 runt } // HandleRuntimeChanges indicates an expected call of HandleRuntimeChanges. -func (mr *MockBlockStateMockRecorder) HandleRuntimeChanges(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) HandleRuntimeChanges(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleRuntimeChanges", reflect.TypeOf((*MockBlockState)(nil).HandleRuntimeChanges), arg0, arg1, arg2) } @@ -154,7 +158,7 @@ func (m *MockBlockState) LowestCommonAncestor(arg0, arg1 common.Hash) (common.Ha } // LowestCommonAncestor indicates an expected call of LowestCommonAncestor. -func (mr *MockBlockStateMockRecorder) LowestCommonAncestor(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) LowestCommonAncestor(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LowestCommonAncestor", reflect.TypeOf((*MockBlockState)(nil).LowestCommonAncestor), arg0, arg1) } @@ -169,7 +173,7 @@ func (m *MockBlockState) RangeInMemory(arg0, arg1 common.Hash) ([]common.Hash, e } // RangeInMemory indicates an expected call of RangeInMemory. -func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockState)(nil).RangeInMemory), arg0, arg1) } @@ -181,7 +185,7 @@ func (m *MockBlockState) StoreRuntime(arg0 common.Hash, arg1 runtime.Instance) { } // StoreRuntime indicates an expected call of StoreRuntime. -func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreRuntime", reflect.TypeOf((*MockBlockState)(nil).StoreRuntime), arg0, arg1) } @@ -219,7 +223,7 @@ func (m *MockStorageState) GenerateTrieProof(arg0 common.Hash, arg1 [][]byte) ([ } // GenerateTrieProof indicates an expected call of GenerateTrieProof. -func (mr *MockStorageStateMockRecorder) GenerateTrieProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) GenerateTrieProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateTrieProof", reflect.TypeOf((*MockStorageState)(nil).GenerateTrieProof), arg0, arg1) } @@ -234,7 +238,7 @@ func (m *MockStorageState) GetStateRootFromBlock(arg0 *common.Hash) (*common.Has } // GetStateRootFromBlock indicates an expected call of GetStateRootFromBlock. -func (mr *MockStorageStateMockRecorder) GetStateRootFromBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) GetStateRootFromBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateRootFromBlock", reflect.TypeOf((*MockStorageState)(nil).GetStateRootFromBlock), arg0) } @@ -260,7 +264,7 @@ func (m *MockStorageState) StoreTrie(arg0 *storage.TrieState, arg1 *types.Header } // StoreTrie indicates an expected call of StoreTrie. -func (mr *MockStorageStateMockRecorder) StoreTrie(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) StoreTrie(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreTrie", reflect.TypeOf((*MockStorageState)(nil).StoreTrie), arg0, arg1) } @@ -275,7 +279,7 @@ func (m *MockStorageState) TrieState(arg0 *common.Hash) (*storage.TrieState, err } // TrieState indicates an expected call of TrieState. -func (mr *MockStorageStateMockRecorder) TrieState(arg0 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) TrieState(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrieState", reflect.TypeOf((*MockStorageState)(nil).TrieState), arg0) } @@ -324,7 +328,7 @@ func (m *MockTransactionState) AddToPool(arg0 *transaction.ValidTransaction) com } // AddToPool indicates an expected call of AddToPool. -func (mr *MockTransactionStateMockRecorder) AddToPool(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) AddToPool(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddToPool", reflect.TypeOf((*MockTransactionState)(nil).AddToPool), arg0) } @@ -338,7 +342,7 @@ func (m *MockTransactionState) Exists(arg0 types.Extrinsic) bool { } // Exists indicates an expected call of Exists. -func (mr *MockTransactionStateMockRecorder) Exists(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) Exists(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockTransactionState)(nil).Exists), arg0) } @@ -367,7 +371,7 @@ func (m *MockTransactionState) Push(arg0 *transaction.ValidTransaction) (common. } // Push indicates an expected call of Push. -func (mr *MockTransactionStateMockRecorder) Push(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) Push(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockTransactionState)(nil).Push), arg0) } @@ -379,7 +383,7 @@ func (m *MockTransactionState) RemoveExtrinsic(arg0 types.Extrinsic) { } // RemoveExtrinsic indicates an expected call of RemoveExtrinsic. -func (mr *MockTransactionStateMockRecorder) RemoveExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) RemoveExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveExtrinsic", reflect.TypeOf((*MockTransactionState)(nil).RemoveExtrinsic), arg0) } @@ -391,7 +395,7 @@ func (m *MockTransactionState) RemoveExtrinsicFromPool(arg0 types.Extrinsic) { } // RemoveExtrinsicFromPool indicates an expected call of RemoveExtrinsicFromPool. -func (mr *MockTransactionStateMockRecorder) RemoveExtrinsicFromPool(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) RemoveExtrinsicFromPool(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveExtrinsicFromPool", reflect.TypeOf((*MockTransactionState)(nil).RemoveExtrinsicFromPool), arg0) } @@ -426,7 +430,7 @@ func (m *MockNetwork) GossipMessage(arg0 network.NotificationsMessage) { } // GossipMessage indicates an expected call of GossipMessage. -func (mr *MockNetworkMockRecorder) GossipMessage(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) GossipMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GossipMessage", reflect.TypeOf((*MockNetwork)(nil).GossipMessage), arg0) } @@ -452,7 +456,7 @@ func (m *MockNetwork) ReportPeer(arg0 peerset.ReputationChange, arg1 peer.ID) { } // ReportPeer indicates an expected call of ReportPeer. -func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeer", reflect.TypeOf((*MockNetwork)(nil).ReportPeer), arg0, arg1) } @@ -489,7 +493,7 @@ func (m *MockCodeSubstitutedState) StoreCodeSubstitutedBlockHash(arg0 common.Has } // StoreCodeSubstitutedBlockHash indicates an expected call of StoreCodeSubstitutedBlockHash. -func (mr *MockCodeSubstitutedStateMockRecorder) StoreCodeSubstitutedBlockHash(arg0 interface{}) *gomock.Call { +func (mr *MockCodeSubstitutedStateMockRecorder) StoreCodeSubstitutedBlockHash(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreCodeSubstitutedBlockHash", reflect.TypeOf((*MockCodeSubstitutedState)(nil).StoreCodeSubstitutedBlockHash), arg0) } @@ -524,7 +528,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } @@ -561,7 +565,7 @@ func (m *MockBlockImportDigestHandler) HandleDigests(arg0 *types.Header) error { } // HandleDigests indicates an expected call of HandleDigests. -func (mr *MockBlockImportDigestHandlerMockRecorder) HandleDigests(arg0 interface{}) *gomock.Call { +func (mr *MockBlockImportDigestHandlerMockRecorder) HandleDigests(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleDigests", reflect.TypeOf((*MockBlockImportDigestHandler)(nil).HandleDigests), arg0) } @@ -598,7 +602,7 @@ func (m *MockGrandpaState) ApplyForcedChanges(arg0 *types.Header) error { } // ApplyForcedChanges indicates an expected call of ApplyForcedChanges. -func (mr *MockGrandpaStateMockRecorder) ApplyForcedChanges(arg0 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) ApplyForcedChanges(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyForcedChanges", reflect.TypeOf((*MockGrandpaState)(nil).ApplyForcedChanges), arg0) } diff --git a/dot/core/service_integration_test.go b/dot/core/service_integration_test.go index dcb8c2f346..4cca83e2d9 100644 --- a/dot/core/service_integration_test.go +++ b/dot/core/service_integration_test.go @@ -27,8 +27,8 @@ import ( "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestStartService(t *testing.T) { diff --git a/dot/core/service_test.go b/dot/core/service_test.go index a21b516779..16d2ee6fc3 100644 --- a/dot/core/service_test.go +++ b/dot/core/service_test.go @@ -30,9 +30,9 @@ import ( ctypes "github.com/centrifuge/go-substrate-rpc-client/v4/types" "github.com/centrifuge/go-substrate-rpc-client/v4/types/codec" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var errTestDummyError = errors.New("test dummy error") diff --git a/dot/digest/block_import_test.go b/dot/digest/block_import_test.go index 329d341a34..7ec12d82d1 100644 --- a/dot/digest/block_import_test.go +++ b/dot/digest/block_import_test.go @@ -11,8 +11,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestBlockImportHandle(t *testing.T) { diff --git a/dot/digest/digest_integration_test.go b/dot/digest/digest_integration_test.go index de92495c3c..5080fdd276 100644 --- a/dot/digest/digest_integration_test.go +++ b/dot/digest/digest_integration_test.go @@ -18,7 +18,7 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/digest/mock_epoch_state_test.go b/dot/digest/mock_epoch_state_test.go index c2285656c3..248648c1b7 100644 --- a/dot/digest/mock_epoch_state_test.go +++ b/dot/digest/mock_epoch_state_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/digest (interfaces: EpochState) - +// +// Generated by this command: +// +// mockgen -destination=mock_epoch_state_test.go -package digest . EpochState +// // Package digest is a generated GoMock package. package digest @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" scale "github.com/ChainSafe/gossamer/pkg/scale" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockEpochState is a mock of EpochState interface. @@ -44,7 +48,7 @@ func (m *MockEpochState) FinalizeBABENextConfigData(arg0 *types.Header) error { } // FinalizeBABENextConfigData indicates an expected call of FinalizeBABENextConfigData. -func (mr *MockEpochStateMockRecorder) FinalizeBABENextConfigData(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) FinalizeBABENextConfigData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeBABENextConfigData", reflect.TypeOf((*MockEpochState)(nil).FinalizeBABENextConfigData), arg0) } @@ -58,7 +62,7 @@ func (m *MockEpochState) FinalizeBABENextEpochData(arg0 *types.Header) error { } // FinalizeBABENextEpochData indicates an expected call of FinalizeBABENextEpochData. -func (mr *MockEpochStateMockRecorder) FinalizeBABENextEpochData(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) FinalizeBABENextEpochData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeBABENextEpochData", reflect.TypeOf((*MockEpochState)(nil).FinalizeBABENextEpochData), arg0) } @@ -73,7 +77,7 @@ func (m *MockEpochState) GetEpochForBlock(arg0 *types.Header) (uint64, error) { } // GetEpochForBlock indicates an expected call of GetEpochForBlock. -func (mr *MockEpochStateMockRecorder) GetEpochForBlock(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) GetEpochForBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpochForBlock", reflect.TypeOf((*MockEpochState)(nil).GetEpochForBlock), arg0) } @@ -87,7 +91,7 @@ func (m *MockEpochState) HandleBABEDigest(arg0 *types.Header, arg1 scale.Varying } // HandleBABEDigest indicates an expected call of HandleBABEDigest. -func (mr *MockEpochStateMockRecorder) HandleBABEDigest(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) HandleBABEDigest(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBABEDigest", reflect.TypeOf((*MockEpochState)(nil).HandleBABEDigest), arg0, arg1) } diff --git a/dot/digest/mock_grandpa_test.go b/dot/digest/mock_grandpa_test.go index 8e36387d75..1e83cda4ca 100644 --- a/dot/digest/mock_grandpa_test.go +++ b/dot/digest/mock_grandpa_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/digest (interfaces: GrandpaState) - +// +// Generated by this command: +// +// mockgen -destination=mock_grandpa_test.go -package digest . GrandpaState +// // Package digest is a generated GoMock package. package digest @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" scale "github.com/ChainSafe/gossamer/pkg/scale" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockGrandpaState is a mock of GrandpaState interface. @@ -44,7 +48,7 @@ func (m *MockGrandpaState) ApplyScheduledChanges(arg0 *types.Header) error { } // ApplyScheduledChanges indicates an expected call of ApplyScheduledChanges. -func (mr *MockGrandpaStateMockRecorder) ApplyScheduledChanges(arg0 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) ApplyScheduledChanges(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyScheduledChanges", reflect.TypeOf((*MockGrandpaState)(nil).ApplyScheduledChanges), arg0) } @@ -58,7 +62,7 @@ func (m *MockGrandpaState) HandleGRANDPADigest(arg0 *types.Header, arg1 scale.Va } // HandleGRANDPADigest indicates an expected call of HandleGRANDPADigest. -func (mr *MockGrandpaStateMockRecorder) HandleGRANDPADigest(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) HandleGRANDPADigest(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleGRANDPADigest", reflect.TypeOf((*MockGrandpaState)(nil).HandleGRANDPADigest), arg0, arg1) } diff --git a/dot/digest/mock_telemetry_test.go b/dot/digest/mock_telemetry_test.go index 7765d0ff59..f7e62eaa8b 100644 --- a/dot/digest/mock_telemetry_test.go +++ b/dot/digest/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/digest (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package digest . Telemetry +// // Package digest is a generated GoMock package. package digest @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/dot/mock_block_state_test.go b/dot/mock_block_state_test.go index fd31c759f8..d1ac20b7d7 100644 --- a/dot/mock_block_state_test.go +++ b/dot/mock_block_state_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: BlockState) - +// +// Generated by this command: +// +// mockgen -destination=mock_block_state_test.go -package dot github.com/ChainSafe/gossamer/dot/network BlockState +// // Package dot is a generated GoMock package. package dot @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. diff --git a/dot/mock_node_builder_test.go b/dot/mock_node_builder_test.go index 25fa1250c6..edaf6bec55 100644 --- a/dot/mock_node_builder_test.go +++ b/dot/mock_node_builder_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: node.go - +// +// Generated by this command: +// +// mockgen -source=node.go -destination=mock_node_builder_test.go -package=dot +// // Package dot is a generated GoMock package. package dot @@ -20,7 +24,7 @@ import ( grandpa "github.com/ChainSafe/gossamer/lib/grandpa" keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MocknodeBuilderIface is a mock of nodeBuilderIface interface. @@ -56,7 +60,7 @@ func (m *MocknodeBuilderIface) createBABEService(config *config.Config, st *stat } // createBABEService indicates an expected call of createBABEService. -func (mr *MocknodeBuilderIfaceMockRecorder) createBABEService(config, st, ks, cs, telemetryMailer interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createBABEService(config, st, ks, cs, telemetryMailer any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createBABEService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createBABEService), config, st, ks, cs, telemetryMailer) } @@ -70,7 +74,7 @@ func (m *MocknodeBuilderIface) createBlockVerifier(st *state.Service) *babe.Veri } // createBlockVerifier indicates an expected call of createBlockVerifier. -func (mr *MocknodeBuilderIfaceMockRecorder) createBlockVerifier(st interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createBlockVerifier(st any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createBlockVerifier", reflect.TypeOf((*MocknodeBuilderIface)(nil).createBlockVerifier), st) } @@ -85,7 +89,7 @@ func (m *MocknodeBuilderIface) createCoreService(config *config.Config, ks *keys } // createCoreService indicates an expected call of createCoreService. -func (mr *MocknodeBuilderIfaceMockRecorder) createCoreService(config, ks, st, net interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createCoreService(config, ks, st, net any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createCoreService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createCoreService), config, ks, st, net) } @@ -100,7 +104,7 @@ func (m *MocknodeBuilderIface) createDigestHandler(st *state.Service) (*digest.H } // createDigestHandler indicates an expected call of createDigestHandler. -func (mr *MocknodeBuilderIfaceMockRecorder) createDigestHandler(st interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createDigestHandler(st any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createDigestHandler", reflect.TypeOf((*MocknodeBuilderIface)(nil).createDigestHandler), st) } @@ -115,7 +119,7 @@ func (m *MocknodeBuilderIface) createGRANDPAService(config *config.Config, st *s } // createGRANDPAService indicates an expected call of createGRANDPAService. -func (mr *MocknodeBuilderIfaceMockRecorder) createGRANDPAService(config, st, ks, net, telemetryMailer interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createGRANDPAService(config, st, ks, net, telemetryMailer any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createGRANDPAService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createGRANDPAService), config, st, ks, net, telemetryMailer) } @@ -130,7 +134,7 @@ func (m *MocknodeBuilderIface) createNetworkService(config *config.Config, state } // createNetworkService indicates an expected call of createNetworkService. -func (mr *MocknodeBuilderIfaceMockRecorder) createNetworkService(config, stateSrvc, telemetryMailer interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createNetworkService(config, stateSrvc, telemetryMailer any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createNetworkService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createNetworkService), config, stateSrvc, telemetryMailer) } @@ -145,7 +149,7 @@ func (m *MocknodeBuilderIface) createRPCService(params rpcServiceSettings) (*rpc } // createRPCService indicates an expected call of createRPCService. -func (mr *MocknodeBuilderIfaceMockRecorder) createRPCService(params interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createRPCService(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createRPCService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createRPCService), params) } @@ -160,7 +164,7 @@ func (m *MocknodeBuilderIface) createRuntimeStorage(st *state.Service) (*runtime } // createRuntimeStorage indicates an expected call of createRuntimeStorage. -func (mr *MocknodeBuilderIfaceMockRecorder) createRuntimeStorage(st interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createRuntimeStorage(st any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createRuntimeStorage", reflect.TypeOf((*MocknodeBuilderIface)(nil).createRuntimeStorage), st) } @@ -175,7 +179,7 @@ func (m *MocknodeBuilderIface) createStateService(config *config.Config) (*state } // createStateService indicates an expected call of createStateService. -func (mr *MocknodeBuilderIfaceMockRecorder) createStateService(config interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createStateService(config any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createStateService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createStateService), config) } @@ -190,7 +194,7 @@ func (m *MocknodeBuilderIface) createSystemService(cfg *types.SystemInfo, stateS } // createSystemService indicates an expected call of createSystemService. -func (mr *MocknodeBuilderIfaceMockRecorder) createSystemService(cfg, stateSrvc interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createSystemService(cfg, stateSrvc any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createSystemService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createSystemService), cfg, stateSrvc) } @@ -204,7 +208,7 @@ func (m *MocknodeBuilderIface) initNode(config *config.Config) error { } // initNode indicates an expected call of initNode. -func (mr *MocknodeBuilderIfaceMockRecorder) initNode(config interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) initNode(config any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "initNode", reflect.TypeOf((*MocknodeBuilderIface)(nil).initNode), config) } @@ -219,7 +223,7 @@ func (m *MocknodeBuilderIface) isNodeInitialised(basepath string) (bool, error) } // isNodeInitialised indicates an expected call of isNodeInitialised. -func (mr *MocknodeBuilderIfaceMockRecorder) isNodeInitialised(basepath interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) isNodeInitialised(basepath any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "isNodeInitialised", reflect.TypeOf((*MocknodeBuilderIface)(nil).isNodeInitialised), basepath) } @@ -233,7 +237,7 @@ func (m *MocknodeBuilderIface) loadRuntime(config *config.Config, ns *runtime.No } // loadRuntime indicates an expected call of loadRuntime. -func (mr *MocknodeBuilderIfaceMockRecorder) loadRuntime(config, ns, stateSrvc, ks, net interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) loadRuntime(config, ns, stateSrvc, ks, net any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "loadRuntime", reflect.TypeOf((*MocknodeBuilderIface)(nil).loadRuntime), config, ns, stateSrvc, ks, net) } @@ -248,7 +252,7 @@ func (m *MocknodeBuilderIface) newSyncService(config *config.Config, st *state.S } // newSyncService indicates an expected call of newSyncService. -func (mr *MocknodeBuilderIfaceMockRecorder) newSyncService(config, st, finalityGadget, verifier, cs, net, telemetryMailer interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) newSyncService(config, st, finalityGadget, verifier, cs, net, telemetryMailer any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "newSyncService", reflect.TypeOf((*MocknodeBuilderIface)(nil).newSyncService), config, st, finalityGadget, verifier, cs, net, telemetryMailer) } diff --git a/dot/mock_service_builder_test.go b/dot/mock_service_builder_test.go index b6ab190047..38ab107b04 100644 --- a/dot/mock_service_builder_test.go +++ b/dot/mock_service_builder_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot (interfaces: ServiceBuilder) - +// +// Generated by this command: +// +// mockgen -destination=mock_service_builder_test.go -package dot . ServiceBuilder +// // Package dot is a generated GoMock package. package dot @@ -8,7 +12,7 @@ import ( reflect "reflect" babe "github.com/ChainSafe/gossamer/lib/babe" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockServiceBuilder is a mock of ServiceBuilder interface. @@ -44,7 +48,7 @@ func (m *MockServiceBuilder) NewServiceIFace(arg0 *babe.ServiceConfig) (*babe.Se } // NewServiceIFace indicates an expected call of NewServiceIFace. -func (mr *MockServiceBuilderMockRecorder) NewServiceIFace(arg0 interface{}) *gomock.Call { +func (mr *MockServiceBuilderMockRecorder) NewServiceIFace(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewServiceIFace", reflect.TypeOf((*MockServiceBuilder)(nil).NewServiceIFace), arg0) } diff --git a/dot/mock_telemetry_test.go b/dot/mock_telemetry_test.go index 3405a4d948..c780e52ca1 100644 --- a/dot/mock_telemetry_test.go +++ b/dot/mock_telemetry_test.go @@ -8,7 +8,7 @@ import ( "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockClient is a mock of Client interface. diff --git a/dot/mocks_test.go b/dot/mocks_test.go index 436abff46e..90f9c232f7 100644 --- a/dot/mocks_test.go +++ b/dot/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot (interfaces: ServiceRegisterer) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=dot . ServiceRegisterer +// // Package dot is a generated GoMock package. package dot @@ -8,7 +12,7 @@ import ( reflect "reflect" services "github.com/ChainSafe/gossamer/lib/services" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockServiceRegisterer is a mock of ServiceRegisterer interface. @@ -35,7 +39,7 @@ func (m *MockServiceRegisterer) EXPECT() *MockServiceRegistererMockRecorder { } // Get mocks base method. -func (m *MockServiceRegisterer) Get(arg0 interface{}) services.Service { +func (m *MockServiceRegisterer) Get(arg0 any) services.Service { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0) ret0, _ := ret[0].(services.Service) @@ -43,7 +47,7 @@ func (m *MockServiceRegisterer) Get(arg0 interface{}) services.Service { } // Get indicates an expected call of Get. -func (mr *MockServiceRegistererMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockServiceRegistererMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockServiceRegisterer)(nil).Get), arg0) } @@ -55,7 +59,7 @@ func (m *MockServiceRegisterer) RegisterService(arg0 services.Service) { } // RegisterService indicates an expected call of RegisterService. -func (mr *MockServiceRegistererMockRecorder) RegisterService(arg0 interface{}) *gomock.Call { +func (mr *MockServiceRegistererMockRecorder) RegisterService(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterService", reflect.TypeOf((*MockServiceRegisterer)(nil).RegisterService), arg0) } diff --git a/dot/network/block_announce_integration_test.go b/dot/network/block_announce_integration_test.go index 73ec7e7cda..a32f6c55fb 100644 --- a/dot/network/block_announce_integration_test.go +++ b/dot/network/block_announce_integration_test.go @@ -12,7 +12,7 @@ import ( "github.com/ChainSafe/gossamer/lib/blocktree" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" diff --git a/dot/network/helpers_test.go b/dot/network/helpers_test.go index ba57e81e7d..db5aebae5f 100644 --- a/dot/network/helpers_test.go +++ b/dot/network/helpers_test.go @@ -14,10 +14,10 @@ import ( "github.com/ChainSafe/gossamer/internal/log" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/golang/mock/gomock" libp2pnetwork "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const ( diff --git a/dot/network/mock_block_state_test.go b/dot/network/mock_block_state_test.go index ff3a593f7a..613d6b2fb6 100644 --- a/dot/network/mock_block_state_test.go +++ b/dot/network/mock_block_state_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: BlockState) - +// +// Generated by this command: +// +// mockgen -destination=mock_block_state_test.go -package network . BlockState +// // Package network is a generated GoMock package. package network @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. diff --git a/dot/network/mock_stream_test.go b/dot/network/mock_stream_test.go index f2029ceb8a..cf6d71bef0 100644 --- a/dot/network/mock_stream_test.go +++ b/dot/network/mock_stream_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/libp2p/go-libp2p/core/network (interfaces: Stream) - +// +// Generated by this command: +// +// mockgen -destination=mock_stream_test.go -package network github.com/libp2p/go-libp2p/core/network Stream +// // Package network is a generated GoMock package. package network @@ -8,9 +12,9 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" network "github.com/libp2p/go-libp2p/core/network" protocol "github.com/libp2p/go-libp2p/core/protocol" + gomock "go.uber.org/mock/gomock" ) // MockStream is a mock of Stream interface. @@ -130,7 +134,7 @@ func (m *MockStream) Read(arg0 []byte) (int, error) { } // Read indicates an expected call of Read. -func (mr *MockStreamMockRecorder) Read(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) Read(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockStream)(nil).Read), arg0) } @@ -172,7 +176,7 @@ func (m *MockStream) SetDeadline(arg0 time.Time) error { } // SetDeadline indicates an expected call of SetDeadline. -func (mr *MockStreamMockRecorder) SetDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) SetDeadline(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockStream)(nil).SetDeadline), arg0) } @@ -186,7 +190,7 @@ func (m *MockStream) SetProtocol(arg0 protocol.ID) error { } // SetProtocol indicates an expected call of SetProtocol. -func (mr *MockStreamMockRecorder) SetProtocol(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) SetProtocol(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetProtocol", reflect.TypeOf((*MockStream)(nil).SetProtocol), arg0) } @@ -200,7 +204,7 @@ func (m *MockStream) SetReadDeadline(arg0 time.Time) error { } // SetReadDeadline indicates an expected call of SetReadDeadline. -func (mr *MockStreamMockRecorder) SetReadDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) SetReadDeadline(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockStream)(nil).SetReadDeadline), arg0) } @@ -214,7 +218,7 @@ func (m *MockStream) SetWriteDeadline(arg0 time.Time) error { } // SetWriteDeadline indicates an expected call of SetWriteDeadline. -func (mr *MockStreamMockRecorder) SetWriteDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) SetWriteDeadline(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockStream)(nil).SetWriteDeadline), arg0) } @@ -243,7 +247,7 @@ func (m *MockStream) Write(arg0 []byte) (int, error) { } // Write indicates an expected call of Write. -func (mr *MockStreamMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockStreamMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockStream)(nil).Write), arg0) } diff --git a/dot/network/mock_syncer_test.go b/dot/network/mock_syncer_test.go index 74a08fc2f2..7b509d2199 100644 --- a/dot/network/mock_syncer_test.go +++ b/dot/network/mock_syncer_test.go @@ -1,14 +1,18 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: Syncer) - +// +// Generated by this command: +// +// mockgen -destination=mock_syncer_test.go -package network . Syncer +// // Package network is a generated GoMock package. package network import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockSyncer is a mock of Syncer interface. @@ -44,7 +48,7 @@ func (m *MockSyncer) CreateBlockResponse(arg0 *BlockRequestMessage) (*BlockRespo } // CreateBlockResponse indicates an expected call of CreateBlockResponse. -func (mr *MockSyncerMockRecorder) CreateBlockResponse(arg0 interface{}) *gomock.Call { +func (mr *MockSyncerMockRecorder) CreateBlockResponse(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBlockResponse", reflect.TypeOf((*MockSyncer)(nil).CreateBlockResponse), arg0) } @@ -58,7 +62,7 @@ func (m *MockSyncer) HandleBlockAnnounce(arg0 peer.ID, arg1 *BlockAnnounceMessag } // HandleBlockAnnounce indicates an expected call of HandleBlockAnnounce. -func (mr *MockSyncerMockRecorder) HandleBlockAnnounce(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSyncerMockRecorder) HandleBlockAnnounce(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockAnnounce", reflect.TypeOf((*MockSyncer)(nil).HandleBlockAnnounce), arg0, arg1) } @@ -72,7 +76,7 @@ func (m *MockSyncer) HandleBlockAnnounceHandshake(arg0 peer.ID, arg1 *BlockAnnou } // HandleBlockAnnounceHandshake indicates an expected call of HandleBlockAnnounceHandshake. -func (mr *MockSyncerMockRecorder) HandleBlockAnnounceHandshake(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockSyncerMockRecorder) HandleBlockAnnounceHandshake(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockAnnounceHandshake", reflect.TypeOf((*MockSyncer)(nil).HandleBlockAnnounceHandshake), arg0, arg1) } diff --git a/dot/network/mock_telemetry_test.go b/dot/network/mock_telemetry_test.go index eb931de62d..8bd1a45a80 100644 --- a/dot/network/mock_telemetry_test.go +++ b/dot/network/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package network . Telemetry +// // Package network is a generated GoMock package. package network @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/dot/network/mock_transaction_handler_test.go b/dot/network/mock_transaction_handler_test.go index 081caa815f..8d0ea7e7a8 100644 --- a/dot/network/mock_transaction_handler_test.go +++ b/dot/network/mock_transaction_handler_test.go @@ -1,14 +1,18 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: TransactionHandler) - +// +// Generated by this command: +// +// mockgen -destination=mock_transaction_handler_test.go -package network . TransactionHandler +// // Package network is a generated GoMock package. package network import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockTransactionHandler is a mock of TransactionHandler interface. @@ -44,7 +48,7 @@ func (m *MockTransactionHandler) HandleTransactionMessage(arg0 peer.ID, arg1 *Tr } // HandleTransactionMessage indicates an expected call of HandleTransactionMessage. -func (mr *MockTransactionHandlerMockRecorder) HandleTransactionMessage(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockTransactionHandlerMockRecorder) HandleTransactionMessage(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleTransactionMessage", reflect.TypeOf((*MockTransactionHandler)(nil).HandleTransactionMessage), arg0, arg1) } diff --git a/dot/network/service_integration_test.go b/dot/network/service_integration_test.go index ee7dc844c6..8ac3abc413 100644 --- a/dot/network/service_integration_test.go +++ b/dot/network/service_integration_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ChainSafe/gossamer/dot/types" ) diff --git a/dot/network/transaction_integration_test.go b/dot/network/transaction_integration_test.go index 742ea6628c..fde3c9c83b 100644 --- a/dot/network/transaction_integration_test.go +++ b/dot/network/transaction_integration_test.go @@ -10,9 +10,9 @@ import ( "time" "github.com/ChainSafe/gossamer/dot/types" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestDecodeTransactionHandshake(t *testing.T) { diff --git a/dot/network/utils_test.go b/dot/network/utils_test.go index 50a4541d96..cf702cd996 100644 --- a/dot/network/utils_test.go +++ b/dot/network/utils_test.go @@ -7,9 +7,9 @@ import ( "bytes" "testing" - "github.com/golang/mock/gomock" libp2pnetwork "github.com/libp2p/go-libp2p/core/network" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const portsAmount = 200 diff --git a/dot/node_integration_test.go b/dot/node_integration_test.go index a8eedf2782..ce0a2d999c 100644 --- a/dot/node_integration_test.go +++ b/dot/node_integration_test.go @@ -36,9 +36,9 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" "github.com/ChainSafe/gossamer/lib/trie" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + gomock "go.uber.org/mock/gomock" ) func TestNewNode(t *testing.T) { diff --git a/dot/node_test.go b/dot/node_test.go index c0f11d4715..5e227151df 100644 --- a/dot/node_test.go +++ b/dot/node_test.go @@ -22,9 +22,9 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/lib/services" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func DefaultTestWestendDevConfig(t *testing.T) *cfg.Config { diff --git a/dot/rpc/http_test.go b/dot/rpc/http_test.go index d4b2e37225..8decb021c7 100644 --- a/dot/rpc/http_test.go +++ b/dot/rpc/http_test.go @@ -29,8 +29,8 @@ import ( "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/lib/runtime" "github.com/btcsuite/btcutil/base58" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestRegisterModules(t *testing.T) { diff --git a/dot/rpc/mock_digesthandler_test.go b/dot/rpc/mock_digesthandler_test.go index 947c0257f8..522b543c5d 100644 --- a/dot/rpc/mock_digesthandler_test.go +++ b/dot/rpc/mock_digesthandler_test.go @@ -8,7 +8,7 @@ import ( reflect "reflect" types "github.com/ChainSafe/gossamer/dot/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDigestHandler is a mock of DigestHandler interface. diff --git a/dot/rpc/mock_network_test.go b/dot/rpc/mock_network_test.go index d235b78dc4..419285e28d 100644 --- a/dot/rpc/mock_network_test.go +++ b/dot/rpc/mock_network_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/core (interfaces: Network) - +// +// Generated by this command: +// +// mockgen -destination=mock_network_test.go -package rpc github.com/ChainSafe/gossamer/dot/core Network +// // Package rpc is a generated GoMock package. package rpc @@ -9,8 +13,8 @@ import ( network "github.com/ChainSafe/gossamer/dot/network" peerset "github.com/ChainSafe/gossamer/dot/peerset" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockNetwork is a mock of Network interface. @@ -43,7 +47,7 @@ func (m *MockNetwork) GossipMessage(arg0 network.NotificationsMessage) { } // GossipMessage indicates an expected call of GossipMessage. -func (mr *MockNetworkMockRecorder) GossipMessage(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) GossipMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GossipMessage", reflect.TypeOf((*MockNetwork)(nil).GossipMessage), arg0) } @@ -69,7 +73,7 @@ func (m *MockNetwork) ReportPeer(arg0 peerset.ReputationChange, arg1 peer.ID) { } // ReportPeer indicates an expected call of ReportPeer. -func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeer", reflect.TypeOf((*MockNetwork)(nil).ReportPeer), arg0, arg1) } diff --git a/dot/rpc/mock_telemetry_test.go b/dot/rpc/mock_telemetry_test.go index f67c0823e5..578e925c7b 100644 --- a/dot/rpc/mock_telemetry_test.go +++ b/dot/rpc/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package rpc . Telemetry +// // Package rpc is a generated GoMock package. package rpc @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/dot/rpc/mocks_test.go b/dot/rpc/mocks_test.go index 8e9bd4bf1d..b322e5cfd4 100644 --- a/dot/rpc/mocks_test.go +++ b/dot/rpc/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc (interfaces: API,TransactionStateAPI) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=rpc . API,TransactionStateAPI +// // Package rpc is a generated GoMock package. package rpc @@ -10,7 +14,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAPI is a mock of API interface. @@ -37,13 +41,13 @@ func (m *MockAPI) EXPECT() *MockAPIMockRecorder { } // BuildMethodNames mocks base method. -func (m *MockAPI) BuildMethodNames(arg0 interface{}, arg1 string) { +func (m *MockAPI) BuildMethodNames(arg0 any, arg1 string) { m.ctrl.T.Helper() m.ctrl.Call(m, "BuildMethodNames", arg0, arg1) } // BuildMethodNames indicates an expected call of BuildMethodNames. -func (mr *MockAPIMockRecorder) BuildMethodNames(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockAPIMockRecorder) BuildMethodNames(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildMethodNames", reflect.TypeOf((*MockAPI)(nil).BuildMethodNames), arg0, arg1) } @@ -94,7 +98,7 @@ func (m *MockTransactionStateAPI) AddToPool(arg0 *transaction.ValidTransaction) } // AddToPool indicates an expected call of AddToPool. -func (mr *MockTransactionStateAPIMockRecorder) AddToPool(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateAPIMockRecorder) AddToPool(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddToPool", reflect.TypeOf((*MockTransactionStateAPI)(nil).AddToPool), arg0) } @@ -106,7 +110,7 @@ func (m *MockTransactionStateAPI) FreeStatusNotifierChannel(arg0 chan transactio } // FreeStatusNotifierChannel indicates an expected call of FreeStatusNotifierChannel. -func (mr *MockTransactionStateAPIMockRecorder) FreeStatusNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateAPIMockRecorder) FreeStatusNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeStatusNotifierChannel", reflect.TypeOf((*MockTransactionStateAPI)(nil).FreeStatusNotifierChannel), arg0) } @@ -120,7 +124,7 @@ func (m *MockTransactionStateAPI) GetStatusNotifierChannel(arg0 types.Extrinsic) } // GetStatusNotifierChannel indicates an expected call of GetStatusNotifierChannel. -func (mr *MockTransactionStateAPIMockRecorder) GetStatusNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateAPIMockRecorder) GetStatusNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatusNotifierChannel", reflect.TypeOf((*MockTransactionStateAPI)(nil).GetStatusNotifierChannel), arg0) } diff --git a/dot/rpc/modules/api_mocks.go b/dot/rpc/modules/api_mocks.go index 38516bf219..aa765f193c 100644 --- a/dot/rpc/modules/api_mocks.go +++ b/dot/rpc/modules/api_mocks.go @@ -8,7 +8,7 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) // NewMockAnyStorageAPI creates and return an rpc StorageAPI interface mock diff --git a/dot/rpc/modules/author_integration_test.go b/dot/rpc/modules/author_integration_test.go index 9501e4288d..33bd4e1c42 100644 --- a/dot/rpc/modules/author_integration_test.go +++ b/dot/rpc/modules/author_integration_test.go @@ -38,9 +38,9 @@ import ( ctypes "github.com/centrifuge/go-substrate-rpc-client/v4/types" "github.com/centrifuge/go-substrate-rpc-client/v4/types/codec" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) type useRuntimeInstance func(*testing.T, *storage.TrieState) runtime.Instance diff --git a/dot/rpc/modules/author_test.go b/dot/rpc/modules/author_test.go index 8abf606b95..5cf104f06b 100644 --- a/dot/rpc/modules/author_test.go +++ b/dot/rpc/modules/author_test.go @@ -18,7 +18,7 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/dot/rpc/modules/chain_integration_test.go b/dot/rpc/modules/chain_integration_test.go index 50ffe41113..de51c20c52 100644 --- a/dot/rpc/modules/chain_integration_test.go +++ b/dot/rpc/modules/chain_integration_test.go @@ -18,7 +18,7 @@ import ( wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/stretchr/testify/require" diff --git a/dot/rpc/modules/chain_test.go b/dot/rpc/modules/chain_test.go index 61a20b7c1c..e09a0ad880 100644 --- a/dot/rpc/modules/chain_test.go +++ b/dot/rpc/modules/chain_test.go @@ -11,7 +11,7 @@ import ( "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/dot/rpc/modules/childstate_test.go b/dot/rpc/modules/childstate_test.go index 9fe353fe49..e56b776b3b 100644 --- a/dot/rpc/modules/childstate_test.go +++ b/dot/rpc/modules/childstate_test.go @@ -12,7 +12,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/dot/rpc/modules/dev_integration_test.go b/dot/rpc/modules/dev_integration_test.go index c779dbca5b..8ea64c66ee 100644 --- a/dot/rpc/modules/dev_integration_test.go +++ b/dot/rpc/modules/dev_integration_test.go @@ -18,8 +18,8 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var genesisBABEConfig = &types.BabeConfiguration{ diff --git a/dot/rpc/modules/dev_test.go b/dot/rpc/modules/dev_test.go index cca1eca4b5..f9b601a6ac 100644 --- a/dot/rpc/modules/dev_test.go +++ b/dot/rpc/modules/dev_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/dot/rpc/modules/grandpa_integration_test.go b/dot/rpc/modules/grandpa_integration_test.go index 04e91b6137..2fa375a314 100644 --- a/dot/rpc/modules/grandpa_integration_test.go +++ b/dot/rpc/modules/grandpa_integration_test.go @@ -13,9 +13,9 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/grandpa" "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" rpcmocks "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" ) diff --git a/dot/rpc/modules/grandpa_test.go b/dot/rpc/modules/grandpa_test.go index f9a0223f3d..67f32775f8 100644 --- a/dot/rpc/modules/grandpa_test.go +++ b/dot/rpc/modules/grandpa_test.go @@ -14,8 +14,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/grandpa" "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestGrandpaModule_ProveFinality(t *testing.T) { diff --git a/dot/rpc/modules/mock_block_state_test.go b/dot/rpc/modules/mock_block_state_test.go index da57bb1a1d..c58b596346 100644 --- a/dot/rpc/modules/mock_block_state_test.go +++ b/dot/rpc/modules/mock_block_state_test.go @@ -9,7 +9,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. diff --git a/dot/rpc/modules/mock_code_substituted_state_test.go b/dot/rpc/modules/mock_code_substituted_state_test.go index e89fac050d..5a50692a0c 100644 --- a/dot/rpc/modules/mock_code_substituted_state_test.go +++ b/dot/rpc/modules/mock_code_substituted_state_test.go @@ -8,7 +8,7 @@ import ( reflect "reflect" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockCodeSubstitutedState is a mock of CodeSubstitutedState interface. diff --git a/dot/rpc/modules/mock_digest_handler_test.go b/dot/rpc/modules/mock_digest_handler_test.go index d5472b0529..d611a9a6ab 100644 --- a/dot/rpc/modules/mock_digest_handler_test.go +++ b/dot/rpc/modules/mock_digest_handler_test.go @@ -8,7 +8,7 @@ import ( reflect "reflect" types "github.com/ChainSafe/gossamer/dot/types" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDigestHandler is a mock of DigestHandler interface. diff --git a/dot/rpc/modules/mock_network_test.go b/dot/rpc/modules/mock_network_test.go index bd6a1e12be..e0988f0003 100644 --- a/dot/rpc/modules/mock_network_test.go +++ b/dot/rpc/modules/mock_network_test.go @@ -9,7 +9,7 @@ import ( network "github.com/ChainSafe/gossamer/dot/network" peerset "github.com/ChainSafe/gossamer/dot/peerset" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" ) diff --git a/dot/rpc/modules/mock_sync_api_test.go b/dot/rpc/modules/mock_sync_api_test.go index bda36425c5..7982c46da1 100644 --- a/dot/rpc/modules/mock_sync_api_test.go +++ b/dot/rpc/modules/mock_sync_api_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc/modules (interfaces: SyncAPI) - +// +// Generated by this command: +// +// mockgen -destination=mock_sync_api_test.go -package modules . SyncAPI +// // Package modules is a generated GoMock package. package modules import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockSyncAPI is a mock of SyncAPI interface. diff --git a/dot/rpc/modules/mock_syncer_test.go b/dot/rpc/modules/mock_syncer_test.go index 77ea5c6121..922c6e8fbe 100644 --- a/dot/rpc/modules/mock_syncer_test.go +++ b/dot/rpc/modules/mock_syncer_test.go @@ -8,7 +8,7 @@ import ( reflect "reflect" network "github.com/ChainSafe/gossamer/dot/network" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" ) diff --git a/dot/rpc/modules/mock_transaction_handler_test.go b/dot/rpc/modules/mock_transaction_handler_test.go index 0cc14978c2..c17ea56e30 100644 --- a/dot/rpc/modules/mock_transaction_handler_test.go +++ b/dot/rpc/modules/mock_transaction_handler_test.go @@ -8,7 +8,7 @@ import ( reflect "reflect" network "github.com/ChainSafe/gossamer/dot/network" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" ) diff --git a/dot/rpc/modules/mocks/mocks.go b/dot/rpc/modules/mocks/mocks.go index 6d8444fac6..fb3389e4fe 100644 --- a/dot/rpc/modules/mocks/mocks.go +++ b/dot/rpc/modules/mocks/mocks.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc/modules (interfaces: StorageAPI,BlockAPI,NetworkAPI,BlockProducerAPI,TransactionStateAPI,CoreAPI,SystemAPI,BlockFinalityAPI,RuntimeStorageAPI,SyncStateAPI) - +// +// Generated by this command: +// +// mockgen -destination=mocks/mocks.go -package mocks . StorageAPI,BlockAPI,NetworkAPI,BlockProducerAPI,TransactionStateAPI,CoreAPI,SystemAPI,BlockFinalityAPI,RuntimeStorageAPI,SyncStateAPI +// // Package mocks is a generated GoMock package. package mocks @@ -16,7 +20,7 @@ import ( runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" trie "github.com/ChainSafe/gossamer/lib/trie" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStorageAPI is a mock of StorageAPI interface. @@ -52,7 +56,7 @@ func (m *MockStorageAPI) Entries(arg0 *common.Hash) (map[string][]byte, error) { } // Entries indicates an expected call of Entries. -func (mr *MockStorageAPIMockRecorder) Entries(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) Entries(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Entries", reflect.TypeOf((*MockStorageAPI)(nil).Entries), arg0) } @@ -67,7 +71,7 @@ func (m *MockStorageAPI) GetKeysWithPrefix(arg0 *common.Hash, arg1 []byte) ([][] } // GetKeysWithPrefix indicates an expected call of GetKeysWithPrefix. -func (mr *MockStorageAPIMockRecorder) GetKeysWithPrefix(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetKeysWithPrefix(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKeysWithPrefix", reflect.TypeOf((*MockStorageAPI)(nil).GetKeysWithPrefix), arg0, arg1) } @@ -82,7 +86,7 @@ func (m *MockStorageAPI) GetStateRootFromBlock(arg0 *common.Hash) (*common.Hash, } // GetStateRootFromBlock indicates an expected call of GetStateRootFromBlock. -func (mr *MockStorageAPIMockRecorder) GetStateRootFromBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStateRootFromBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateRootFromBlock", reflect.TypeOf((*MockStorageAPI)(nil).GetStateRootFromBlock), arg0) } @@ -97,7 +101,7 @@ func (m *MockStorageAPI) GetStorage(arg0 *common.Hash, arg1 []byte) ([]byte, err } // GetStorage indicates an expected call of GetStorage. -func (mr *MockStorageAPIMockRecorder) GetStorage(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorage(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorage", reflect.TypeOf((*MockStorageAPI)(nil).GetStorage), arg0, arg1) } @@ -112,7 +116,7 @@ func (m *MockStorageAPI) GetStorageByBlockHash(arg0 *common.Hash, arg1 []byte) ( } // GetStorageByBlockHash indicates an expected call of GetStorageByBlockHash. -func (mr *MockStorageAPIMockRecorder) GetStorageByBlockHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageByBlockHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageByBlockHash", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageByBlockHash), arg0, arg1) } @@ -127,7 +131,7 @@ func (m *MockStorageAPI) GetStorageChild(arg0 *common.Hash, arg1 []byte) (*trie. } // GetStorageChild indicates an expected call of GetStorageChild. -func (mr *MockStorageAPIMockRecorder) GetStorageChild(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageChild(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageChild", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageChild), arg0, arg1) } @@ -142,7 +146,7 @@ func (m *MockStorageAPI) GetStorageFromChild(arg0 *common.Hash, arg1, arg2 []byt } // GetStorageFromChild indicates an expected call of GetStorageFromChild. -func (mr *MockStorageAPIMockRecorder) GetStorageFromChild(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageFromChild(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageFromChild", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageFromChild), arg0, arg1, arg2) } @@ -154,7 +158,7 @@ func (m *MockStorageAPI) RegisterStorageObserver(arg0 state.Observer) { } // RegisterStorageObserver indicates an expected call of RegisterStorageObserver. -func (mr *MockStorageAPIMockRecorder) RegisterStorageObserver(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) RegisterStorageObserver(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageObserver", reflect.TypeOf((*MockStorageAPI)(nil).RegisterStorageObserver), arg0) } @@ -166,7 +170,7 @@ func (m *MockStorageAPI) UnregisterStorageObserver(arg0 state.Observer) { } // UnregisterStorageObserver indicates an expected call of UnregisterStorageObserver. -func (mr *MockStorageAPIMockRecorder) UnregisterStorageObserver(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) UnregisterStorageObserver(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageObserver", reflect.TypeOf((*MockStorageAPI)(nil).UnregisterStorageObserver), arg0) } @@ -215,7 +219,7 @@ func (m *MockBlockAPI) FreeFinalisedNotifierChannel(arg0 chan *types.Finalisatio } // FreeFinalisedNotifierChannel indicates an expected call of FreeFinalisedNotifierChannel. -func (mr *MockBlockAPIMockRecorder) FreeFinalisedNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) FreeFinalisedNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeFinalisedNotifierChannel", reflect.TypeOf((*MockBlockAPI)(nil).FreeFinalisedNotifierChannel), arg0) } @@ -227,7 +231,7 @@ func (m *MockBlockAPI) FreeImportedBlockNotifierChannel(arg0 chan *types.Block) } // FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. -func (mr *MockBlockAPIMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) FreeImportedBlockNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockAPI)(nil).FreeImportedBlockNotifierChannel), arg0) } @@ -242,7 +246,7 @@ func (m *MockBlockAPI) GetBlockByHash(arg0 common.Hash) (*types.Block, error) { } // GetBlockByHash indicates an expected call of GetBlockByHash. -func (mr *MockBlockAPIMockRecorder) GetBlockByHash(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetBlockByHash(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockByHash", reflect.TypeOf((*MockBlockAPI)(nil).GetBlockByHash), arg0) } @@ -257,7 +261,7 @@ func (m *MockBlockAPI) GetFinalisedHash(arg0, arg1 uint64) (common.Hash, error) } // GetFinalisedHash indicates an expected call of GetFinalisedHash. -func (mr *MockBlockAPIMockRecorder) GetFinalisedHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetFinalisedHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedHash", reflect.TypeOf((*MockBlockAPI)(nil).GetFinalisedHash), arg0, arg1) } @@ -286,7 +290,7 @@ func (m *MockBlockAPI) GetHashByNumber(arg0 uint) (common.Hash, error) { } // GetHashByNumber indicates an expected call of GetHashByNumber. -func (mr *MockBlockAPIMockRecorder) GetHashByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetHashByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHashByNumber", reflect.TypeOf((*MockBlockAPI)(nil).GetHashByNumber), arg0) } @@ -301,7 +305,7 @@ func (m *MockBlockAPI) GetHeader(arg0 common.Hash) (*types.Header, error) { } // GetHeader indicates an expected call of GetHeader. -func (mr *MockBlockAPIMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockAPI)(nil).GetHeader), arg0) } @@ -345,7 +349,7 @@ func (m *MockBlockAPI) GetJustification(arg0 common.Hash) ([]byte, error) { } // GetJustification indicates an expected call of GetJustification. -func (mr *MockBlockAPIMockRecorder) GetJustification(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetJustification(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJustification", reflect.TypeOf((*MockBlockAPI)(nil).GetJustification), arg0) } @@ -360,7 +364,7 @@ func (m *MockBlockAPI) GetRuntime(arg0 common.Hash) (runtime.Instance, error) { } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockAPIMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockAPI)(nil).GetRuntime), arg0) } @@ -375,7 +379,7 @@ func (m *MockBlockAPI) HasJustification(arg0 common.Hash) (bool, error) { } // HasJustification indicates an expected call of HasJustification. -func (mr *MockBlockAPIMockRecorder) HasJustification(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) HasJustification(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasJustification", reflect.TypeOf((*MockBlockAPI)(nil).HasJustification), arg0) } @@ -390,7 +394,7 @@ func (m *MockBlockAPI) RangeInMemory(arg0, arg1 common.Hash) ([]common.Hash, err } // RangeInMemory indicates an expected call of RangeInMemory. -func (mr *MockBlockAPIMockRecorder) RangeInMemory(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) RangeInMemory(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockAPI)(nil).RangeInMemory), arg0, arg1) } @@ -405,7 +409,7 @@ func (m *MockBlockAPI) RegisterRuntimeUpdatedChannel(arg0 chan<- runtime.Version } // RegisterRuntimeUpdatedChannel indicates an expected call of RegisterRuntimeUpdatedChannel. -func (mr *MockBlockAPIMockRecorder) RegisterRuntimeUpdatedChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) RegisterRuntimeUpdatedChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRuntimeUpdatedChannel", reflect.TypeOf((*MockBlockAPI)(nil).RegisterRuntimeUpdatedChannel), arg0) } @@ -419,7 +423,7 @@ func (m *MockBlockAPI) UnregisterRuntimeUpdatedChannel(arg0 uint32) bool { } // UnregisterRuntimeUpdatedChannel indicates an expected call of UnregisterRuntimeUpdatedChannel. -func (mr *MockBlockAPIMockRecorder) UnregisterRuntimeUpdatedChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) UnregisterRuntimeUpdatedChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterRuntimeUpdatedChannel", reflect.TypeOf((*MockBlockAPI)(nil).UnregisterRuntimeUpdatedChannel), arg0) } @@ -450,7 +454,7 @@ func (m *MockNetworkAPI) EXPECT() *MockNetworkAPIMockRecorder { // AddReservedPeers mocks base method. func (m *MockNetworkAPI) AddReservedPeers(arg0 ...string) error { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -460,7 +464,7 @@ func (m *MockNetworkAPI) AddReservedPeers(arg0 ...string) error { } // AddReservedPeers indicates an expected call of AddReservedPeers. -func (mr *MockNetworkAPIMockRecorder) AddReservedPeers(arg0 ...interface{}) *gomock.Call { +func (mr *MockNetworkAPIMockRecorder) AddReservedPeers(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddReservedPeers", reflect.TypeOf((*MockNetworkAPI)(nil).AddReservedPeers), arg0...) } @@ -524,7 +528,7 @@ func (mr *MockNetworkAPIMockRecorder) Peers() *gomock.Call { // RemoveReservedPeers mocks base method. func (m *MockNetworkAPI) RemoveReservedPeers(arg0 ...string) error { m.ctrl.T.Helper() - varargs := []interface{}{} + varargs := []any{} for _, a := range arg0 { varargs = append(varargs, a) } @@ -534,7 +538,7 @@ func (m *MockNetworkAPI) RemoveReservedPeers(arg0 ...string) error { } // RemoveReservedPeers indicates an expected call of RemoveReservedPeers. -func (mr *MockNetworkAPIMockRecorder) RemoveReservedPeers(arg0 ...interface{}) *gomock.Call { +func (mr *MockNetworkAPIMockRecorder) RemoveReservedPeers(arg0 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveReservedPeers", reflect.TypeOf((*MockNetworkAPI)(nil).RemoveReservedPeers), arg0...) } @@ -730,7 +734,7 @@ func (m *MockCoreAPI) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockCoreAPIMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockCoreAPI)(nil).DecodeSessionKeys), arg0) } @@ -745,7 +749,7 @@ func (m *MockCoreAPI) GetMetadata(arg0 *common.Hash) ([]byte, error) { } // GetMetadata indicates an expected call of GetMetadata. -func (mr *MockCoreAPIMockRecorder) GetMetadata(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) GetMetadata(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetadata", reflect.TypeOf((*MockCoreAPI)(nil).GetMetadata), arg0) } @@ -761,7 +765,7 @@ func (m *MockCoreAPI) GetReadProofAt(arg0 common.Hash, arg1 [][]byte) (common.Ha } // GetReadProofAt indicates an expected call of GetReadProofAt. -func (mr *MockCoreAPIMockRecorder) GetReadProofAt(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) GetReadProofAt(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadProofAt", reflect.TypeOf((*MockCoreAPI)(nil).GetReadProofAt), arg0, arg1) } @@ -776,7 +780,7 @@ func (m *MockCoreAPI) GetRuntimeVersion(arg0 *common.Hash) (runtime.Version, err } // GetRuntimeVersion indicates an expected call of GetRuntimeVersion. -func (mr *MockCoreAPIMockRecorder) GetRuntimeVersion(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) GetRuntimeVersion(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntimeVersion", reflect.TypeOf((*MockCoreAPI)(nil).GetRuntimeVersion), arg0) } @@ -790,7 +794,7 @@ func (m *MockCoreAPI) HandleSubmittedExtrinsic(arg0 types.Extrinsic) error { } // HandleSubmittedExtrinsic indicates an expected call of HandleSubmittedExtrinsic. -func (mr *MockCoreAPIMockRecorder) HandleSubmittedExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) HandleSubmittedExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleSubmittedExtrinsic", reflect.TypeOf((*MockCoreAPI)(nil).HandleSubmittedExtrinsic), arg0) } @@ -805,7 +809,7 @@ func (m *MockCoreAPI) HasKey(arg0, arg1 string) (bool, error) { } // HasKey indicates an expected call of HasKey. -func (mr *MockCoreAPIMockRecorder) HasKey(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) HasKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasKey", reflect.TypeOf((*MockCoreAPI)(nil).HasKey), arg0, arg1) } @@ -819,7 +823,7 @@ func (m *MockCoreAPI) InsertKey(arg0 core.KeyPair, arg1 string) error { } // InsertKey indicates an expected call of InsertKey. -func (mr *MockCoreAPIMockRecorder) InsertKey(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockCoreAPIMockRecorder) InsertKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertKey", reflect.TypeOf((*MockCoreAPI)(nil).InsertKey), arg0, arg1) } @@ -876,10 +880,10 @@ func (mr *MockSystemAPIMockRecorder) ChainType() *gomock.Call { } // Properties mocks base method. -func (m *MockSystemAPI) Properties() map[string]interface{} { +func (m *MockSystemAPI) Properties() map[string]any { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Properties") - ret0, _ := ret[0].(map[string]interface{}) + ret0, _ := ret[0].(map[string]any) return ret0 } @@ -1043,7 +1047,7 @@ func (m *MockRuntimeStorageAPI) GetLocal(arg0 []byte) ([]byte, error) { } // GetLocal indicates an expected call of GetLocal. -func (mr *MockRuntimeStorageAPIMockRecorder) GetLocal(arg0 interface{}) *gomock.Call { +func (mr *MockRuntimeStorageAPIMockRecorder) GetLocal(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLocal", reflect.TypeOf((*MockRuntimeStorageAPI)(nil).GetLocal), arg0) } @@ -1058,7 +1062,7 @@ func (m *MockRuntimeStorageAPI) GetPersistent(arg0 []byte) ([]byte, error) { } // GetPersistent indicates an expected call of GetPersistent. -func (mr *MockRuntimeStorageAPIMockRecorder) GetPersistent(arg0 interface{}) *gomock.Call { +func (mr *MockRuntimeStorageAPIMockRecorder) GetPersistent(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPersistent", reflect.TypeOf((*MockRuntimeStorageAPI)(nil).GetPersistent), arg0) } @@ -1072,7 +1076,7 @@ func (m *MockRuntimeStorageAPI) SetLocal(arg0, arg1 []byte) error { } // SetLocal indicates an expected call of SetLocal. -func (mr *MockRuntimeStorageAPIMockRecorder) SetLocal(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRuntimeStorageAPIMockRecorder) SetLocal(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLocal", reflect.TypeOf((*MockRuntimeStorageAPI)(nil).SetLocal), arg0, arg1) } @@ -1086,7 +1090,7 @@ func (m *MockRuntimeStorageAPI) SetPersistent(arg0, arg1 []byte) error { } // SetPersistent indicates an expected call of SetPersistent. -func (mr *MockRuntimeStorageAPIMockRecorder) SetPersistent(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockRuntimeStorageAPIMockRecorder) SetPersistent(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPersistent", reflect.TypeOf((*MockRuntimeStorageAPI)(nil).SetPersistent), arg0, arg1) } @@ -1124,7 +1128,7 @@ func (m *MockSyncStateAPI) GenSyncSpec(arg0 bool) (*genesis.Genesis, error) { } // GenSyncSpec indicates an expected call of GenSyncSpec. -func (mr *MockSyncStateAPIMockRecorder) GenSyncSpec(arg0 interface{}) *gomock.Call { +func (mr *MockSyncStateAPIMockRecorder) GenSyncSpec(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenSyncSpec", reflect.TypeOf((*MockSyncStateAPI)(nil).GenSyncSpec), arg0) } diff --git a/dot/rpc/modules/mocks_babe_test.go b/dot/rpc/modules/mocks_babe_test.go index e9f0d47fee..9d77fd957f 100644 --- a/dot/rpc/modules/mocks_babe_test.go +++ b/dot/rpc/modules/mocks_babe_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/babe (interfaces: BlockImportHandler) - +// +// Generated by this command: +// +// mockgen -destination=mocks_babe_test.go -package modules github.com/ChainSafe/gossamer/lib/babe BlockImportHandler +// // Package modules is a generated GoMock package. package modules @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" storage "github.com/ChainSafe/gossamer/lib/runtime/storage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBlockImportHandler is a mock of BlockImportHandler interface. @@ -44,7 +48,7 @@ func (m *MockBlockImportHandler) HandleBlockProduced(arg0 *types.Block, arg1 *st } // HandleBlockProduced indicates an expected call of HandleBlockProduced. -func (mr *MockBlockImportHandlerMockRecorder) HandleBlockProduced(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockImportHandlerMockRecorder) HandleBlockProduced(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockProduced", reflect.TypeOf((*MockBlockImportHandler)(nil).HandleBlockProduced), arg0, arg1) } diff --git a/dot/rpc/modules/mocks_test.go b/dot/rpc/modules/mocks_test.go index e0cdb9bf9b..85012b8703 100644 --- a/dot/rpc/modules/mocks_test.go +++ b/dot/rpc/modules/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc/modules (interfaces: StorageAPI,BlockAPI,Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=modules . StorageAPI,BlockAPI,Telemetry +// // Package modules is a generated GoMock package. package modules @@ -13,7 +17,7 @@ import ( common "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime" trie "github.com/ChainSafe/gossamer/lib/trie" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockStorageAPI is a mock of StorageAPI interface. @@ -49,7 +53,7 @@ func (m *MockStorageAPI) Entries(arg0 *common.Hash) (map[string][]byte, error) { } // Entries indicates an expected call of Entries. -func (mr *MockStorageAPIMockRecorder) Entries(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) Entries(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Entries", reflect.TypeOf((*MockStorageAPI)(nil).Entries), arg0) } @@ -64,7 +68,7 @@ func (m *MockStorageAPI) GetKeysWithPrefix(arg0 *common.Hash, arg1 []byte) ([][] } // GetKeysWithPrefix indicates an expected call of GetKeysWithPrefix. -func (mr *MockStorageAPIMockRecorder) GetKeysWithPrefix(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetKeysWithPrefix(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKeysWithPrefix", reflect.TypeOf((*MockStorageAPI)(nil).GetKeysWithPrefix), arg0, arg1) } @@ -79,7 +83,7 @@ func (m *MockStorageAPI) GetStateRootFromBlock(arg0 *common.Hash) (*common.Hash, } // GetStateRootFromBlock indicates an expected call of GetStateRootFromBlock. -func (mr *MockStorageAPIMockRecorder) GetStateRootFromBlock(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStateRootFromBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateRootFromBlock", reflect.TypeOf((*MockStorageAPI)(nil).GetStateRootFromBlock), arg0) } @@ -94,7 +98,7 @@ func (m *MockStorageAPI) GetStorage(arg0 *common.Hash, arg1 []byte) ([]byte, err } // GetStorage indicates an expected call of GetStorage. -func (mr *MockStorageAPIMockRecorder) GetStorage(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorage(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorage", reflect.TypeOf((*MockStorageAPI)(nil).GetStorage), arg0, arg1) } @@ -109,7 +113,7 @@ func (m *MockStorageAPI) GetStorageByBlockHash(arg0 *common.Hash, arg1 []byte) ( } // GetStorageByBlockHash indicates an expected call of GetStorageByBlockHash. -func (mr *MockStorageAPIMockRecorder) GetStorageByBlockHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageByBlockHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageByBlockHash", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageByBlockHash), arg0, arg1) } @@ -124,7 +128,7 @@ func (m *MockStorageAPI) GetStorageChild(arg0 *common.Hash, arg1 []byte) (*trie. } // GetStorageChild indicates an expected call of GetStorageChild. -func (mr *MockStorageAPIMockRecorder) GetStorageChild(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageChild(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageChild", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageChild), arg0, arg1) } @@ -139,7 +143,7 @@ func (m *MockStorageAPI) GetStorageFromChild(arg0 *common.Hash, arg1, arg2 []byt } // GetStorageFromChild indicates an expected call of GetStorageFromChild. -func (mr *MockStorageAPIMockRecorder) GetStorageFromChild(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) GetStorageFromChild(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageFromChild", reflect.TypeOf((*MockStorageAPI)(nil).GetStorageFromChild), arg0, arg1, arg2) } @@ -151,7 +155,7 @@ func (m *MockStorageAPI) RegisterStorageObserver(arg0 state.Observer) { } // RegisterStorageObserver indicates an expected call of RegisterStorageObserver. -func (mr *MockStorageAPIMockRecorder) RegisterStorageObserver(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) RegisterStorageObserver(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStorageObserver", reflect.TypeOf((*MockStorageAPI)(nil).RegisterStorageObserver), arg0) } @@ -163,7 +167,7 @@ func (m *MockStorageAPI) UnregisterStorageObserver(arg0 state.Observer) { } // UnregisterStorageObserver indicates an expected call of UnregisterStorageObserver. -func (mr *MockStorageAPIMockRecorder) UnregisterStorageObserver(arg0 interface{}) *gomock.Call { +func (mr *MockStorageAPIMockRecorder) UnregisterStorageObserver(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStorageObserver", reflect.TypeOf((*MockStorageAPI)(nil).UnregisterStorageObserver), arg0) } @@ -212,7 +216,7 @@ func (m *MockBlockAPI) FreeFinalisedNotifierChannel(arg0 chan *types.Finalisatio } // FreeFinalisedNotifierChannel indicates an expected call of FreeFinalisedNotifierChannel. -func (mr *MockBlockAPIMockRecorder) FreeFinalisedNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) FreeFinalisedNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeFinalisedNotifierChannel", reflect.TypeOf((*MockBlockAPI)(nil).FreeFinalisedNotifierChannel), arg0) } @@ -224,7 +228,7 @@ func (m *MockBlockAPI) FreeImportedBlockNotifierChannel(arg0 chan *types.Block) } // FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. -func (mr *MockBlockAPIMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) FreeImportedBlockNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockAPI)(nil).FreeImportedBlockNotifierChannel), arg0) } @@ -239,7 +243,7 @@ func (m *MockBlockAPI) GetBlockByHash(arg0 common.Hash) (*types.Block, error) { } // GetBlockByHash indicates an expected call of GetBlockByHash. -func (mr *MockBlockAPIMockRecorder) GetBlockByHash(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetBlockByHash(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockByHash", reflect.TypeOf((*MockBlockAPI)(nil).GetBlockByHash), arg0) } @@ -254,7 +258,7 @@ func (m *MockBlockAPI) GetFinalisedHash(arg0, arg1 uint64) (common.Hash, error) } // GetFinalisedHash indicates an expected call of GetFinalisedHash. -func (mr *MockBlockAPIMockRecorder) GetFinalisedHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetFinalisedHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedHash", reflect.TypeOf((*MockBlockAPI)(nil).GetFinalisedHash), arg0, arg1) } @@ -283,7 +287,7 @@ func (m *MockBlockAPI) GetHashByNumber(arg0 uint) (common.Hash, error) { } // GetHashByNumber indicates an expected call of GetHashByNumber. -func (mr *MockBlockAPIMockRecorder) GetHashByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetHashByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHashByNumber", reflect.TypeOf((*MockBlockAPI)(nil).GetHashByNumber), arg0) } @@ -298,7 +302,7 @@ func (m *MockBlockAPI) GetHeader(arg0 common.Hash) (*types.Header, error) { } // GetHeader indicates an expected call of GetHeader. -func (mr *MockBlockAPIMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockAPI)(nil).GetHeader), arg0) } @@ -342,7 +346,7 @@ func (m *MockBlockAPI) GetJustification(arg0 common.Hash) ([]byte, error) { } // GetJustification indicates an expected call of GetJustification. -func (mr *MockBlockAPIMockRecorder) GetJustification(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetJustification(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJustification", reflect.TypeOf((*MockBlockAPI)(nil).GetJustification), arg0) } @@ -357,7 +361,7 @@ func (m *MockBlockAPI) GetRuntime(arg0 common.Hash) (runtime.Instance, error) { } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockAPIMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockAPI)(nil).GetRuntime), arg0) } @@ -372,7 +376,7 @@ func (m *MockBlockAPI) HasJustification(arg0 common.Hash) (bool, error) { } // HasJustification indicates an expected call of HasJustification. -func (mr *MockBlockAPIMockRecorder) HasJustification(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) HasJustification(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasJustification", reflect.TypeOf((*MockBlockAPI)(nil).HasJustification), arg0) } @@ -387,7 +391,7 @@ func (m *MockBlockAPI) RangeInMemory(arg0, arg1 common.Hash) ([]common.Hash, err } // RangeInMemory indicates an expected call of RangeInMemory. -func (mr *MockBlockAPIMockRecorder) RangeInMemory(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) RangeInMemory(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockAPI)(nil).RangeInMemory), arg0, arg1) } @@ -402,7 +406,7 @@ func (m *MockBlockAPI) RegisterRuntimeUpdatedChannel(arg0 chan<- runtime.Version } // RegisterRuntimeUpdatedChannel indicates an expected call of RegisterRuntimeUpdatedChannel. -func (mr *MockBlockAPIMockRecorder) RegisterRuntimeUpdatedChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) RegisterRuntimeUpdatedChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRuntimeUpdatedChannel", reflect.TypeOf((*MockBlockAPI)(nil).RegisterRuntimeUpdatedChannel), arg0) } @@ -416,7 +420,7 @@ func (m *MockBlockAPI) UnregisterRuntimeUpdatedChannel(arg0 uint32) bool { } // UnregisterRuntimeUpdatedChannel indicates an expected call of UnregisterRuntimeUpdatedChannel. -func (mr *MockBlockAPIMockRecorder) UnregisterRuntimeUpdatedChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockAPIMockRecorder) UnregisterRuntimeUpdatedChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterRuntimeUpdatedChannel", reflect.TypeOf((*MockBlockAPI)(nil).UnregisterRuntimeUpdatedChannel), arg0) } @@ -451,7 +455,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/dot/rpc/modules/offchain_integration_test.go b/dot/rpc/modules/offchain_integration_test.go index a1d1dec1d8..4b963eb805 100644 --- a/dot/rpc/modules/offchain_integration_test.go +++ b/dot/rpc/modules/offchain_integration_test.go @@ -11,9 +11,9 @@ import ( "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_OffchainModule_LocalStorageGet(t *testing.T) { diff --git a/dot/rpc/modules/offchain_test.go b/dot/rpc/modules/offchain_test.go index eb8555be64..eaafc705b2 100644 --- a/dot/rpc/modules/offchain_test.go +++ b/dot/rpc/modules/offchain_test.go @@ -11,7 +11,7 @@ import ( "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/dot/rpc/modules/payment_integration_test.go b/dot/rpc/modules/payment_integration_test.go index ae24fdbbf3..36c9fb9ad8 100644 --- a/dot/rpc/modules/payment_integration_test.go +++ b/dot/rpc/modules/payment_integration_test.go @@ -12,8 +12,8 @@ import ( "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ChainSafe/gossamer/lib/common" mocksruntime "github.com/ChainSafe/gossamer/lib/runtime/mocks" diff --git a/dot/rpc/modules/payment_test.go b/dot/rpc/modules/payment_test.go index d5cc0434ff..0f30e7c39d 100644 --- a/dot/rpc/modules/payment_test.go +++ b/dot/rpc/modules/payment_test.go @@ -14,7 +14,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" mocksruntime "github.com/ChainSafe/gossamer/lib/runtime/mocks" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/dot/rpc/modules/state_integration_test.go b/dot/rpc/modules/state_integration_test.go index 7347aab6c5..a37cb667e1 100644 --- a/dot/rpc/modules/state_integration_test.go +++ b/dot/rpc/modules/state_integration_test.go @@ -18,9 +18,9 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const ( diff --git a/dot/rpc/modules/state_test.go b/dot/rpc/modules/state_test.go index 116d879b42..3d6a6764eb 100644 --- a/dot/rpc/modules/state_test.go +++ b/dot/rpc/modules/state_test.go @@ -29,8 +29,8 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestStateModuleGetPairs(t *testing.T) { diff --git a/dot/rpc/modules/sync_state_test.go b/dot/rpc/modules/sync_state_test.go index b4249364ea..6cd0f98279 100644 --- a/dot/rpc/modules/sync_state_test.go +++ b/dot/rpc/modules/sync_state_test.go @@ -11,7 +11,7 @@ import ( "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/dot/rpc/modules/system_integration_test.go b/dot/rpc/modules/system_integration_test.go index ad9ae3ae8c..195624be4c 100644 --- a/dot/rpc/modules/system_integration_test.go +++ b/dot/rpc/modules/system_integration_test.go @@ -14,9 +14,9 @@ import ( "time" "github.com/btcsuite/btcd/btcutil/base58" - "github.com/golang/mock/gomock" "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/ChainSafe/gossamer/dot/core" "github.com/ChainSafe/gossamer/dot/network" diff --git a/dot/rpc/modules/system_test.go b/dot/rpc/modules/system_test.go index e3b3bd1342..b275714d4d 100644 --- a/dot/rpc/modules/system_test.go +++ b/dot/rpc/modules/system_test.go @@ -13,8 +13,8 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/golang/mock/gomock" "github.com/multiformats/go-multiaddr" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/dot/rpc/subscription/listeners_integration_test.go b/dot/rpc/subscription/listeners_integration_test.go index 73a2812617..58f9db947f 100644 --- a/dot/rpc/subscription/listeners_integration_test.go +++ b/dot/rpc/subscription/listeners_integration_test.go @@ -23,8 +23,8 @@ import ( wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" "github.com/ChainSafe/gossamer/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" - gomock "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + gomock "go.uber.org/mock/gomock" ) type mockWSConnAPI struct { diff --git a/dot/rpc/subscription/mocks_test.go b/dot/rpc/subscription/mocks_test.go index d6944bcf90..c6343ad144 100644 --- a/dot/rpc/subscription/mocks_test.go +++ b/dot/rpc/subscription/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/rpc/subscription (interfaces: TransactionStateAPI) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=subscription . TransactionStateAPI +// // Package subscription is a generated GoMock package. package subscription @@ -9,7 +13,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTransactionStateAPI is a mock of TransactionStateAPI interface. @@ -42,7 +46,7 @@ func (m *MockTransactionStateAPI) FreeStatusNotifierChannel(arg0 chan transactio } // FreeStatusNotifierChannel indicates an expected call of FreeStatusNotifierChannel. -func (mr *MockTransactionStateAPIMockRecorder) FreeStatusNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateAPIMockRecorder) FreeStatusNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeStatusNotifierChannel", reflect.TypeOf((*MockTransactionStateAPI)(nil).FreeStatusNotifierChannel), arg0) } @@ -56,7 +60,7 @@ func (m *MockTransactionStateAPI) GetStatusNotifierChannel(arg0 types.Extrinsic) } // GetStatusNotifierChannel indicates an expected call of GetStatusNotifierChannel. -func (mr *MockTransactionStateAPIMockRecorder) GetStatusNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateAPIMockRecorder) GetStatusNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatusNotifierChannel", reflect.TypeOf((*MockTransactionStateAPI)(nil).GetStatusNotifierChannel), arg0) } diff --git a/dot/rpc/subscription/websocket_integration_test.go b/dot/rpc/subscription/websocket_integration_test.go index 86c014d6d6..757ed3bb35 100644 --- a/dot/rpc/subscription/websocket_integration_test.go +++ b/dot/rpc/subscription/websocket_integration_test.go @@ -18,7 +18,7 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" "github.com/ChainSafe/gossamer/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" diff --git a/dot/rpc/websocket_integration_test.go b/dot/rpc/websocket_integration_test.go index adbadc867f..e75e2b277a 100644 --- a/dot/rpc/websocket_integration_test.go +++ b/dot/rpc/websocket_integration_test.go @@ -16,10 +16,10 @@ import ( "github.com/ChainSafe/gossamer/dot/system" "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/golang/mock/gomock" "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var addr = flag.String("addr", "localhost:8546", "http service address") diff --git a/dot/services_integration_test.go b/dot/services_integration_test.go index 37d53a2aff..ec1d7e2092 100644 --- a/dot/services_integration_test.go +++ b/dot/services_integration_test.go @@ -26,10 +26,10 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" - gomock "github.com/golang/mock/gomock" "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + gomock "go.uber.org/mock/gomock" ) func Test_nodeBuilder_createBABEService(t *testing.T) { diff --git a/dot/services_test.go b/dot/services_test.go index 432dcbb74b..afe117d776 100644 --- a/dot/services_test.go +++ b/dot/services_test.go @@ -12,9 +12,9 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_createRuntimeStorage(t *testing.T) { diff --git a/dot/state/block_race_test.go b/dot/state/block_race_test.go index 3f1ace26bd..d840d1d426 100644 --- a/dot/state/block_race_test.go +++ b/dot/state/block_race_test.go @@ -11,7 +11,7 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/internal/database" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/block_test.go b/dot/state/block_test.go index 09d0ee4541..8243bf586e 100644 --- a/dot/state/block_test.go +++ b/dot/state/block_test.go @@ -14,7 +14,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/grandpa_test.go b/dot/state/grandpa_test.go index 91116790a9..6e51cd4cc6 100644 --- a/dot/state/grandpa_test.go +++ b/dot/state/grandpa_test.go @@ -16,8 +16,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" "github.com/gtank/merlin" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/mock_counter_test.go b/dot/state/mock_counter_test.go index 78621cf4ef..765be2ec24 100644 --- a/dot/state/mock_counter_test.go +++ b/dot/state/mock_counter_test.go @@ -1,15 +1,19 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/prometheus/client_golang/prometheus (interfaces: Counter) - +// +// Generated by this command: +// +// mockgen -destination=mock_counter_test.go -package state github.com/prometheus/client_golang/prometheus Counter +// // Package state is a generated GoMock package. package state import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" prometheus "github.com/prometheus/client_golang/prometheus" io_prometheus_client "github.com/prometheus/client_model/go" + gomock "go.uber.org/mock/gomock" ) // MockCounter is a mock of Counter interface. @@ -42,7 +46,7 @@ func (m *MockCounter) Add(arg0 float64) { } // Add indicates an expected call of Add. -func (mr *MockCounterMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockCounterMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockCounter)(nil).Add), arg0) } @@ -54,7 +58,7 @@ func (m *MockCounter) Collect(arg0 chan<- prometheus.Metric) { } // Collect indicates an expected call of Collect. -func (mr *MockCounterMockRecorder) Collect(arg0 interface{}) *gomock.Call { +func (mr *MockCounterMockRecorder) Collect(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Collect", reflect.TypeOf((*MockCounter)(nil).Collect), arg0) } @@ -80,7 +84,7 @@ func (m *MockCounter) Describe(arg0 chan<- *prometheus.Desc) { } // Describe indicates an expected call of Describe. -func (mr *MockCounterMockRecorder) Describe(arg0 interface{}) *gomock.Call { +func (mr *MockCounterMockRecorder) Describe(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Describe", reflect.TypeOf((*MockCounter)(nil).Describe), arg0) } @@ -106,7 +110,7 @@ func (m *MockCounter) Write(arg0 *io_prometheus_client.Metric) error { } // Write indicates an expected call of Write. -func (mr *MockCounterMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockCounterMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockCounter)(nil).Write), arg0) } diff --git a/dot/state/mock_gauge_test.go b/dot/state/mock_gauge_test.go index 0cf4274d1b..f4fe527d97 100644 --- a/dot/state/mock_gauge_test.go +++ b/dot/state/mock_gauge_test.go @@ -1,15 +1,19 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/prometheus/client_golang/prometheus (interfaces: Gauge) - +// +// Generated by this command: +// +// mockgen -destination=mock_gauge_test.go -package state github.com/prometheus/client_golang/prometheus Gauge +// // Package state is a generated GoMock package. package state import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" prometheus "github.com/prometheus/client_golang/prometheus" io_prometheus_client "github.com/prometheus/client_model/go" + gomock "go.uber.org/mock/gomock" ) // MockGauge is a mock of Gauge interface. @@ -42,7 +46,7 @@ func (m *MockGauge) Add(arg0 float64) { } // Add indicates an expected call of Add. -func (mr *MockGaugeMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockGauge)(nil).Add), arg0) } @@ -54,7 +58,7 @@ func (m *MockGauge) Collect(arg0 chan<- prometheus.Metric) { } // Collect indicates an expected call of Collect. -func (mr *MockGaugeMockRecorder) Collect(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Collect(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Collect", reflect.TypeOf((*MockGauge)(nil).Collect), arg0) } @@ -92,7 +96,7 @@ func (m *MockGauge) Describe(arg0 chan<- *prometheus.Desc) { } // Describe indicates an expected call of Describe. -func (mr *MockGaugeMockRecorder) Describe(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Describe(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Describe", reflect.TypeOf((*MockGauge)(nil).Describe), arg0) } @@ -116,7 +120,7 @@ func (m *MockGauge) Set(arg0 float64) { } // Set indicates an expected call of Set. -func (mr *MockGaugeMockRecorder) Set(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Set(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockGauge)(nil).Set), arg0) } @@ -140,7 +144,7 @@ func (m *MockGauge) Sub(arg0 float64) { } // Sub indicates an expected call of Sub. -func (mr *MockGaugeMockRecorder) Sub(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Sub(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sub", reflect.TypeOf((*MockGauge)(nil).Sub), arg0) } @@ -154,7 +158,7 @@ func (m *MockGauge) Write(arg0 *io_prometheus_client.Metric) error { } // Write indicates an expected call of Write. -func (mr *MockGaugeMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockGaugeMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockGauge)(nil).Write), arg0) } diff --git a/dot/state/mocks_database_test.go b/dot/state/mocks_database_test.go index 079cb5578f..c73715c268 100644 --- a/dot/state/mocks_database_test.go +++ b/dot/state/mocks_database_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/trie/db (interfaces: Database) - +// +// Generated by this command: +// +// mockgen -destination=mocks_database_test.go -package=state github.com/ChainSafe/gossamer/lib/trie/db Database +// // Package state is a generated GoMock package. package state import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDatabase is a mock of Database interface. @@ -43,7 +47,7 @@ func (m *MockDatabase) Get(arg0 []byte) ([]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockDatabaseMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockDatabaseMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockDatabase)(nil).Get), arg0) } @@ -57,7 +61,7 @@ func (m *MockDatabase) Put(arg0, arg1 []byte) error { } // Put indicates an expected call of Put. -func (mr *MockDatabaseMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDatabaseMockRecorder) Put(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockDatabase)(nil).Put), arg0, arg1) } diff --git a/dot/state/mocks_runtime_test.go b/dot/state/mocks_runtime_test.go index 83be8da0e1..e76f9d1f47 100644 --- a/dot/state/mocks_runtime_test.go +++ b/dot/state/mocks_runtime_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mocks_runtime_test.go -package state github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package state is a generated GoMock package. package state @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/dot/state/mocks_test.go b/dot/state/mocks_test.go index 70617922a3..43986bc16e 100644 --- a/dot/state/mocks_test.go +++ b/dot/state/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/state (interfaces: Telemetry,BlockStateDatabase,Observer) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package state . Telemetry,BlockStateDatabase,Observer +// // Package state is a generated GoMock package. package state @@ -9,7 +13,7 @@ import ( reflect "reflect" database "github.com/ChainSafe/gossamer/internal/database" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -42,7 +46,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } @@ -79,7 +83,7 @@ func (m *MockBlockStateDatabase) Del(arg0 []byte) error { } // Del indicates an expected call of Del. -func (mr *MockBlockStateDatabaseMockRecorder) Del(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateDatabaseMockRecorder) Del(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Del", reflect.TypeOf((*MockBlockStateDatabase)(nil).Del), arg0) } @@ -94,7 +98,7 @@ func (m *MockBlockStateDatabase) Get(arg0 []byte) ([]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockBlockStateDatabaseMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateDatabaseMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockBlockStateDatabase)(nil).Get), arg0) } @@ -109,7 +113,7 @@ func (m *MockBlockStateDatabase) Has(arg0 []byte) (bool, error) { } // Has indicates an expected call of Has. -func (mr *MockBlockStateDatabaseMockRecorder) Has(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateDatabaseMockRecorder) Has(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockBlockStateDatabase)(nil).Has), arg0) } @@ -137,7 +141,7 @@ func (m *MockBlockStateDatabase) Put(arg0, arg1 []byte) error { } // Put indicates an expected call of Put. -func (mr *MockBlockStateDatabaseMockRecorder) Put(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateDatabaseMockRecorder) Put(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockBlockStateDatabase)(nil).Put), arg0, arg1) } @@ -200,7 +204,7 @@ func (m *MockObserver) Update(arg0 *SubscriptionResult) { } // Update indicates an expected call of Update. -func (mr *MockObserverMockRecorder) Update(arg0 interface{}) *gomock.Call { +func (mr *MockObserverMockRecorder) Update(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockObserver)(nil).Update), arg0) } diff --git a/dot/state/service_integration_test.go b/dot/state/service_integration_test.go index 8fb9bc5de5..d733b90934 100644 --- a/dot/state/service_integration_test.go +++ b/dot/state/service_integration_test.go @@ -18,7 +18,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/storage_notify_test.go b/dot/state/storage_notify_test.go index 564458dc7c..1597a831d1 100644 --- a/dot/state/storage_notify_test.go +++ b/dot/state/storage_notify_test.go @@ -9,8 +9,8 @@ import ( "time" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestStorageState_RegisterStorageObserver(t *testing.T) { diff --git a/dot/state/storage_test.go b/dot/state/storage_test.go index a654e3ea82..5c66947c07 100644 --- a/dot/state/storage_test.go +++ b/dot/state/storage_test.go @@ -14,7 +14,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/transaction_test.go b/dot/state/transaction_test.go index 3ae6105386..de6bf5ca3b 100644 --- a/dot/state/transaction_test.go +++ b/dot/state/transaction_test.go @@ -12,7 +12,7 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/dot/state/tries_test.go b/dot/state/tries_test.go index 40ef5626bd..cff32bfac1 100644 --- a/dot/state/tries_test.go +++ b/dot/state/tries_test.go @@ -9,8 +9,8 @@ import ( "github.com/ChainSafe/gossamer/internal/trie/node" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_NewTries(t *testing.T) { diff --git a/dot/sync/chain_sync_test.go b/dot/sync/chain_sync_test.go index af5a82fd8c..3da8dae5da 100644 --- a/dot/sync/chain_sync_test.go +++ b/dot/sync/chain_sync_test.go @@ -19,10 +19,10 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_chainSyncState_String(t *testing.T) { diff --git a/dot/sync/message_test.go b/dot/sync/message_test.go index ab83bb634a..16626cf1af 100644 --- a/dot/sync/message_test.go +++ b/dot/sync/message_test.go @@ -11,8 +11,8 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func TestService_CreateBlockResponse(t *testing.T) { diff --git a/dot/sync/mock_chain_sync_test.go b/dot/sync/mock_chain_sync_test.go index 2d38b8e60e..7df367e4bc 100644 --- a/dot/sync/mock_chain_sync_test.go +++ b/dot/sync/mock_chain_sync_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: chain_sync.go - +// +// Generated by this command: +// +// mockgen -destination=mock_chain_sync_test.go -package sync -source chain_sync.go . ChainSync +// // Package sync is a generated GoMock package. package sync @@ -8,8 +12,8 @@ import ( reflect "reflect" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockChainSync is a mock of ChainSync interface. @@ -73,7 +77,7 @@ func (m *MockChainSync) onBlockAnnounce(arg0 announcedBlock) error { } // onBlockAnnounce indicates an expected call of onBlockAnnounce. -func (mr *MockChainSyncMockRecorder) onBlockAnnounce(arg0 interface{}) *gomock.Call { +func (mr *MockChainSyncMockRecorder) onBlockAnnounce(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "onBlockAnnounce", reflect.TypeOf((*MockChainSync)(nil).onBlockAnnounce), arg0) } @@ -87,7 +91,7 @@ func (m *MockChainSync) onBlockAnnounceHandshake(p peer.ID, hash common.Hash, nu } // onBlockAnnounceHandshake indicates an expected call of onBlockAnnounceHandshake. -func (mr *MockChainSyncMockRecorder) onBlockAnnounceHandshake(p, hash, number interface{}) *gomock.Call { +func (mr *MockChainSyncMockRecorder) onBlockAnnounceHandshake(p, hash, number any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "onBlockAnnounceHandshake", reflect.TypeOf((*MockChainSync)(nil).onBlockAnnounceHandshake), p, hash, number) } diff --git a/dot/sync/mock_disjoint_block_set_test.go b/dot/sync/mock_disjoint_block_set_test.go index 98c93f577a..5460168794 100644 --- a/dot/sync/mock_disjoint_block_set_test.go +++ b/dot/sync/mock_disjoint_block_set_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/sync (interfaces: DisjointBlockSet) - +// +// Generated by this command: +// +// mockgen -destination=mock_disjoint_block_set_test.go -package=sync . DisjointBlockSet +// // Package sync is a generated GoMock package. package sync @@ -10,7 +14,7 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDisjointBlockSet is a mock of DisjointBlockSet interface. @@ -45,7 +49,7 @@ func (m *MockDisjointBlockSet) addBlock(arg0 *types.Block) error { } // addBlock indicates an expected call of addBlock. -func (mr *MockDisjointBlockSetMockRecorder) addBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) addBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "addBlock", reflect.TypeOf((*MockDisjointBlockSet)(nil).addBlock), arg0) } @@ -59,7 +63,7 @@ func (m *MockDisjointBlockSet) addHashAndNumber(arg0 common.Hash, arg1 uint) err } // addHashAndNumber indicates an expected call of addHashAndNumber. -func (mr *MockDisjointBlockSetMockRecorder) addHashAndNumber(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) addHashAndNumber(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "addHashAndNumber", reflect.TypeOf((*MockDisjointBlockSet)(nil).addHashAndNumber), arg0, arg1) } @@ -73,7 +77,7 @@ func (m *MockDisjointBlockSet) addHeader(arg0 *types.Header) error { } // addHeader indicates an expected call of addHeader. -func (mr *MockDisjointBlockSetMockRecorder) addHeader(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) addHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "addHeader", reflect.TypeOf((*MockDisjointBlockSet)(nil).addHeader), arg0) } @@ -87,7 +91,7 @@ func (m *MockDisjointBlockSet) addJustification(arg0 common.Hash, arg1 []byte) e } // addJustification indicates an expected call of addJustification. -func (mr *MockDisjointBlockSetMockRecorder) addJustification(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) addJustification(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "addJustification", reflect.TypeOf((*MockDisjointBlockSet)(nil).addJustification), arg0, arg1) } @@ -101,7 +105,7 @@ func (m *MockDisjointBlockSet) getBlock(arg0 common.Hash) *pendingBlock { } // getBlock indicates an expected call of getBlock. -func (mr *MockDisjointBlockSetMockRecorder) getBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) getBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getBlock", reflect.TypeOf((*MockDisjointBlockSet)(nil).getBlock), arg0) } @@ -129,7 +133,7 @@ func (m *MockDisjointBlockSet) hasBlock(arg0 common.Hash) bool { } // hasBlock indicates an expected call of hasBlock. -func (mr *MockDisjointBlockSetMockRecorder) hasBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) hasBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "hasBlock", reflect.TypeOf((*MockDisjointBlockSet)(nil).hasBlock), arg0) } @@ -141,7 +145,7 @@ func (m *MockDisjointBlockSet) removeBlock(arg0 common.Hash) { } // removeBlock indicates an expected call of removeBlock. -func (mr *MockDisjointBlockSetMockRecorder) removeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) removeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "removeBlock", reflect.TypeOf((*MockDisjointBlockSet)(nil).removeBlock), arg0) } @@ -153,7 +157,7 @@ func (m *MockDisjointBlockSet) removeLowerBlocks(arg0 uint) { } // removeLowerBlocks indicates an expected call of removeLowerBlocks. -func (mr *MockDisjointBlockSetMockRecorder) removeLowerBlocks(arg0 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) removeLowerBlocks(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "removeLowerBlocks", reflect.TypeOf((*MockDisjointBlockSet)(nil).removeLowerBlocks), arg0) } @@ -165,7 +169,7 @@ func (m *MockDisjointBlockSet) run(arg0 <-chan *types.FinalisationInfo, arg1 <-c } // run indicates an expected call of run. -func (mr *MockDisjointBlockSetMockRecorder) run(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockDisjointBlockSetMockRecorder) run(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "run", reflect.TypeOf((*MockDisjointBlockSet)(nil).run), arg0, arg1, arg2) } diff --git a/dot/sync/mock_request.go b/dot/sync/mock_request.go index b4d133f7e7..41e4f98dec 100644 --- a/dot/sync/mock_request.go +++ b/dot/sync/mock_request.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/network (interfaces: RequestMaker) - +// +// Generated by this command: +// +// mockgen -destination=mock_request.go -package sync github.com/ChainSafe/gossamer/dot/network RequestMaker +// // Package sync is a generated GoMock package. package sync @@ -8,8 +12,8 @@ import ( reflect "reflect" network "github.com/ChainSafe/gossamer/dot/network" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockRequestMaker is a mock of RequestMaker interface. @@ -44,7 +48,7 @@ func (m *MockRequestMaker) Do(arg0 peer.ID, arg1 network.Message, arg2 network.R } // Do indicates an expected call of Do. -func (mr *MockRequestMakerMockRecorder) Do(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockRequestMakerMockRecorder) Do(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockRequestMaker)(nil).Do), arg0, arg1, arg2) } diff --git a/dot/sync/mock_runtime_test.go b/dot/sync/mock_runtime_test.go index f1a583b884..93f6e56b5d 100644 --- a/dot/sync/mock_runtime_test.go +++ b/dot/sync/mock_runtime_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mock_runtime_test.go -package sync github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package sync is a generated GoMock package. package sync @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/dot/sync/mock_telemetry_test.go b/dot/sync/mock_telemetry_test.go index 511b67d5b3..65edd0e965 100644 --- a/dot/sync/mock_telemetry_test.go +++ b/dot/sync/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/sync (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package sync . Telemetry +// // Package sync is a generated GoMock package. package sync @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/dot/sync/mocks_test.go b/dot/sync/mocks_test.go index 8335588e01..f1827ed6e6 100644 --- a/dot/sync/mocks_test.go +++ b/dot/sync/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/sync (interfaces: BlockState,StorageState,TransactionState,BabeVerifier,FinalityGadget,BlockImportHandler,Network) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package=sync . BlockState,StorageState,TransactionState,BabeVerifier,FinalityGadget,BlockImportHandler,Network +// // Package sync is a generated GoMock package. package sync @@ -12,8 +16,8 @@ import ( common "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime" storage "github.com/ChainSafe/gossamer/lib/runtime/storage" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. @@ -48,7 +52,7 @@ func (m *MockBlockState) AddBlockToBlockTree(arg0 *types.Block) error { } // AddBlockToBlockTree indicates an expected call of AddBlockToBlockTree. -func (mr *MockBlockStateMockRecorder) AddBlockToBlockTree(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) AddBlockToBlockTree(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlockToBlockTree", reflect.TypeOf((*MockBlockState)(nil).AddBlockToBlockTree), arg0) } @@ -92,7 +96,7 @@ func (m *MockBlockState) CompareAndSetBlockData(arg0 *types.BlockData) error { } // CompareAndSetBlockData indicates an expected call of CompareAndSetBlockData. -func (mr *MockBlockStateMockRecorder) CompareAndSetBlockData(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) CompareAndSetBlockData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompareAndSetBlockData", reflect.TypeOf((*MockBlockState)(nil).CompareAndSetBlockData), arg0) } @@ -107,7 +111,7 @@ func (m *MockBlockState) GetAllBlocksAtNumber(arg0 uint) ([]common.Hash, error) } // GetAllBlocksAtNumber indicates an expected call of GetAllBlocksAtNumber. -func (mr *MockBlockStateMockRecorder) GetAllBlocksAtNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetAllBlocksAtNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBlocksAtNumber", reflect.TypeOf((*MockBlockState)(nil).GetAllBlocksAtNumber), arg0) } @@ -122,7 +126,7 @@ func (m *MockBlockState) GetBlockBody(arg0 common.Hash) (*types.Body, error) { } // GetBlockBody indicates an expected call of GetBlockBody. -func (mr *MockBlockStateMockRecorder) GetBlockBody(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockBody(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockBody", reflect.TypeOf((*MockBlockState)(nil).GetBlockBody), arg0) } @@ -137,7 +141,7 @@ func (m *MockBlockState) GetBlockByHash(arg0 common.Hash) (*types.Block, error) } // GetBlockByHash indicates an expected call of GetBlockByHash. -func (mr *MockBlockStateMockRecorder) GetBlockByHash(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockByHash(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockByHash", reflect.TypeOf((*MockBlockState)(nil).GetBlockByHash), arg0) } @@ -166,7 +170,7 @@ func (m *MockBlockState) GetHashByNumber(arg0 uint) (common.Hash, error) { } // GetHashByNumber indicates an expected call of GetHashByNumber. -func (mr *MockBlockStateMockRecorder) GetHashByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHashByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHashByNumber", reflect.TypeOf((*MockBlockState)(nil).GetHashByNumber), arg0) } @@ -181,7 +185,7 @@ func (m *MockBlockState) GetHeader(arg0 common.Hash) (*types.Header, error) { } // GetHeader indicates an expected call of GetHeader. -func (mr *MockBlockStateMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockState)(nil).GetHeader), arg0) } @@ -196,7 +200,7 @@ func (m *MockBlockState) GetHeaderByNumber(arg0 uint) (*types.Header, error) { } // GetHeaderByNumber indicates an expected call of GetHeaderByNumber. -func (mr *MockBlockStateMockRecorder) GetHeaderByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHeaderByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockBlockState)(nil).GetHeaderByNumber), arg0) } @@ -226,7 +230,7 @@ func (m *MockBlockState) GetJustification(arg0 common.Hash) ([]byte, error) { } // GetJustification indicates an expected call of GetJustification. -func (mr *MockBlockStateMockRecorder) GetJustification(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetJustification(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJustification", reflect.TypeOf((*MockBlockState)(nil).GetJustification), arg0) } @@ -241,7 +245,7 @@ func (m *MockBlockState) GetMessageQueue(arg0 common.Hash) ([]byte, error) { } // GetMessageQueue indicates an expected call of GetMessageQueue. -func (mr *MockBlockStateMockRecorder) GetMessageQueue(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetMessageQueue(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessageQueue", reflect.TypeOf((*MockBlockState)(nil).GetMessageQueue), arg0) } @@ -256,7 +260,7 @@ func (m *MockBlockState) GetReceipt(arg0 common.Hash) ([]byte, error) { } // GetReceipt indicates an expected call of GetReceipt. -func (mr *MockBlockStateMockRecorder) GetReceipt(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetReceipt(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReceipt", reflect.TypeOf((*MockBlockState)(nil).GetReceipt), arg0) } @@ -271,7 +275,7 @@ func (m *MockBlockState) GetRuntime(arg0 common.Hash) (runtime.Instance, error) } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockState)(nil).GetRuntime), arg0) } @@ -286,7 +290,7 @@ func (m *MockBlockState) HasHeader(arg0 common.Hash) (bool, error) { } // HasHeader indicates an expected call of HasHeader. -func (mr *MockBlockStateMockRecorder) HasHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) HasHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasHeader", reflect.TypeOf((*MockBlockState)(nil).HasHeader), arg0) } @@ -301,7 +305,7 @@ func (m *MockBlockState) IsDescendantOf(arg0, arg1 common.Hash) (bool, error) { } // IsDescendantOf indicates an expected call of IsDescendantOf. -func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDescendantOf", reflect.TypeOf((*MockBlockState)(nil).IsDescendantOf), arg0, arg1) } @@ -316,7 +320,7 @@ func (m *MockBlockState) Range(arg0, arg1 common.Hash) ([]common.Hash, error) { } // Range indicates an expected call of Range. -func (mr *MockBlockStateMockRecorder) Range(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) Range(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Range", reflect.TypeOf((*MockBlockState)(nil).Range), arg0, arg1) } @@ -331,7 +335,7 @@ func (m *MockBlockState) RangeInMemory(arg0, arg1 common.Hash) ([]common.Hash, e } // RangeInMemory indicates an expected call of RangeInMemory. -func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockState)(nil).RangeInMemory), arg0, arg1) } @@ -345,7 +349,7 @@ func (m *MockBlockState) SetFinalisedHash(arg0 common.Hash, arg1, arg2 uint64) e } // SetFinalisedHash indicates an expected call of SetFinalisedHash. -func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFinalisedHash", reflect.TypeOf((*MockBlockState)(nil).SetFinalisedHash), arg0, arg1, arg2) } @@ -359,7 +363,7 @@ func (m *MockBlockState) SetJustification(arg0 common.Hash, arg1 []byte) error { } // SetJustification indicates an expected call of SetJustification. -func (mr *MockBlockStateMockRecorder) SetJustification(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) SetJustification(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetJustification", reflect.TypeOf((*MockBlockState)(nil).SetJustification), arg0, arg1) } @@ -371,7 +375,7 @@ func (m *MockBlockState) StoreRuntime(arg0 common.Hash, arg1 runtime.Instance) { } // StoreRuntime indicates an expected call of StoreRuntime. -func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreRuntime", reflect.TypeOf((*MockBlockState)(nil).StoreRuntime), arg0, arg1) } @@ -421,7 +425,7 @@ func (m *MockStorageState) TrieState(arg0 *common.Hash) (*storage.TrieState, err } // TrieState indicates an expected call of TrieState. -func (mr *MockStorageStateMockRecorder) TrieState(arg0 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) TrieState(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrieState", reflect.TypeOf((*MockStorageState)(nil).TrieState), arg0) } @@ -468,7 +472,7 @@ func (m *MockTransactionState) RemoveExtrinsic(arg0 types.Extrinsic) { } // RemoveExtrinsic indicates an expected call of RemoveExtrinsic. -func (mr *MockTransactionStateMockRecorder) RemoveExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) RemoveExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveExtrinsic", reflect.TypeOf((*MockTransactionState)(nil).RemoveExtrinsic), arg0) } @@ -505,7 +509,7 @@ func (m *MockBabeVerifier) VerifyBlock(arg0 *types.Header) error { } // VerifyBlock indicates an expected call of VerifyBlock. -func (mr *MockBabeVerifierMockRecorder) VerifyBlock(arg0 interface{}) *gomock.Call { +func (mr *MockBabeVerifierMockRecorder) VerifyBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyBlock", reflect.TypeOf((*MockBabeVerifier)(nil).VerifyBlock), arg0) } @@ -544,7 +548,7 @@ func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []b } // VerifyBlockJustification indicates an expected call of VerifyBlockJustification. -func (mr *MockFinalityGadgetMockRecorder) VerifyBlockJustification(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockFinalityGadgetMockRecorder) VerifyBlockJustification(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyBlockJustification", reflect.TypeOf((*MockFinalityGadget)(nil).VerifyBlockJustification), arg0, arg1) } @@ -581,7 +585,7 @@ func (m *MockBlockImportHandler) HandleBlockImport(arg0 *types.Block, arg1 *stor } // HandleBlockImport indicates an expected call of HandleBlockImport. -func (mr *MockBlockImportHandlerMockRecorder) HandleBlockImport(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockBlockImportHandlerMockRecorder) HandleBlockImport(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockImport", reflect.TypeOf((*MockBlockImportHandler)(nil).HandleBlockImport), arg0, arg1, arg2) } @@ -644,7 +648,7 @@ func (m *MockNetwork) ReportPeer(arg0 peerset.ReputationChange, arg1 peer.ID) { } // ReportPeer indicates an expected call of ReportPeer. -func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeer", reflect.TypeOf((*MockNetwork)(nil).ReportPeer), arg0, arg1) } diff --git a/dot/sync/syncer_integration_test.go b/dot/sync/syncer_integration_test.go index 68560ef4c3..09f7ba9c5a 100644 --- a/dot/sync/syncer_integration_test.go +++ b/dot/sync/syncer_integration_test.go @@ -22,8 +22,8 @@ import ( "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func newTestSyncer(t *testing.T) *Service { diff --git a/dot/sync/syncer_test.go b/dot/sync/syncer_test.go index 64221216f5..943d8baa2b 100644 --- a/dot/sync/syncer_test.go +++ b/dot/sync/syncer_test.go @@ -13,10 +13,10 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestNewService(t *testing.T) { diff --git a/dot/sync/worker_pool_test.go b/dot/sync/worker_pool_test.go index 5ea0d4e9d7..a49bc7a575 100644 --- a/dot/sync/worker_pool_test.go +++ b/dot/sync/worker_pool_test.go @@ -11,9 +11,9 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "golang.org/x/exp/maps" ) diff --git a/dot/sync/worker_test.go b/dot/sync/worker_test.go index 904be38983..ca034e62eb 100644 --- a/dot/sync/worker_test.go +++ b/dot/sync/worker_test.go @@ -9,9 +9,9 @@ import ( "time" "github.com/ChainSafe/gossamer/dot/network" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestWorker(t *testing.T) { diff --git a/go.mod b/go.mod index dc3449aa48..da0afcf1f5 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( github.com/ethereum/go-ethereum v1.13.5 github.com/fatih/color v1.16.0 github.com/go-playground/validator/v10 v10.16.0 - github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.1 @@ -38,6 +37,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tetratelabs/wazero v1.1.0 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 + go.uber.org/mock v0.3.0 golang.org/x/crypto v0.15.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/term v0.14.0 @@ -84,6 +84,7 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.0.0 // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/gopacket v1.1.19 // indirect diff --git a/go.sum b/go.sum index 064698eccc..fd178c2a57 100644 --- a/go.sum +++ b/go.sum @@ -836,6 +836,8 @@ go.uber.org/fx v1.20.0/go.mod h1:qCUj0btiR3/JnanEr1TYEePfSw6o/4qYJscgvzQ5Ub0= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/internal/httpserver/logger_mock_test.go b/internal/httpserver/logger_mock_test.go index 790ad0a28f..9787580059 100644 --- a/internal/httpserver/logger_mock_test.go +++ b/internal/httpserver/logger_mock_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/internal/httpserver (interfaces: Logger) - +// +// Generated by this command: +// +// mockgen -destination=logger_mock_test.go -package httpserver . Logger +// // Package httpserver is a generated GoMock package. package httpserver import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockLogger is a mock of Logger interface. @@ -40,7 +44,7 @@ func (m *MockLogger) Error(arg0 string) { } // Error indicates an expected call of Error. -func (mr *MockLoggerMockRecorder) Error(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Error(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), arg0) } @@ -52,7 +56,7 @@ func (m *MockLogger) Info(arg0 string) { } // Info indicates an expected call of Info. -func (mr *MockLoggerMockRecorder) Info(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Info(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), arg0) } @@ -64,7 +68,7 @@ func (m *MockLogger) Warn(arg0 string) { } // Warn indicates an expected call of Warn. -func (mr *MockLoggerMockRecorder) Warn(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Warn(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), arg0) } diff --git a/internal/httpserver/matchers_test.go b/internal/httpserver/matchers_test.go index eab1f3cca1..f4196c38f0 100644 --- a/internal/httpserver/matchers_test.go +++ b/internal/httpserver/matchers_test.go @@ -6,7 +6,7 @@ package httpserver import ( "regexp" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) var _ gomock.Matcher = (*regexMatcher)(nil) diff --git a/internal/httpserver/run_test.go b/internal/httpserver/run_test.go index a664e01038..925279fa2c 100644 --- a/internal/httpserver/run_test.go +++ b/internal/httpserver/run_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_Server_Run_success(t *testing.T) { diff --git a/internal/httpserver/server_test.go b/internal/httpserver/server_test.go index e24bacb49f..538d29bf5f 100644 --- a/internal/httpserver/server_test.go +++ b/internal/httpserver/server_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_New(t *testing.T) { diff --git a/internal/pprof/logger_mock_test.go b/internal/pprof/logger_mock_test.go index 02edbbfbe3..5d5b474cc6 100644 --- a/internal/pprof/logger_mock_test.go +++ b/internal/pprof/logger_mock_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/internal/httpserver (interfaces: Logger) - +// +// Generated by this command: +// +// mockgen -destination=logger_mock_test.go -package pprof github.com/ChainSafe/gossamer/internal/httpserver Logger +// // Package pprof is a generated GoMock package. package pprof import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockLogger is a mock of Logger interface. @@ -40,7 +44,7 @@ func (m *MockLogger) Error(arg0 string) { } // Error indicates an expected call of Error. -func (mr *MockLoggerMockRecorder) Error(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Error(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), arg0) } @@ -52,7 +56,7 @@ func (m *MockLogger) Info(arg0 string) { } // Info indicates an expected call of Info. -func (mr *MockLoggerMockRecorder) Info(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Info(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), arg0) } @@ -64,7 +68,7 @@ func (m *MockLogger) Warn(arg0 string) { } // Warn indicates an expected call of Warn. -func (mr *MockLoggerMockRecorder) Warn(arg0 interface{}) *gomock.Call { +func (mr *MockLoggerMockRecorder) Warn(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), arg0) } diff --git a/internal/pprof/matchers_test.go b/internal/pprof/matchers_test.go index bb13f23c45..2f0c57ed55 100644 --- a/internal/pprof/matchers_test.go +++ b/internal/pprof/matchers_test.go @@ -6,7 +6,7 @@ package pprof import ( "regexp" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) var _ gomock.Matcher = (*regexMatcher)(nil) diff --git a/internal/pprof/runner_mock_test.go b/internal/pprof/runner_mock_test.go index c837520209..59ca889ea0 100644 --- a/internal/pprof/runner_mock_test.go +++ b/internal/pprof/runner_mock_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/internal/pprof (interfaces: Runner) - +// +// Generated by this command: +// +// mockgen -destination=runner_mock_test.go -package pprof . Runner +// // Package pprof is a generated GoMock package. package pprof @@ -8,7 +12,7 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockRunner is a mock of Runner interface. @@ -41,7 +45,7 @@ func (m *MockRunner) Run(arg0 context.Context, arg1 chan<- struct{}, arg2 chan<- } // Run indicates an expected call of Run. -func (mr *MockRunnerMockRecorder) Run(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockRunnerMockRecorder) Run(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockRunner)(nil).Run), arg0, arg1, arg2) } diff --git a/internal/pprof/server_test.go b/internal/pprof/server_test.go index e9b92603fe..ac04ad5d24 100644 --- a/internal/pprof/server_test.go +++ b/internal/pprof/server_test.go @@ -11,9 +11,9 @@ import ( "time" "github.com/ChainSafe/gossamer/internal/httpserver" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_Server(t *testing.T) { diff --git a/internal/pprof/service_test.go b/internal/pprof/service_test.go index 4ea9b549e7..34315ea0f8 100644 --- a/internal/pprof/service_test.go +++ b/internal/pprof/service_test.go @@ -9,9 +9,9 @@ import ( "testing" westenddev "github.com/ChainSafe/gossamer/chain/westend-dev" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_NewService(t *testing.T) { diff --git a/internal/trie/node/branch_encode_test.go b/internal/trie/node/branch_encode_test.go index e21b315423..d0be1855e4 100644 --- a/internal/trie/node/branch_encode_test.go +++ b/internal/trie/node/branch_encode_test.go @@ -8,9 +8,9 @@ import ( "io" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) // Opportunistic parallel: 13781602 ns/op 14419488 B/op 323575 allocs/op diff --git a/internal/trie/node/buffer_mock_test.go b/internal/trie/node/buffer_mock_test.go index 8977a1ed52..8ef91cf0d1 100644 --- a/internal/trie/node/buffer_mock_test.go +++ b/internal/trie/node/buffer_mock_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/internal/trie/node (interfaces: Buffer) - +// +// Generated by this command: +// +// mockgen -destination=buffer_mock_test.go -package node . Buffer +// // Package node is a generated GoMock package. package node import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBuffer is a mock of Buffer interface. @@ -71,7 +75,7 @@ func (m *MockBuffer) Write(arg0 []byte) (int, error) { } // Write indicates an expected call of Write. -func (mr *MockBufferMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockBufferMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockBuffer)(nil).Write), arg0) } diff --git a/internal/trie/node/encode_test.go b/internal/trie/node/encode_test.go index aea9d02196..e3c13316d6 100644 --- a/internal/trie/node/encode_test.go +++ b/internal/trie/node/encode_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const NoMaxInlineValueSize = math.MaxInt diff --git a/internal/trie/node/hash_test.go b/internal/trie/node/hash_test.go index adbe06326e..62c8fa69c2 100644 --- a/internal/trie/node/hash_test.go +++ b/internal/trie/node/hash_test.go @@ -7,8 +7,8 @@ import ( "io" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_MerkleValue(t *testing.T) { diff --git a/internal/trie/node/header_test.go b/internal/trie/node/header_test.go index 5b57174628..4f26b2e446 100644 --- a/internal/trie/node/header_test.go +++ b/internal/trie/node/header_test.go @@ -10,9 +10,9 @@ import ( "sort" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_encodeHeader(t *testing.T) { diff --git a/internal/trie/node/key_test.go b/internal/trie/node/key_test.go index 4a6ad3c47c..97b02c6c2e 100644 --- a/internal/trie/node/key_test.go +++ b/internal/trie/node/key_test.go @@ -7,8 +7,8 @@ import ( "fmt" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func repeatBytes(n int, b byte) (slice []byte) { diff --git a/internal/trie/node/reader_mock_test.go b/internal/trie/node/reader_mock_test.go index 2aa28d2998..aded8d3a99 100644 --- a/internal/trie/node/reader_mock_test.go +++ b/internal/trie/node/reader_mock_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: io (interfaces: Reader) - +// +// Generated by this command: +// +// mockgen -destination=reader_mock_test.go -package node io Reader +// // Package node is a generated GoMock package. package node import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockReader is a mock of Reader interface. @@ -43,7 +47,7 @@ func (m *MockReader) Read(arg0 []byte) (int, error) { } // Read indicates an expected call of Read. -func (mr *MockReaderMockRecorder) Read(arg0 interface{}) *gomock.Call { +func (mr *MockReaderMockRecorder) Read(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockReader)(nil).Read), arg0) } diff --git a/internal/trie/node/writer_mock_test.go b/internal/trie/node/writer_mock_test.go index 9665f01c85..b954435eca 100644 --- a/internal/trie/node/writer_mock_test.go +++ b/internal/trie/node/writer_mock_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: io (interfaces: Writer) - +// +// Generated by this command: +// +// mockgen -destination=writer_mock_test.go -package node io Writer +// // Package node is a generated GoMock package. package node import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockWriter is a mock of Writer interface. @@ -43,7 +47,7 @@ func (m *MockWriter) Write(arg0 []byte) (int, error) { } // Write indicates an expected call of Write. -func (mr *MockWriterMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockWriterMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockWriter)(nil).Write), arg0) } diff --git a/lib/babe/babe_integration_test.go b/lib/babe/babe_integration_test.go index 83f2a9d0cf..43a216e445 100644 --- a/lib/babe/babe_integration_test.go +++ b/lib/babe/babe_integration_test.go @@ -14,7 +14,7 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/runtime" "github.com/centrifuge/go-substrate-rpc-client/v4/signature" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/lib/babe/epoch_test.go b/lib/babe/epoch_test.go index 50bfd023b4..d8d9f20d2c 100644 --- a/lib/babe/epoch_test.go +++ b/lib/babe/epoch_test.go @@ -10,8 +10,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var keyring, _ = keystore.NewSr25519Keyring() diff --git a/lib/babe/helpers_test.go b/lib/babe/helpers_test.go index 0aa192bcb9..f21eec6984 100644 --- a/lib/babe/helpers_test.go +++ b/lib/babe/helpers_test.go @@ -26,8 +26,8 @@ import ( "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const ( diff --git a/lib/babe/mock_state_test.go b/lib/babe/mock_state_test.go index f97f87dd39..c7f2984d64 100644 --- a/lib/babe/mock_state_test.go +++ b/lib/babe/mock_state_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/babe (interfaces: BlockState,ImportedBlockNotifierManager,StorageState,TransactionState,EpochState,BlockImportHandler,SlotState) - +// +// Generated by this command: +// +// mockgen -destination=mock_state_test.go -package babe . BlockState,ImportedBlockNotifierManager,StorageState,TransactionState,EpochState,BlockImportHandler,SlotState +// // Package babe is a generated GoMock package. package babe @@ -13,7 +17,7 @@ import ( runtime "github.com/ChainSafe/gossamer/lib/runtime" storage "github.com/ChainSafe/gossamer/lib/runtime/storage" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. @@ -48,7 +52,7 @@ func (m *MockBlockState) AddBlock(arg0 *types.Block) error { } // AddBlock indicates an expected call of AddBlock. -func (mr *MockBlockStateMockRecorder) AddBlock(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) AddBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddBlock", reflect.TypeOf((*MockBlockState)(nil).AddBlock), arg0) } @@ -89,7 +93,7 @@ func (m *MockBlockState) FreeImportedBlockNotifierChannel(arg0 chan *types.Block } // FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. -func (mr *MockBlockStateMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) FreeImportedBlockNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).FreeImportedBlockNotifierChannel), arg0) } @@ -117,7 +121,7 @@ func (m *MockBlockState) GetAllBlocksAtDepth(arg0 common.Hash) []common.Hash { } // GetAllBlocksAtDepth indicates an expected call of GetAllBlocksAtDepth. -func (mr *MockBlockStateMockRecorder) GetAllBlocksAtDepth(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetAllBlocksAtDepth(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBlocksAtDepth", reflect.TypeOf((*MockBlockState)(nil).GetAllBlocksAtDepth), arg0) } @@ -132,7 +136,7 @@ func (m *MockBlockState) GetBlockByNumber(arg0 uint) (*types.Block, error) { } // GetBlockByNumber indicates an expected call of GetBlockByNumber. -func (mr *MockBlockStateMockRecorder) GetBlockByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockByNumber", reflect.TypeOf((*MockBlockState)(nil).GetBlockByNumber), arg0) } @@ -147,7 +151,7 @@ func (m *MockBlockState) GetBlockHashesBySlot(arg0 uint64) ([]common.Hash, error } // GetBlockHashesBySlot indicates an expected call of GetBlockHashesBySlot. -func (mr *MockBlockStateMockRecorder) GetBlockHashesBySlot(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetBlockHashesBySlot(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockHashesBySlot", reflect.TypeOf((*MockBlockState)(nil).GetBlockHashesBySlot), arg0) } @@ -162,7 +166,7 @@ func (m *MockBlockState) GetHeader(arg0 common.Hash) (*types.Header, error) { } // GetHeader indicates an expected call of GetHeader. -func (mr *MockBlockStateMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockState)(nil).GetHeader), arg0) } @@ -191,7 +195,7 @@ func (m *MockBlockState) GetRuntime(arg0 common.Hash) (runtime.Instance, error) } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockState)(nil).GetRuntime), arg0) } @@ -206,7 +210,7 @@ func (m *MockBlockState) GetSlotForBlock(arg0 common.Hash) (uint64, error) { } // GetSlotForBlock indicates an expected call of GetSlotForBlock. -func (mr *MockBlockStateMockRecorder) GetSlotForBlock(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetSlotForBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSlotForBlock", reflect.TypeOf((*MockBlockState)(nil).GetSlotForBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockBlockState) IsDescendantOf(arg0, arg1 common.Hash) (bool, error) { } // IsDescendantOf indicates an expected call of IsDescendantOf. -func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDescendantOf", reflect.TypeOf((*MockBlockState)(nil).IsDescendantOf), arg0, arg1) } @@ -236,7 +240,7 @@ func (m *MockBlockState) NumberIsFinalised(arg0 uint) (bool, error) { } // NumberIsFinalised indicates an expected call of NumberIsFinalised. -func (mr *MockBlockStateMockRecorder) NumberIsFinalised(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) NumberIsFinalised(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NumberIsFinalised", reflect.TypeOf((*MockBlockState)(nil).NumberIsFinalised), arg0) } @@ -248,7 +252,7 @@ func (m *MockBlockState) StoreRuntime(arg0 common.Hash, arg1 runtime.Instance) { } // StoreRuntime indicates an expected call of StoreRuntime. -func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) StoreRuntime(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreRuntime", reflect.TypeOf((*MockBlockState)(nil).StoreRuntime), arg0, arg1) } @@ -283,7 +287,7 @@ func (m *MockImportedBlockNotifierManager) FreeImportedBlockNotifierChannel(arg0 } // FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. -func (mr *MockImportedBlockNotifierManagerMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockImportedBlockNotifierManagerMockRecorder) FreeImportedBlockNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockImportedBlockNotifierManager)(nil).FreeImportedBlockNotifierChannel), arg0) } @@ -347,7 +351,7 @@ func (m *MockStorageState) TrieState(arg0 *common.Hash) (*storage.TrieState, err } // TrieState indicates an expected call of TrieState. -func (mr *MockStorageStateMockRecorder) TrieState(arg0 interface{}) *gomock.Call { +func (mr *MockStorageStateMockRecorder) TrieState(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrieState", reflect.TypeOf((*MockStorageState)(nil).TrieState), arg0) } @@ -396,7 +400,7 @@ func (m *MockTransactionState) PopWithTimer(arg0 <-chan time.Time) *transaction. } // PopWithTimer indicates an expected call of PopWithTimer. -func (mr *MockTransactionStateMockRecorder) PopWithTimer(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) PopWithTimer(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PopWithTimer", reflect.TypeOf((*MockTransactionState)(nil).PopWithTimer), arg0) } @@ -411,7 +415,7 @@ func (m *MockTransactionState) Push(arg0 *transaction.ValidTransaction) (common. } // Push indicates an expected call of Push. -func (mr *MockTransactionStateMockRecorder) Push(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) Push(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockTransactionState)(nil).Push), arg0) } @@ -449,7 +453,7 @@ func (m *MockEpochState) GetConfigData(arg0 uint64, arg1 *types.Header) (*types. } // GetConfigData indicates an expected call of GetConfigData. -func (mr *MockEpochStateMockRecorder) GetConfigData(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) GetConfigData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfigData", reflect.TypeOf((*MockEpochState)(nil).GetConfigData), arg0, arg1) } @@ -479,7 +483,7 @@ func (m *MockEpochState) GetEpochData(arg0 uint64, arg1 *types.Header) (*types.E } // GetEpochData indicates an expected call of GetEpochData. -func (mr *MockEpochStateMockRecorder) GetEpochData(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) GetEpochData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpochData", reflect.TypeOf((*MockEpochState)(nil).GetEpochData), arg0, arg1) } @@ -494,7 +498,7 @@ func (m *MockEpochState) GetEpochForBlock(arg0 *types.Header) (uint64, error) { } // GetEpochForBlock indicates an expected call of GetEpochForBlock. -func (mr *MockEpochStateMockRecorder) GetEpochForBlock(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) GetEpochForBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpochForBlock", reflect.TypeOf((*MockEpochState)(nil).GetEpochForBlock), arg0) } @@ -569,7 +573,7 @@ func (m *MockEpochState) GetStartSlotForEpoch(arg0 uint64) (uint64, error) { } // GetStartSlotForEpoch indicates an expected call of GetStartSlotForEpoch. -func (mr *MockEpochStateMockRecorder) GetStartSlotForEpoch(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) GetStartSlotForEpoch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStartSlotForEpoch", reflect.TypeOf((*MockEpochState)(nil).GetStartSlotForEpoch), arg0) } @@ -583,7 +587,7 @@ func (m *MockEpochState) SetCurrentEpoch(arg0 uint64) error { } // SetCurrentEpoch indicates an expected call of SetCurrentEpoch. -func (mr *MockEpochStateMockRecorder) SetCurrentEpoch(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) SetCurrentEpoch(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentEpoch", reflect.TypeOf((*MockEpochState)(nil).SetCurrentEpoch), arg0) } @@ -597,7 +601,7 @@ func (m *MockEpochState) SetEpochData(arg0 uint64, arg1 *types.EpochData) error } // SetEpochData indicates an expected call of SetEpochData. -func (mr *MockEpochStateMockRecorder) SetEpochData(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) SetEpochData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetEpochData", reflect.TypeOf((*MockEpochState)(nil).SetEpochData), arg0, arg1) } @@ -611,7 +615,7 @@ func (m *MockEpochState) SetFirstSlot(arg0 uint64) error { } // SetFirstSlot indicates an expected call of SetFirstSlot. -func (mr *MockEpochStateMockRecorder) SetFirstSlot(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) SetFirstSlot(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFirstSlot", reflect.TypeOf((*MockEpochState)(nil).SetFirstSlot), arg0) } @@ -626,7 +630,7 @@ func (m *MockEpochState) SkipVerify(arg0 *types.Header) (bool, error) { } // SkipVerify indicates an expected call of SkipVerify. -func (mr *MockEpochStateMockRecorder) SkipVerify(arg0 interface{}) *gomock.Call { +func (mr *MockEpochStateMockRecorder) SkipVerify(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SkipVerify", reflect.TypeOf((*MockEpochState)(nil).SkipVerify), arg0) } @@ -663,7 +667,7 @@ func (m *MockBlockImportHandler) HandleBlockProduced(arg0 *types.Block, arg1 *st } // HandleBlockProduced indicates an expected call of HandleBlockProduced. -func (mr *MockBlockImportHandlerMockRecorder) HandleBlockProduced(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockImportHandlerMockRecorder) HandleBlockProduced(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockProduced", reflect.TypeOf((*MockBlockImportHandler)(nil).HandleBlockProduced), arg0, arg1) } @@ -701,7 +705,7 @@ func (m *MockSlotState) CheckEquivocation(arg0, arg1 uint64, arg2 *types.Header, } // CheckEquivocation indicates an expected call of CheckEquivocation. -func (mr *MockSlotStateMockRecorder) CheckEquivocation(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockSlotStateMockRecorder) CheckEquivocation(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckEquivocation", reflect.TypeOf((*MockSlotState)(nil).CheckEquivocation), arg0, arg1, arg2, arg3) } diff --git a/lib/babe/mock_telemetry_test.go b/lib/babe/mock_telemetry_test.go index 7c86455b0e..c4cb9bba6c 100644 --- a/lib/babe/mock_telemetry_test.go +++ b/lib/babe/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/babe (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package babe . Telemetry +// // Package babe is a generated GoMock package. package babe @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/lib/babe/mocks/core.go b/lib/babe/mocks/core.go index 65323bab13..4da5af29a1 100644 --- a/lib/babe/mocks/core.go +++ b/lib/babe/mocks/core.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/dot/core (interfaces: Network,BlockImportDigestHandler) - +// +// Generated by this command: +// +// mockgen -destination=mocks/core.go -package mocks github.com/ChainSafe/gossamer/dot/core Network,BlockImportDigestHandler +// // Package mocks is a generated GoMock package. package mocks @@ -10,8 +14,8 @@ import ( network "github.com/ChainSafe/gossamer/dot/network" peerset "github.com/ChainSafe/gossamer/dot/peerset" types "github.com/ChainSafe/gossamer/dot/types" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" + gomock "go.uber.org/mock/gomock" ) // MockNetwork is a mock of Network interface. @@ -44,7 +48,7 @@ func (m *MockNetwork) GossipMessage(arg0 network.NotificationsMessage) { } // GossipMessage indicates an expected call of GossipMessage. -func (mr *MockNetworkMockRecorder) GossipMessage(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) GossipMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GossipMessage", reflect.TypeOf((*MockNetwork)(nil).GossipMessage), arg0) } @@ -70,7 +74,7 @@ func (m *MockNetwork) ReportPeer(arg0 peerset.ReputationChange, arg1 peer.ID) { } // ReportPeer indicates an expected call of ReportPeer. -func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) ReportPeer(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportPeer", reflect.TypeOf((*MockNetwork)(nil).ReportPeer), arg0, arg1) } @@ -107,7 +111,7 @@ func (m *MockBlockImportDigestHandler) HandleDigests(arg0 *types.Header) error { } // HandleDigests indicates an expected call of HandleDigests. -func (mr *MockBlockImportDigestHandlerMockRecorder) HandleDigests(arg0 interface{}) *gomock.Call { +func (mr *MockBlockImportDigestHandlerMockRecorder) HandleDigests(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleDigests", reflect.TypeOf((*MockBlockImportDigestHandler)(nil).HandleDigests), arg0) } diff --git a/lib/babe/mocks/runtime.go b/lib/babe/mocks/runtime.go index 369e51c6dc..9ae14e6a80 100644 --- a/lib/babe/mocks/runtime.go +++ b/lib/babe/mocks/runtime.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mocks/runtime.go -package mocks github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package mocks is a generated GoMock package. package mocks @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/lib/babe/verify_integration_test.go b/lib/babe/verify_integration_test.go index 5b4e298f9e..5f6e76a5e6 100644 --- a/lib/babe/verify_integration_test.go +++ b/lib/babe/verify_integration_test.go @@ -20,8 +20,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestVerificationManager_OnDisabled_InvalidIndex(t *testing.T) { diff --git a/lib/babe/verify_test.go b/lib/babe/verify_test.go index 2fcf9695b3..e91f54ea08 100644 --- a/lib/babe/verify_test.go +++ b/lib/babe/verify_test.go @@ -15,9 +15,9 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) const testSlotDuration = time.Second diff --git a/lib/blocktree/blocktree_test.go b/lib/blocktree/blocktree_test.go index 798ec32bb7..f7833eeec5 100644 --- a/lib/blocktree/blocktree_test.go +++ b/lib/blocktree/blocktree_test.go @@ -12,9 +12,9 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func newBlockTreeFromNode(root *node) *BlockTree { diff --git a/lib/blocktree/hashtoruntime_test.go b/lib/blocktree/hashtoruntime_test.go index 99eff79153..325bb0ebe2 100644 --- a/lib/blocktree/hashtoruntime_test.go +++ b/lib/blocktree/hashtoruntime_test.go @@ -11,8 +11,8 @@ import ( "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func Test_newHashToRuntime(t *testing.T) { diff --git a/lib/blocktree/mocks_test.go b/lib/blocktree/mocks_test.go index 7c5eb64806..a354539b6c 100644 --- a/lib/blocktree/mocks_test.go +++ b/lib/blocktree/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package blocktree github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package blocktree is a generated GoMock package. package blocktree @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/lib/grandpa/finalisation_integration_test.go b/lib/grandpa/finalisation_integration_test.go index 8e6908630f..08fe3bc501 100644 --- a/lib/grandpa/finalisation_integration_test.go +++ b/lib/grandpa/finalisation_integration_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_finalisationHandler_runEphemeralServices(t *testing.T) { diff --git a/lib/grandpa/helpers_integration_test.go b/lib/grandpa/helpers_integration_test.go index b0105ff546..0c80b8dce9 100644 --- a/lib/grandpa/helpers_integration_test.go +++ b/lib/grandpa/helpers_integration_test.go @@ -22,11 +22,11 @@ import ( wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/utils" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var ( diff --git a/lib/grandpa/message_handler_integration_test.go b/lib/grandpa/message_handler_integration_test.go index 3e137dc380..2368051944 100644 --- a/lib/grandpa/message_handler_integration_test.go +++ b/lib/grandpa/message_handler_integration_test.go @@ -17,9 +17,9 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var testHeader = &types.Header{ diff --git a/lib/grandpa/message_tracker_test.go b/lib/grandpa/message_tracker_test.go index af1584fd02..6bccda47b1 100644 --- a/lib/grandpa/message_tracker_test.go +++ b/lib/grandpa/message_tracker_test.go @@ -18,8 +18,8 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" + "go.uber.org/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/lib/grandpa/mock_ephemeral_service_test.go b/lib/grandpa/mock_ephemeral_service_test.go index a29779c639..58996bf6d8 100644 --- a/lib/grandpa/mock_ephemeral_service_test.go +++ b/lib/grandpa/mock_ephemeral_service_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: finalisation.go - +// +// Generated by this command: +// +// mockgen -source=finalisation.go -destination=mock_ephemeral_service_test.go -package grandpa . ephemeralService +// // Package grandpa is a generated GoMock package. package grandpa import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockephemeralService is a mock of ephemeralService interface. diff --git a/lib/grandpa/mock_telemetry_test.go b/lib/grandpa/mock_telemetry_test.go index f21e9e1af3..a109813d90 100644 --- a/lib/grandpa/mock_telemetry_test.go +++ b/lib/grandpa/mock_telemetry_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/grandpa (interfaces: Telemetry) - +// +// Generated by this command: +// +// mockgen -destination=mock_telemetry_test.go -package grandpa . Telemetry +// // Package grandpa is a generated GoMock package. package grandpa @@ -8,7 +12,7 @@ import ( json "encoding/json" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockTelemetry is a mock of Telemetry interface. @@ -41,7 +45,7 @@ func (m *MockTelemetry) SendMessage(arg0 json.Marshaler) { } // SendMessage indicates an expected call of SendMessage. -func (mr *MockTelemetryMockRecorder) SendMessage(arg0 interface{}) *gomock.Call { +func (mr *MockTelemetryMockRecorder) SendMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockTelemetry)(nil).SendMessage), arg0) } diff --git a/lib/grandpa/mocks_runtime_test.go b/lib/grandpa/mocks_runtime_test.go index fc0360e78f..568e0f6be9 100644 --- a/lib/grandpa/mocks_runtime_test.go +++ b/lib/grandpa/mocks_runtime_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance) - +// +// Generated by this command: +// +// mockgen -destination=mocks_runtime_test.go -package grandpa github.com/ChainSafe/gossamer/lib/runtime Instance +// // Package grandpa is a generated GoMock package. package grandpa @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } diff --git a/lib/grandpa/mocks_test.go b/lib/grandpa/mocks_test.go index eb3248f576..822f604f9f 100644 --- a/lib/grandpa/mocks_test.go +++ b/lib/grandpa/mocks_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/grandpa (interfaces: BlockState,GrandpaState,Network) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package grandpa . BlockState,GrandpaState,Network +// // Package grandpa is a generated GoMock package. package grandpa @@ -11,9 +15,9 @@ import ( types "github.com/ChainSafe/gossamer/dot/types" common "github.com/ChainSafe/gossamer/lib/common" runtime "github.com/ChainSafe/gossamer/lib/runtime" - gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p/core/peer" protocol "github.com/libp2p/go-libp2p/core/protocol" + gomock "go.uber.org/mock/gomock" ) // MockBlockState is a mock of BlockState interface. @@ -90,7 +94,7 @@ func (m *MockBlockState) FreeFinalisedNotifierChannel(arg0 chan *types.Finalisat } // FreeFinalisedNotifierChannel indicates an expected call of FreeFinalisedNotifierChannel. -func (mr *MockBlockStateMockRecorder) FreeFinalisedNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) FreeFinalisedNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeFinalisedNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).FreeFinalisedNotifierChannel), arg0) } @@ -102,7 +106,7 @@ func (m *MockBlockState) FreeImportedBlockNotifierChannel(arg0 chan *types.Block } // FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. -func (mr *MockBlockStateMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) FreeImportedBlockNotifierChannel(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).FreeImportedBlockNotifierChannel), arg0) } @@ -131,7 +135,7 @@ func (m *MockBlockState) GetFinalisedHash(arg0, arg1 uint64) (common.Hash, error } // GetFinalisedHash indicates an expected call of GetFinalisedHash. -func (mr *MockBlockStateMockRecorder) GetFinalisedHash(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetFinalisedHash(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedHash", reflect.TypeOf((*MockBlockState)(nil).GetFinalisedHash), arg0, arg1) } @@ -146,7 +150,7 @@ func (m *MockBlockState) GetFinalisedHeader(arg0, arg1 uint64) (*types.Header, e } // GetFinalisedHeader indicates an expected call of GetFinalisedHeader. -func (mr *MockBlockStateMockRecorder) GetFinalisedHeader(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetFinalisedHeader(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedHeader", reflect.TypeOf((*MockBlockState)(nil).GetFinalisedHeader), arg0, arg1) } @@ -175,7 +179,7 @@ func (m *MockBlockState) GetHeader(arg0 common.Hash) (*types.Header, error) { } // GetHeader indicates an expected call of GetHeader. -func (mr *MockBlockStateMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockState)(nil).GetHeader), arg0) } @@ -190,7 +194,7 @@ func (m *MockBlockState) GetHeaderByNumber(arg0 uint) (*types.Header, error) { } // GetHeaderByNumber indicates an expected call of GetHeaderByNumber. -func (mr *MockBlockStateMockRecorder) GetHeaderByNumber(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetHeaderByNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockBlockState)(nil).GetHeaderByNumber), arg0) } @@ -250,7 +254,7 @@ func (m *MockBlockState) GetRuntime(arg0 common.Hash) (runtime.Instance, error) } // GetRuntime indicates an expected call of GetRuntime. -func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockState)(nil).GetRuntime), arg0) } @@ -265,7 +269,7 @@ func (m *MockBlockState) HasFinalisedBlock(arg0, arg1 uint64) (bool, error) { } // HasFinalisedBlock indicates an expected call of HasFinalisedBlock. -func (mr *MockBlockStateMockRecorder) HasFinalisedBlock(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) HasFinalisedBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasFinalisedBlock", reflect.TypeOf((*MockBlockState)(nil).HasFinalisedBlock), arg0, arg1) } @@ -280,7 +284,7 @@ func (m *MockBlockState) HasHeader(arg0 common.Hash) (bool, error) { } // HasHeader indicates an expected call of HasHeader. -func (mr *MockBlockStateMockRecorder) HasHeader(arg0 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) HasHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasHeader", reflect.TypeOf((*MockBlockState)(nil).HasHeader), arg0) } @@ -295,7 +299,7 @@ func (m *MockBlockState) IsDescendantOf(arg0, arg1 common.Hash) (bool, error) { } // IsDescendantOf indicates an expected call of IsDescendantOf. -func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDescendantOf", reflect.TypeOf((*MockBlockState)(nil).IsDescendantOf), arg0, arg1) } @@ -310,7 +314,7 @@ func (m *MockBlockState) LowestCommonAncestor(arg0, arg1 common.Hash) (common.Ha } // LowestCommonAncestor indicates an expected call of LowestCommonAncestor. -func (mr *MockBlockStateMockRecorder) LowestCommonAncestor(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) LowestCommonAncestor(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LowestCommonAncestor", reflect.TypeOf((*MockBlockState)(nil).LowestCommonAncestor), arg0, arg1) } @@ -324,7 +328,7 @@ func (m *MockBlockState) SetFinalisedHash(arg0 common.Hash, arg1, arg2 uint64) e } // SetFinalisedHash indicates an expected call of SetFinalisedHash. -func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFinalisedHash", reflect.TypeOf((*MockBlockState)(nil).SetFinalisedHash), arg0, arg1, arg2) } @@ -338,7 +342,7 @@ func (m *MockBlockState) SetJustification(arg0 common.Hash, arg1 []byte) error { } // SetJustification indicates an expected call of SetJustification. -func (mr *MockBlockStateMockRecorder) SetJustification(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockBlockStateMockRecorder) SetJustification(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetJustification", reflect.TypeOf((*MockBlockState)(nil).SetJustification), arg0, arg1) } @@ -376,7 +380,7 @@ func (m *MockGrandpaState) GetAuthorities(arg0 uint64) ([]types.GrandpaVoter, er } // GetAuthorities indicates an expected call of GetAuthorities. -func (mr *MockGrandpaStateMockRecorder) GetAuthorities(arg0 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) GetAuthorities(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorities", reflect.TypeOf((*MockGrandpaState)(nil).GetAuthorities), arg0) } @@ -421,7 +425,7 @@ func (m *MockGrandpaState) GetPrecommits(arg0, arg1 uint64) ([]types.GrandpaSign } // GetPrecommits indicates an expected call of GetPrecommits. -func (mr *MockGrandpaStateMockRecorder) GetPrecommits(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) GetPrecommits(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrecommits", reflect.TypeOf((*MockGrandpaState)(nil).GetPrecommits), arg0, arg1) } @@ -436,7 +440,7 @@ func (m *MockGrandpaState) GetPrevotes(arg0, arg1 uint64) ([]types.GrandpaSigned } // GetPrevotes indicates an expected call of GetPrevotes. -func (mr *MockGrandpaStateMockRecorder) GetPrevotes(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) GetPrevotes(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrevotes", reflect.TypeOf((*MockGrandpaState)(nil).GetPrevotes), arg0, arg1) } @@ -451,7 +455,7 @@ func (m *MockGrandpaState) GetSetIDByBlockNumber(arg0 uint) (uint64, error) { } // GetSetIDByBlockNumber indicates an expected call of GetSetIDByBlockNumber. -func (mr *MockGrandpaStateMockRecorder) GetSetIDByBlockNumber(arg0 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) GetSetIDByBlockNumber(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSetIDByBlockNumber", reflect.TypeOf((*MockGrandpaState)(nil).GetSetIDByBlockNumber), arg0) } @@ -466,7 +470,7 @@ func (m *MockGrandpaState) NextGrandpaAuthorityChange(arg0 common.Hash, arg1 uin } // NextGrandpaAuthorityChange indicates an expected call of NextGrandpaAuthorityChange. -func (mr *MockGrandpaStateMockRecorder) NextGrandpaAuthorityChange(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) NextGrandpaAuthorityChange(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextGrandpaAuthorityChange", reflect.TypeOf((*MockGrandpaState)(nil).NextGrandpaAuthorityChange), arg0, arg1) } @@ -480,7 +484,7 @@ func (m *MockGrandpaState) SetLatestRound(arg0 uint64) error { } // SetLatestRound indicates an expected call of SetLatestRound. -func (mr *MockGrandpaStateMockRecorder) SetLatestRound(arg0 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) SetLatestRound(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLatestRound", reflect.TypeOf((*MockGrandpaState)(nil).SetLatestRound), arg0) } @@ -494,7 +498,7 @@ func (m *MockGrandpaState) SetPrecommits(arg0, arg1 uint64, arg2 []types.Grandpa } // SetPrecommits indicates an expected call of SetPrecommits. -func (mr *MockGrandpaStateMockRecorder) SetPrecommits(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) SetPrecommits(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPrecommits", reflect.TypeOf((*MockGrandpaState)(nil).SetPrecommits), arg0, arg1, arg2) } @@ -508,7 +512,7 @@ func (m *MockGrandpaState) SetPrevotes(arg0, arg1 uint64, arg2 []types.GrandpaSi } // SetPrevotes indicates an expected call of SetPrevotes. -func (mr *MockGrandpaStateMockRecorder) SetPrevotes(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockGrandpaStateMockRecorder) SetPrevotes(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPrevotes", reflect.TypeOf((*MockGrandpaState)(nil).SetPrevotes), arg0, arg1, arg2) } @@ -543,7 +547,7 @@ func (m *MockNetwork) GossipMessage(arg0 network.NotificationsMessage) { } // GossipMessage indicates an expected call of GossipMessage. -func (mr *MockNetworkMockRecorder) GossipMessage(arg0 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) GossipMessage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GossipMessage", reflect.TypeOf((*MockNetwork)(nil).GossipMessage), arg0) } @@ -557,7 +561,7 @@ func (m *MockNetwork) RegisterNotificationsProtocol(arg0 protocol.ID, arg1 netwo } // RegisterNotificationsProtocol indicates an expected call of RegisterNotificationsProtocol. -func (mr *MockNetworkMockRecorder) RegisterNotificationsProtocol(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) RegisterNotificationsProtocol(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterNotificationsProtocol", reflect.TypeOf((*MockNetwork)(nil).RegisterNotificationsProtocol), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } @@ -571,7 +575,7 @@ func (m *MockNetwork) SendMessage(arg0 peer.ID, arg1 network.NotificationsMessag } // SendMessage indicates an expected call of SendMessage. -func (mr *MockNetworkMockRecorder) SendMessage(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetworkMockRecorder) SendMessage(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockNetwork)(nil).SendMessage), arg0, arg1) } diff --git a/lib/grandpa/network_integration_test.go b/lib/grandpa/network_integration_test.go index 8a47516201..6b03ed8581 100644 --- a/lib/grandpa/network_integration_test.go +++ b/lib/grandpa/network_integration_test.go @@ -10,7 +10,7 @@ import ( "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" diff --git a/lib/grandpa/round_integration_test.go b/lib/grandpa/round_integration_test.go index a5dedcec6c..28dc481ba3 100644 --- a/lib/grandpa/round_integration_test.go +++ b/lib/grandpa/round_integration_test.go @@ -21,10 +21,10 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestGrandpa_DifferentChains(t *testing.T) { diff --git a/lib/grandpa/vote_message_test.go b/lib/grandpa/vote_message_test.go index d94e0e2b20..7c5539fa63 100644 --- a/lib/grandpa/vote_message_test.go +++ b/lib/grandpa/vote_message_test.go @@ -9,9 +9,9 @@ import ( "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/lib/common" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var ( diff --git a/lib/runtime/mocks/mocks.go b/lib/runtime/mocks/mocks.go index 22f87dbeff..0d0af3add9 100644 --- a/lib/runtime/mocks/mocks.go +++ b/lib/runtime/mocks/mocks.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Instance,TransactionState) - +// +// Generated by this command: +// +// mockgen -destination=mocks/mocks.go -package mocks . Instance,TransactionState +// // Package mocks is a generated GoMock package. package mocks @@ -13,7 +17,7 @@ import ( keystore "github.com/ChainSafe/gossamer/lib/keystore" runtime "github.com/ChainSafe/gossamer/lib/runtime" transaction "github.com/ChainSafe/gossamer/lib/transaction" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockInstance is a mock of Instance interface. @@ -49,7 +53,7 @@ func (m *MockInstance) ApplyExtrinsic(arg0 types.Extrinsic) ([]byte, error) { } // ApplyExtrinsic indicates an expected call of ApplyExtrinsic. -func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ApplyExtrinsic(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ApplyExtrinsic", reflect.TypeOf((*MockInstance)(nil).ApplyExtrinsic), arg0) } @@ -79,7 +83,7 @@ func (m *MockInstance) BabeGenerateKeyOwnershipProof(arg0 uint64, arg1 [32]byte) } // BabeGenerateKeyOwnershipProof indicates an expected call of BabeGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).BabeGenerateKeyOwnershipProof), arg0, arg1) } @@ -93,7 +97,7 @@ func (m *MockInstance) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0 types. } // BabeSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of BabeSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) BabeSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BabeSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).BabeSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -120,7 +124,7 @@ func (m *MockInstance) DecodeSessionKeys(arg0 []byte) ([]byte, error) { } // DecodeSessionKeys indicates an expected call of DecodeSessionKeys. -func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) DecodeSessionKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSessionKeys", reflect.TypeOf((*MockInstance)(nil).DecodeSessionKeys), arg0) } @@ -135,7 +139,7 @@ func (m *MockInstance) Exec(arg0 string, arg1 []byte) ([]byte, error) { } // Exec indicates an expected call of Exec. -func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) Exec(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockInstance)(nil).Exec), arg0, arg1) } @@ -150,7 +154,7 @@ func (m *MockInstance) ExecuteBlock(arg0 *types.Block) ([]byte, error) { } // ExecuteBlock indicates an expected call of ExecuteBlock. -func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ExecuteBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExecuteBlock", reflect.TypeOf((*MockInstance)(nil).ExecuteBlock), arg0) } @@ -221,7 +225,7 @@ func (m *MockInstance) GrandpaGenerateKeyOwnershipProof(arg0 uint64, arg1 ed2551 } // GrandpaGenerateKeyOwnershipProof indicates an expected call of GrandpaGenerateKeyOwnershipProof. -func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaGenerateKeyOwnershipProof(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaGenerateKeyOwnershipProof", reflect.TypeOf((*MockInstance)(nil).GrandpaGenerateKeyOwnershipProof), arg0, arg1) } @@ -235,7 +239,7 @@ func (m *MockInstance) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0 typ } // GrandpaSubmitReportEquivocationUnsignedExtrinsic indicates an expected call of GrandpaSubmitReportEquivocationUnsignedExtrinsic. -func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) GrandpaSubmitReportEquivocationUnsignedExtrinsic(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrandpaSubmitReportEquivocationUnsignedExtrinsic", reflect.TypeOf((*MockInstance)(nil).GrandpaSubmitReportEquivocationUnsignedExtrinsic), arg0, arg1) } @@ -250,7 +254,7 @@ func (m *MockInstance) InherentExtrinsics(arg0 []byte) ([]byte, error) { } // InherentExtrinsics indicates an expected call of InherentExtrinsics. -func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InherentExtrinsics(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InherentExtrinsics", reflect.TypeOf((*MockInstance)(nil).InherentExtrinsics), arg0) } @@ -264,7 +268,7 @@ func (m *MockInstance) InitializeBlock(arg0 *types.Header) error { } // InitializeBlock indicates an expected call of InitializeBlock. -func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) InitializeBlock(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeBlock", reflect.TypeOf((*MockInstance)(nil).InitializeBlock), arg0) } @@ -348,7 +352,7 @@ func (m *MockInstance) PaymentQueryInfo(arg0 []byte) (*types.RuntimeDispatchInfo } // PaymentQueryInfo indicates an expected call of PaymentQueryInfo. -func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) PaymentQueryInfo(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaymentQueryInfo", reflect.TypeOf((*MockInstance)(nil).PaymentQueryInfo), arg0) } @@ -372,7 +376,7 @@ func (m *MockInstance) SetContextStorage(arg0 runtime.Storage) { } // SetContextStorage indicates an expected call of SetContextStorage. -func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) SetContextStorage(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetContextStorage", reflect.TypeOf((*MockInstance)(nil).SetContextStorage), arg0) } @@ -399,7 +403,7 @@ func (m *MockInstance) ValidateTransaction(arg0 types.Extrinsic) (*transaction.V } // ValidateTransaction indicates an expected call of ValidateTransaction. -func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 interface{}) *gomock.Call { +func (mr *MockInstanceMockRecorder) ValidateTransaction(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateTransaction", reflect.TypeOf((*MockInstance)(nil).ValidateTransaction), arg0) } @@ -465,7 +469,7 @@ func (m *MockTransactionState) AddToPool(arg0 *transaction.ValidTransaction) com } // AddToPool indicates an expected call of AddToPool. -func (mr *MockTransactionStateMockRecorder) AddToPool(arg0 interface{}) *gomock.Call { +func (mr *MockTransactionStateMockRecorder) AddToPool(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddToPool", reflect.TypeOf((*MockTransactionState)(nil).AddToPool), arg0) } diff --git a/lib/runtime/mocks_test.go b/lib/runtime/mocks_test.go index c0a6f67005..25734976fb 100644 --- a/lib/runtime/mocks_test.go +++ b/lib/runtime/mocks_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/runtime (interfaces: Memory) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package runtime . Memory +// // Package runtime is a generated GoMock package. package runtime import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockMemory is a mock of Memory interface. @@ -43,7 +47,7 @@ func (m *MockMemory) Grow(arg0 uint32) (uint32, bool) { } // Grow indicates an expected call of Grow. -func (mr *MockMemoryMockRecorder) Grow(arg0 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) Grow(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Grow", reflect.TypeOf((*MockMemory)(nil).Grow), arg0) } @@ -58,7 +62,7 @@ func (m *MockMemory) Read(arg0, arg1 uint32) ([]byte, bool) { } // Read indicates an expected call of Read. -func (mr *MockMemoryMockRecorder) Read(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) Read(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockMemory)(nil).Read), arg0, arg1) } @@ -73,7 +77,7 @@ func (m *MockMemory) ReadByte(arg0 uint32) (byte, bool) { } // ReadByte indicates an expected call of ReadByte. -func (mr *MockMemoryMockRecorder) ReadByte(arg0 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) ReadByte(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadByte", reflect.TypeOf((*MockMemory)(nil).ReadByte), arg0) } @@ -88,7 +92,7 @@ func (m *MockMemory) ReadUint64Le(arg0 uint32) (uint64, bool) { } // ReadUint64Le indicates an expected call of ReadUint64Le. -func (mr *MockMemoryMockRecorder) ReadUint64Le(arg0 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) ReadUint64Le(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadUint64Le", reflect.TypeOf((*MockMemory)(nil).ReadUint64Le), arg0) } @@ -116,7 +120,7 @@ func (m *MockMemory) Write(arg0 uint32, arg1 []byte) bool { } // Write indicates an expected call of Write. -func (mr *MockMemoryMockRecorder) Write(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) Write(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockMemory)(nil).Write), arg0, arg1) } @@ -130,7 +134,7 @@ func (m *MockMemory) WriteByte(arg0 uint32, arg1 byte) bool { } // WriteByte indicates an expected call of WriteByte. -func (mr *MockMemoryMockRecorder) WriteByte(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) WriteByte(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteByte", reflect.TypeOf((*MockMemory)(nil).WriteByte), arg0, arg1) } @@ -144,7 +148,7 @@ func (m *MockMemory) WriteUint64Le(arg0 uint32, arg1 uint64) bool { } // WriteUint64Le indicates an expected call of WriteUint64Le. -func (mr *MockMemoryMockRecorder) WriteUint64Le(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockMemoryMockRecorder) WriteUint64Le(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteUint64Le", reflect.TypeOf((*MockMemory)(nil).WriteUint64Le), arg0, arg1) } diff --git a/lib/runtime/wazero/test_helpers.go b/lib/runtime/wazero/test_helpers.go index fe752d3238..970a62dc42 100644 --- a/lib/runtime/wazero/test_helpers.go +++ b/lib/runtime/wazero/test_helpers.go @@ -17,8 +17,8 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime/mocks" "github.com/ChainSafe/gossamer/lib/runtime/storage" "github.com/ChainSafe/gossamer/lib/trie" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) // NewTestInstance will create a new runtime instance using the given target runtime diff --git a/lib/services/mocks_test.go b/lib/services/mocks_test.go index ab09a2cb8c..d4e843214c 100644 --- a/lib/services/mocks_test.go +++ b/lib/services/mocks_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/services (interfaces: Service) - +// +// Generated by this command: +// +// mockgen -destination=mocks_test.go -package services . Service +// // Package services is a generated GoMock package. package services import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockService is a mock of Service interface. diff --git a/lib/services/services_test.go b/lib/services/services_test.go index c7ed5b0aac..7e06d7bba2 100644 --- a/lib/services/services_test.go +++ b/lib/services/services_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/ChainSafe/gossamer/internal/log" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func TestServiceRegistry_RegisterService(t *testing.T) { diff --git a/lib/trie/db_getter_mocks_test.go b/lib/trie/db_getter_mocks_test.go index ecf5a52dbb..ef2b5ab372 100644 --- a/lib/trie/db_getter_mocks_test.go +++ b/lib/trie/db_getter_mocks_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/trie/db (interfaces: DBGetter) - +// +// Generated by this command: +// +// mockgen -destination=db_getter_mocks_test.go -package=trie github.com/ChainSafe/gossamer/lib/trie/db DBGetter +// // Package trie is a generated GoMock package. package trie import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDBGetter is a mock of DBGetter interface. @@ -43,7 +47,7 @@ func (m *MockDBGetter) Get(arg0 []byte) ([]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockDBGetterMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockDBGetterMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockDBGetter)(nil).Get), arg0) } diff --git a/lib/trie/proof/database_mocks_test.go b/lib/trie/proof/database_mocks_test.go index 7a4a6d31a8..724f3b2f25 100644 --- a/lib/trie/proof/database_mocks_test.go +++ b/lib/trie/proof/database_mocks_test.go @@ -1,13 +1,17 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ChainSafe/gossamer/lib/trie/db (interfaces: DBGetter) - +// +// Generated by this command: +// +// mockgen -destination=database_mocks_test.go -package=proof github.com/ChainSafe/gossamer/lib/trie/db DBGetter +// // Package proof is a generated GoMock package. package proof import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockDBGetter is a mock of DBGetter interface. @@ -43,7 +47,7 @@ func (m *MockDBGetter) Get(arg0 []byte) ([]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockDBGetterMockRecorder) Get(arg0 interface{}) *gomock.Call { +func (mr *MockDBGetterMockRecorder) Get(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockDBGetter)(nil).Get), arg0) } diff --git a/lib/trie/proof/generate_test.go b/lib/trie/proof/generate_test.go index 1390b1d08a..44e3c118d2 100644 --- a/lib/trie/proof/generate_test.go +++ b/lib/trie/proof/generate_test.go @@ -11,9 +11,9 @@ import ( "github.com/ChainSafe/gossamer/internal/trie/node" "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/lib/trie/db" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_Generate(t *testing.T) { diff --git a/lib/trie/trie_test.go b/lib/trie/trie_test.go index 6dfbb19064..7c78e3afb2 100644 --- a/lib/trie/trie_test.go +++ b/lib/trie/trie_test.go @@ -13,9 +13,9 @@ import ( "github.com/ChainSafe/gossamer/internal/trie/tracking" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/trie/db" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) func Test_EmptyHash(t *testing.T) {