From dd12623d67f7ba23ced6cf931ee2a4cb3c6af4b7 Mon Sep 17 00:00:00 2001 From: Kishan Sagathiya Date: Wed, 22 Nov 2023 08:04:36 +0530 Subject: [PATCH 01/19] chore: some quick deepsource fixes (#3602) - removed unused digest handler arg from `createCoreService` - fixed the suspicious `b := &tt.verifier` --- dot/mock_node_builder_test.go | 8 ++++---- dot/node.go | 4 ++-- dot/node_integration_test.go | 2 +- dot/services.go | 2 +- dot/services_integration_test.go | 28 ++++++------------------- dot/utils_test.go | 2 +- internal/pprof/server_test.go | 2 +- lib/babe/verify_test.go | 35 +++++++++++++------------------- 8 files changed, 30 insertions(+), 53 deletions(-) diff --git a/dot/mock_node_builder_test.go b/dot/mock_node_builder_test.go index 2f52ae3118..25fa1250c6 100644 --- a/dot/mock_node_builder_test.go +++ b/dot/mock_node_builder_test.go @@ -76,18 +76,18 @@ func (mr *MocknodeBuilderIfaceMockRecorder) createBlockVerifier(st interface{}) } // createCoreService mocks base method. -func (m *MocknodeBuilderIface) createCoreService(config *config.Config, ks *keystore.GlobalKeystore, st *state.Service, net *network.Service, dh *digest.Handler) (*core.Service, error) { +func (m *MocknodeBuilderIface) createCoreService(config *config.Config, ks *keystore.GlobalKeystore, st *state.Service, net *network.Service) (*core.Service, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "createCoreService", config, ks, st, net, dh) + ret := m.ctrl.Call(m, "createCoreService", config, ks, st, net) ret0, _ := ret[0].(*core.Service) ret1, _ := ret[1].(error) return ret0, ret1 } // createCoreService indicates an expected call of createCoreService. -func (mr *MocknodeBuilderIfaceMockRecorder) createCoreService(config, ks, st, net, dh interface{}) *gomock.Call { +func (mr *MocknodeBuilderIfaceMockRecorder) createCoreService(config, ks, st, net interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createCoreService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createCoreService), config, ks, st, net, dh) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "createCoreService", reflect.TypeOf((*MocknodeBuilderIface)(nil).createCoreService), config, ks, st, net) } // createDigestHandler mocks base method. diff --git a/dot/node.go b/dot/node.go index 0ff83f2f1a..129dfaa06d 100644 --- a/dot/node.go +++ b/dot/node.go @@ -60,7 +60,7 @@ type nodeBuilderIface interface { createBlockVerifier(st *state.Service) *babe.VerificationManager createDigestHandler(st *state.Service) (*digest.Handler, error) createCoreService(config *cfg.Config, ks *keystore.GlobalKeystore, st *state.Service, net *network.Service, - dh *digest.Handler) (*core.Service, error) + ) (*core.Service, error) createGRANDPAService(config *cfg.Config, st *state.Service, ks KeyStore, net *network.Service, telemetryMailer Telemetry) (*grandpa.Service, error) newSyncService(config *cfg.Config, st *state.Service, finalityGadget BlockJustificationVerifier, @@ -367,7 +367,7 @@ func newNode(config *cfg.Config, } nodeSrvcs = append(nodeSrvcs, dh) - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc) if err != nil { return nil, fmt.Errorf("failed to create core service: %s", err) } diff --git a/dot/node_integration_test.go b/dot/node_integration_test.go index aad81b1331..a8eedf2782 100644 --- a/dot/node_integration_test.go +++ b/dot/node_integration_test.go @@ -128,7 +128,7 @@ func TestNewNode(t *testing.T) { m.EXPECT().createDigestHandler(gomock.AssignableToTypeOf(&state.Service{})). Return(&digest.Handler{}, nil) m.EXPECT().createCoreService(initConfig, ks, gomock.AssignableToTypeOf(&state.Service{}), - gomock.AssignableToTypeOf(&network.Service{}), &digest.Handler{}). + gomock.AssignableToTypeOf(&network.Service{})). Return(&core.Service{}, nil) m.EXPECT().createGRANDPAService(initConfig, gomock.AssignableToTypeOf(&state.Service{}), ks.Gran, gomock.AssignableToTypeOf(&network.Service{}), diff --git a/dot/services.go b/dot/services.go index 300026fd44..c6200f86a8 100644 --- a/dot/services.go +++ b/dot/services.go @@ -246,7 +246,7 @@ func (nodeBuilder) createBABEServiceWithBuilder(config *cfg.Config, st *state.Se // createCoreService creates the core service from the provided core configuration func (nodeBuilder) createCoreService(config *cfg.Config, ks *keystore.GlobalKeystore, - st *state.Service, net *network.Service, dh *digest.Handler) ( + st *state.Service, net *network.Service) ( *core.Service, error) { logger.Debug("creating core service" + asAuthority(config.Core.Role == common.AuthorityRole) + diff --git a/dot/services_integration_test.go b/dot/services_integration_test.go index c8bbfceeef..37d53a2aff 100644 --- a/dot/services_integration_test.go +++ b/dot/services_integration_test.go @@ -13,7 +13,6 @@ import ( cfg "github.com/ChainSafe/gossamer/config" core "github.com/ChainSafe/gossamer/dot/core" - digest "github.com/ChainSafe/gossamer/dot/digest" "github.com/ChainSafe/gossamer/dot/network" rpc "github.com/ChainSafe/gossamer/dot/rpc" "github.com/ChainSafe/gossamer/dot/state" @@ -135,7 +134,6 @@ func Test_nodeBuilder_createCoreService(t *testing.T) { type args struct { ks *keystore.GlobalKeystore net *network.Service - dh *digest.Handler } tests := []struct { name string @@ -163,7 +161,7 @@ func Test_nodeBuilder_createCoreService(t *testing.T) { stateSrvc := newStateService(t, ctrl) builder := nodeBuilder{} - got, err := builder.createCoreService(config, tt.args.ks, stateSrvc, tt.args.net, tt.args.dh) + got, err := builder.createCoreService(config, tt.args.ks, stateSrvc, tt.args.net) assert.ErrorIs(t, err, tt.err) @@ -508,10 +506,8 @@ func TestCreateCoreService(t *testing.T) { networkSrvc := &network.Service{} builder := nodeBuilder{} - dh, err := builder.createDigestHandler(stateSrvc) - require.NoError(t, err) - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc) require.NoError(t, err) require.NotNil(t, coreSrvc) } @@ -554,16 +550,13 @@ func TestCreateSyncService(t *testing.T) { ver := builder.createBlockVerifier(stateSrvc) - dh, err := builder.createDigestHandler(stateSrvc) - require.NoError(t, err) - networkService, err := network.NewService(&network.Config{ BlockState: stateSrvc.Block, BasePath: config.BasePath, }) require.NoError(t, err) - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkService, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkService) require.NoError(t, err) _, err = builder.newSyncService(config, stateSrvc, &grandpa.Service{}, ver, coreSrvc, networkService, nil) @@ -615,10 +608,7 @@ func TestCreateRPCService(t *testing.T) { err = builder.loadRuntime(config, ns, stateSrvc, ks, networkSrvc) require.NoError(t, err) - dh, err := builder.createDigestHandler(stateSrvc) - require.NoError(t, err) - - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc) require.NoError(t, err) systemInfo := &types.SystemInfo{ @@ -665,10 +655,7 @@ func TestCreateBABEService_Integration(t *testing.T) { err = builder.loadRuntime(config, ns, stateSrvc, ks, &network.Service{}) require.NoError(t, err) - dh, err := builder.createDigestHandler(stateSrvc) - require.NoError(t, err) - - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, &network.Service{}, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, &network.Service{}) require.NoError(t, err) bs, err := builder.createBABEService(config, stateSrvc, ks.Babe, coreSrvc, nil) @@ -774,10 +761,7 @@ func TestNewWebSocketServer(t *testing.T) { err = builder.loadRuntime(config, ns, stateSrvc, ks, networkSrvc) require.NoError(t, err) - dh, err := builder.createDigestHandler(stateSrvc) - require.NoError(t, err) - - coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc, dh) + coreSrvc, err := builder.createCoreService(config, ks, stateSrvc, networkSrvc) require.NoError(t, err) systemInfo := &types.SystemInfo{ diff --git a/dot/utils_test.go b/dot/utils_test.go index 43e344b4cd..260615dfa3 100644 --- a/dot/utils_test.go +++ b/dot/utils_test.go @@ -31,7 +31,7 @@ func TestCreateJSONRawFile(t *testing.T) { name: "working_example", args: args{ bs: &BuildSpec{genesis: NewTestGenesis(t)}, - fp: filepath.Join(t.TempDir(), "/test.json"), + fp: filepath.Join(t.TempDir(), "test.json"), }, expectedHash: "f7f1b82c0ba16b20e36bfb462d7899af2c76728918f639f5c5ef0e91ff3e7077", }, diff --git a/internal/pprof/server_test.go b/internal/pprof/server_test.go index 5b809867e6..e9b92603fe 100644 --- a/internal/pprof/server_test.go +++ b/internal/pprof/server_test.go @@ -71,7 +71,7 @@ func Test_Server(t *testing.T) { for _, pathToCheck := range pathsToCheck { url := "http://" + serverAddress + "/" + pathToCheck - request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody) require.NoError(t, err) go func(client *http.Client, request *http.Request, results chan<- httpResult) { diff --git a/lib/babe/verify_test.go b/lib/babe/verify_test.go index 7e246d01ae..2fcf9695b3 100644 --- a/lib/babe/verify_test.go +++ b/lib/babe/verify_test.go @@ -231,8 +231,6 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { } mockSlotState := NewMockSlotState(nil) - v := newVerifier(mockBlockState, mockSlotState, 1, vi, time.Second) - v1 := newVerifier(mockBlockState, mockSlotState, 1, vi1, time.Second) output, proof, err := kp.VrfSign(makeTranscript(Randomness{}, uint64(1), 1)) assert.NoError(t, err) @@ -252,7 +250,7 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { }{ { name: "Over threshold", - verifier: *v, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, vi, time.Second), args: args{ slot: 1, vrfOutput: [32]byte{}, @@ -262,7 +260,7 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { }, { name: "VRF not verified", - verifier: *v1, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, vi1, time.Second), args: args{ slot: 1, vrfOutput: [32]byte{}, @@ -271,7 +269,7 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { }, { name: "VRF verified", - verifier: *v1, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, vi1, time.Second), args: args{ slot: 1, vrfOutput: output, @@ -281,9 +279,10 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { - b := &tt.verifier - res, err := b.verifyPrimarySlotWinner(tt.args.authorityIndex, tt.args.slot, tt.args.vrfOutput, tt.args.vrfProof) + res, err := tt.verifier.verifyPrimarySlotWinner(tt.args.authorityIndex, tt.args.slot, + tt.args.vrfOutput, tt.args.vrfProof) if tt.expErr != nil { assert.EqualError(t, err, tt.expErr.Error()) } else { @@ -363,9 +362,6 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { secondarySlots: true, } - vVRFSec := newVerifier(mockBlockState, mockSlotState, 1, viVRFSec, testSlotDuration) - vVRFSec2 := newVerifier(mockBlockState, mockSlotState, 1, viVRFSec2, testSlotDuration) - //BabeSecondaryPlainPreDigest case secDigest := types.BabeSecondaryPlainPreDigest{AuthorityIndex: 0, SlotNumber: uint64(1)} prd, err := secDigest.ToPreRuntimeDigest() @@ -383,9 +379,6 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { secondarySlots: true, } - vSec := newVerifier(mockBlockState, mockSlotState, 1, viSec, testSlotDuration) - vSec2 := newVerifier(mockBlockState, mockSlotState, 1, viSec2, testSlotDuration) - type args struct { digest *types.PreRuntimeDigest } @@ -433,33 +426,33 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { }, { name: "BabeSecondaryPlainPreDigest SecondarySlot false", - verifier: *vSec, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, viSec, testSlotDuration), args: args{prd}, expErr: ErrBadSlotClaim, }, { name: "BabeSecondaryPlainPreDigest invalid claim", - verifier: *vSec2, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, viSec2, testSlotDuration), args: args{prd}, expErr: errors.New("invalid secondary slot claim"), }, { name: "BabeSecondaryVRFPreDigest SecondarySlot false", - verifier: *vVRFSec, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, viVRFSec, testSlotDuration), args: args{babePRD}, expErr: ErrBadSlotClaim, }, { name: "BabeSecondaryVRFPreDigest invalid claim", - verifier: *vVRFSec2, + verifier: *newVerifier(mockBlockState, mockSlotState, 1, viVRFSec2, testSlotDuration), args: args{babePRD}, expErr: errors.New("invalid secondary slot claim"), }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { - b := &tt.verifier - res, err := b.verifyPreRuntimeDigest(tt.args.digest) + res, err := tt.verifier.verifyPreRuntimeDigest(tt.args.digest) if tt.expErr != nil { assert.EqualError(t, err, tt.expErr.Error()) } else { @@ -668,9 +661,9 @@ func Test_verifier_verifyAuthorshipRight(t *testing.T) { }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { - b := &tt.verifier - err := b.verifyAuthorshipRight(tt.header) + err := tt.verifier.verifyAuthorshipRight(tt.header) if tt.expErr != nil { assert.EqualError(t, err, tt.expErr.Error()) } else { From 2954fc0b2c49eee6e93d5ac82ae5cae2c6bff440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Wed, 29 Nov 2023 08:49:29 -0400 Subject: [PATCH 02/19] fix(dot/sync): verify justification before importing blocks (#3576) --- dot/interfaces.go | 2 +- dot/network/message.go | 2 +- dot/sync/chain_sync.go | 114 ++++++------------ dot/sync/chain_sync_test.go | 92 +++++++++++++- dot/sync/interfaces.go | 4 +- dot/sync/mocks_test.go | 37 +++--- dot/sync/syncer_integration_test.go | 7 +- lib/grandpa/message_handler.go | 64 +++++----- .../message_handler_integration_test.go | 29 ++--- lib/grandpa/votes_tracker_test.go | 6 + 10 files changed, 204 insertions(+), 153 deletions(-) diff --git a/dot/interfaces.go b/dot/interfaces.go index 33beecb61c..880b258f26 100644 --- a/dot/interfaces.go +++ b/dot/interfaces.go @@ -27,7 +27,7 @@ type ServiceRegisterer interface { // BlockJustificationVerifier has a verification method for block justifications. type BlockJustificationVerifier interface { - VerifyBlockJustification(common.Hash, []byte) error + VerifyBlockJustification(common.Hash, []byte) (round uint64, setID uint64, err error) } // Telemetry is the telemetry client to send telemetry messages. diff --git a/dot/network/message.go b/dot/network/message.go index 14768f6514..66f689db74 100644 --- a/dot/network/message.go +++ b/dot/network/message.go @@ -388,7 +388,7 @@ func NewAscendingBlockRequests(startNumber, targetNumber uint, requestedData byt numRequests := diff / MaxBlocksInResponse // we should check if the diff is in the maxResponseSize bounds // otherwise we should increase the numRequests by one, take this - // example, we want to sync from 0 to 259, the diff is 259 + // example, we want to sync from 1 to 259, the diff is 259 // then the num of requests is 2 (uint(259)/uint(128)) however two requests will // retrieve only 256 blocks (each request can retrieve a max of 128 blocks), so we should // create one more request to retrieve those missing blocks, 3 in this example. diff --git a/dot/sync/chain_sync.go b/dot/sync/chain_sync.go index 68da2fa83c..6f104c48c8 100644 --- a/dot/sync/chain_sync.go +++ b/dot/sync/chain_sync.go @@ -23,7 +23,6 @@ import ( "github.com/ChainSafe/gossamer/dot/telemetry" "github.com/ChainSafe/gossamer/dot/types" "github.com/ChainSafe/gossamer/internal/database" - "github.com/ChainSafe/gossamer/lib/blocktree" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/common/variadic" "github.com/ChainSafe/gossamer/lib/trie" @@ -795,28 +794,19 @@ func (cs *chainSync) handleReadyBlock(bd *types.BlockData) error { // returns the index of the last BlockData it handled on success, // or the index of the block data that errored on failure. func (cs *chainSync) processBlockData(blockData types.BlockData) error { - headerInState, err := cs.blockState.HasHeader(blockData.Hash) - if err != nil { - return fmt.Errorf("checking if block state has header: %w", err) - } - - bodyInState, err := cs.blockState.HasBlockBody(blockData.Hash) - if err != nil { - return fmt.Errorf("checking if block state has body: %w", err) - } - // while in bootstrap mode we don't need to broadcast block announcements announceImportedBlock := cs.getSyncMode() == tip - if headerInState && bodyInState { - err = cs.processBlockDataWithStateHeaderAndBody(blockData, announceImportedBlock) - if err != nil { - return fmt.Errorf("processing block data with header and "+ - "body in block state: %w", err) - } - return nil + var blockDataJustification []byte + if blockData.Justification != nil { + blockDataJustification = *blockData.Justification } if blockData.Header != nil { + round, setID, err := cs.verifyJustification(blockData.Header.Hash(), blockDataJustification) + if err != nil { + return err + } + if blockData.Body != nil { err = cs.processBlockDataWithHeaderAndBody(blockData, announceImportedBlock) if err != nil { @@ -824,16 +814,16 @@ func (cs *chainSync) processBlockData(blockData types.BlockData) error { } } - if blockData.Justification != nil && len(*blockData.Justification) > 0 { - logger.Infof("handling justification for block %s (#%d)", blockData.Hash.Short(), blockData.Number()) - err = cs.handleJustification(blockData.Header, *blockData.Justification) - if err != nil { - return fmt.Errorf("handling justification: %w", err) - } + err = cs.finalizeAndSetJustification( + blockData.Header, + round, setID, + blockDataJustification) + if err != nil { + return fmt.Errorf("while setting justification: %w", err) } } - err = cs.blockState.CompareAndSetBlockData(&blockData) + err := cs.blockState.CompareAndSetBlockData(&blockData) if err != nil { return fmt.Errorf("comparing and setting block data: %w", err) } @@ -841,48 +831,14 @@ func (cs *chainSync) processBlockData(blockData types.BlockData) error { return nil } -func (cs *chainSync) processBlockDataWithStateHeaderAndBody(blockData types.BlockData, - announceImportedBlock bool) (err error) { - // TODO: fix this; sometimes when the node shuts down the "best block" isn't stored properly, - // so when the node restarts it has blocks higher than what it thinks is the best, causing it not to sync - // if we update the node to only store finalised blocks in the database, this should be fixed and the entire - // code block can be removed (#1784) - block, err := cs.blockState.GetBlockByHash(blockData.Hash) - if err != nil { - return fmt.Errorf("getting block by hash: %w", err) - } - - err = cs.blockState.AddBlockToBlockTree(block) - if errors.Is(err, blocktree.ErrBlockExists) { - logger.Debugf( - "block number %d with hash %s already exists in block tree, skipping it.", - block.Header.Number, blockData.Hash) - return nil - } else if err != nil { - return fmt.Errorf("adding block to blocktree: %w", err) - } - - if blockData.Justification != nil && len(*blockData.Justification) > 0 { - err = cs.handleJustification(&block.Header, *blockData.Justification) - if err != nil { - return fmt.Errorf("handling justification: %w", err) - } - } - - // TODO: this is probably unnecessary, since the state is already in the database - // however, this case shouldn't be hit often, since it's only hit if the node state - // is rewinded or if the node shuts down unexpectedly (#1784) - state, err := cs.storageState.TrieState(&block.Header.StateRoot) - if err != nil { - return fmt.Errorf("loading trie state: %w", err) - } - - err = cs.blockImportHandler.HandleBlockImport(block, state, announceImportedBlock) - if err != nil { - return fmt.Errorf("handling block import: %w", err) +func (cs *chainSync) verifyJustification(headerHash common.Hash, justification []byte) ( + round uint64, setID uint64, err error) { + if len(justification) > 0 { + round, setID, err = cs.finalityGadget.VerifyBlockJustification(headerHash, justification) + return round, setID, err } - return nil + return 0, 0, nil } func (cs *chainSync) processBlockDataWithHeaderAndBody(blockData types.BlockData, @@ -918,21 +874,27 @@ func (cs *chainSync) handleBody(body *types.Body) { blockSizeGauge.Set(float64(acc)) } -func (cs *chainSync) handleJustification(header *types.Header, justification []byte) (err error) { - logger.Debugf("handling justification for block %d...", header.Number) +func (cs *chainSync) finalizeAndSetJustification(header *types.Header, + round, setID uint64, justification []byte) (err error) { + if len(justification) > 0 { + err = cs.blockState.SetFinalisedHash(header.Hash(), round, setID) + if err != nil { + return fmt.Errorf("setting finalised hash: %w", err) + } - headerHash := header.Hash() - err = cs.finalityGadget.VerifyBlockJustification(headerHash, justification) - if err != nil { - return fmt.Errorf("verifying block number %d justification: %w", header.Number, err) - } + logger.Debugf( + "finalised block with hash #%d (%s), round %d and set id %d", + header.Number, header.Hash(), round, setID) - err = cs.blockState.SetJustification(headerHash, justification) - if err != nil { - return fmt.Errorf("setting justification for block number %d: %w", header.Number, err) + err = cs.blockState.SetJustification(header.Hash(), justification) + if err != nil { + return fmt.Errorf("setting justification for block number %d: %w", + header.Number, err) + } + + logger.Infof("🔨 finalised block number #%d (%s)", header.Number, header.Hash()) } - logger.Infof("🔨 finalised block number %d with hash %s", header.Number, headerHash) return nil } diff --git a/dot/sync/chain_sync_test.go b/dot/sync/chain_sync_test.go index fb932a8c60..27f8bb5845 100644 --- a/dot/sync/chain_sync_test.go +++ b/dot/sync/chain_sync_test.go @@ -1288,8 +1288,6 @@ func ensureSuccessfulBlockImportFlow(t *testing.T, parentHeader *types.Header, t.Helper() for idx, blockData := range blocksReceived { - mockBlockState.EXPECT().HasHeader(blockData.Header.Hash()).Return(false, nil) - mockBlockState.EXPECT().HasBlockBody(blockData.Header.Hash()).Return(false, nil) mockBabeVerifier.EXPECT().VerifyBlock(blockData.Header).Return(nil) var previousHeader *types.Header @@ -1676,3 +1674,93 @@ func TestChainSync_getHighestBlock(t *testing.T) { }) } } + +func TestChainSync_BootstrapSync_SuccessfulSync_WithInvalidJusticationBlock(t *testing.T) { + t.Parallel() + + ctrl := gomock.NewController(t) + mockBlockState := NewMockBlockState(ctrl) + mockBlockState.EXPECT().GetFinalisedNotifierChannel().Return(make(chan *types.FinalisationInfo)) + mockedGenesisHeader := types.NewHeader(common.NewHash([]byte{0}), trie.EmptyHash, + trie.EmptyHash, 0, types.NewDigest()) + + mockNetwork := NewMockNetwork(ctrl) + mockRequestMaker := NewMockRequestMaker(ctrl) + + mockBabeVerifier := NewMockBabeVerifier(ctrl) + mockStorageState := NewMockStorageState(ctrl) + mockImportHandler := NewMockBlockImportHandler(ctrl) + mockTelemetry := NewMockTelemetry(ctrl) + mockFinalityGadget := NewMockFinalityGadget(ctrl) + + // this test expects two workers responding each request with 128 blocks which means + // we should import 256 blocks in total + blockResponse := createSuccesfullBlockResponse(t, mockedGenesisHeader.Hash(), 1, 129) + const announceBlock = false + + invalidJustificationBlock := blockResponse.BlockData[90] + invalidJustification := &[]byte{0x01, 0x01, 0x01, 0x02} + invalidJustificationBlock.Justification = invalidJustification + + // here we split the whole set in two parts each one will be the "response" for each peer + worker1Response := &network.BlockResponseMessage{ + BlockData: blockResponse.BlockData[:128], + } + + // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow + // will setup the expectations starting from the genesis header until block 128 + ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData[:90], mockBlockState, + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + + errVerifyBlockJustification := errors.New("VerifyBlockJustification mock error") + mockFinalityGadget.EXPECT(). + VerifyBlockJustification( + invalidJustificationBlock.Header.Hash(), + *invalidJustification). + Return(uint64(0), uint64(0), errVerifyBlockJustification) + + // we use gomock.Any since I cannot guarantee which peer picks which request + // but the first call to DoBlockRequest will return the first set and the second + // call will return the second set + mockRequestMaker.EXPECT(). + Do(gomock.Any(), gomock.Any(), &network.BlockResponseMessage{}). + DoAndReturn(func(peerID, _, response any) any { + responsePtr := response.(*network.BlockResponseMessage) + *responsePtr = *worker1Response + + fmt.Println("mocked request maker") + return nil + }) + + // setup a chain sync which holds in its peer view map + // 3 peers, each one announce block 129 as its best block number. + // We start this test with genesis block being our best block, so + // we're far behind by 128 blocks, we should execute a bootstrap + // sync request those blocks + const blocksAhead = 128 + cs := setupChainSyncToBootstrapMode(t, blocksAhead, + mockBlockState, mockNetwork, mockRequestMaker, mockBabeVerifier, + mockStorageState, mockImportHandler, mockTelemetry) + + cs.finalityGadget = mockFinalityGadget + + target, err := cs.getTarget() + require.NoError(t, err) + require.Equal(t, uint(blocksAhead), target) + + // include a new worker in the worker pool set, this worker + // should be an available peer that will receive a block request + // the worker pool executes the workers management + cs.workerPool.fromBlockAnnounce(peer.ID("alice")) + //cs.workerPool.fromBlockAnnounce(peer.ID("bob")) + + err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + require.ErrorIs(t, err, errVerifyBlockJustification) + + err = cs.workerPool.stop() + require.NoError(t, err) + + // peer should be not in the worker pool + // peer should be in the ignore list + require.Len(t, cs.workerPool.workers, 1) +} diff --git a/dot/sync/interfaces.go b/dot/sync/interfaces.go index 806eedb659..29ac858ee6 100644 --- a/dot/sync/interfaces.go +++ b/dot/sync/interfaces.go @@ -20,7 +20,6 @@ type BlockState interface { BestBlockHeader() (*types.Header, error) BestBlockNumber() (number uint, err error) CompareAndSetBlockData(bd *types.BlockData) error - HasBlockBody(hash common.Hash) (bool, error) GetBlockBody(common.Hash) (*types.Body, error) GetHeader(common.Hash) (*types.Header, error) HasHeader(hash common.Hash) (bool, error) @@ -40,6 +39,7 @@ type BlockState interface { GetHeaderByNumber(num uint) (*types.Header, error) GetAllBlocksAtNumber(num uint) ([]common.Hash, error) IsDescendantOf(parent, child common.Hash) (bool, error) + SetFinalisedHash(common.Hash, uint64, uint64) error } // StorageState is the interface for the storage state @@ -60,7 +60,7 @@ type BabeVerifier interface { // FinalityGadget implements justification verification functionality type FinalityGadget interface { - VerifyBlockJustification(common.Hash, []byte) error + VerifyBlockJustification(common.Hash, []byte) (round uint64, setID uint64, err error) } // BlockImportHandler is the interface for the handler of newly imported blocks diff --git a/dot/sync/mocks_test.go b/dot/sync/mocks_test.go index 53350f11bc..8335588e01 100644 --- a/dot/sync/mocks_test.go +++ b/dot/sync/mocks_test.go @@ -276,21 +276,6 @@ func (mr *MockBlockStateMockRecorder) GetRuntime(arg0 interface{}) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuntime", reflect.TypeOf((*MockBlockState)(nil).GetRuntime), arg0) } -// HasBlockBody mocks base method. -func (m *MockBlockState) HasBlockBody(arg0 common.Hash) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HasBlockBody", arg0) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// HasBlockBody indicates an expected call of HasBlockBody. -func (mr *MockBlockStateMockRecorder) HasBlockBody(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBlockBody", reflect.TypeOf((*MockBlockState)(nil).HasBlockBody), arg0) -} - // HasHeader mocks base method. func (m *MockBlockState) HasHeader(arg0 common.Hash) (bool, error) { m.ctrl.T.Helper() @@ -351,6 +336,20 @@ func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockState)(nil).RangeInMemory), arg0, arg1) } +// SetFinalisedHash mocks base method. +func (m *MockBlockState) SetFinalisedHash(arg0 common.Hash, arg1, arg2 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetFinalisedHash", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetFinalisedHash indicates an expected call of SetFinalisedHash. +func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFinalisedHash", reflect.TypeOf((*MockBlockState)(nil).SetFinalisedHash), arg0, arg1, arg2) +} + // SetJustification mocks base method. func (m *MockBlockState) SetJustification(arg0 common.Hash, arg1 []byte) error { m.ctrl.T.Helper() @@ -535,11 +534,13 @@ func (m *MockFinalityGadget) EXPECT() *MockFinalityGadgetMockRecorder { } // VerifyBlockJustification mocks base method. -func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) error { +func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) (uint64, uint64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyBlockJustification", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(uint64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // VerifyBlockJustification indicates an expected call of VerifyBlockJustification. diff --git a/dot/sync/syncer_integration_test.go b/dot/sync/syncer_integration_test.go index 9333486bce..68560ef4c3 100644 --- a/dot/sync/syncer_integration_test.go +++ b/dot/sync/syncer_integration_test.go @@ -111,9 +111,10 @@ func newTestSyncer(t *testing.T) *Service { cfg.LogLvl = log.Trace mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(gomock.AssignableToTypeOf(common.Hash{}), - gomock.AssignableToTypeOf([]byte{})).DoAndReturn(func(hash common.Hash, justification []byte) error { - return nil - }).AnyTimes() + gomock.AssignableToTypeOf([]byte{})).DoAndReturn( + func(hash common.Hash, justification []byte) (uint64, uint64, error) { + return 1, 1, nil + }).AnyTimes() cfg.FinalityGadget = mockFinalityGadget cfg.Network = NewMockNetwork(ctrl) diff --git a/lib/grandpa/message_handler.go b/lib/grandpa/message_handler.go index cb5105324f..6d7cf472fd 100644 --- a/lib/grandpa/message_handler.go +++ b/lib/grandpa/message_handler.go @@ -402,54 +402,55 @@ func (h *MessageHandler) verifyPreCommitJustification(msg *CatchUpResponse) erro return nil } -// VerifyBlockJustification verifies the finality justification for a block, returns scale encoded justification with -// any extra bytes removed. -func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) error { +// VerifyBlockJustification verifies the finality justification for a block, +// if the justification is valid the return the round and set id otherwise error +func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) ( + round uint64, setID uint64, err error) { fj := Justification{} - err := scale.Unmarshal(justification, &fj) + err = scale.Unmarshal(justification, &fj) if err != nil { - return err + return 0, 0, err } if hash != fj.Commit.Hash { - return fmt.Errorf("%w: justification %s and block hash %s", + return 0, 0, fmt.Errorf("%w: justification %s and block hash %s", ErrJustificationMismatch, fj.Commit.Hash.Short(), hash.Short()) } - setID, err := s.grandpaState.GetSetIDByBlockNumber(uint(fj.Commit.Number)) + setID, err = s.grandpaState.GetSetIDByBlockNumber(uint(fj.Commit.Number)) if err != nil { - return fmt.Errorf("cannot get set ID from block number: %w", err) + return 0, 0, fmt.Errorf("cannot get set ID from block number: %w", err) } has, err := s.blockState.HasFinalisedBlock(fj.Round, setID) if err != nil { - return fmt.Errorf("checking if round and set id has finalised block: %w", err) + return 0, 0, fmt.Errorf("checking if round and set id has finalised block: %w", err) } if has { storedFinalisedHash, err := s.blockState.GetFinalisedHash(fj.Round, setID) if err != nil { - return fmt.Errorf("getting finalised hash: %w", err) + return 0, 0, fmt.Errorf("getting finalised hash: %w", err) } if storedFinalisedHash != hash { - return fmt.Errorf("%w, setID=%d and round=%d", errFinalisedBlocksMismatch, setID, fj.Round) + return 0, 0, fmt.Errorf("%w, setID=%d and round=%d", errFinalisedBlocksMismatch, setID, fj.Round) } - return nil + return fj.Round, setID, nil } isDescendant, err := isDescendantOfHighestFinalisedBlock(s.blockState, fj.Commit.Hash) if err != nil { - return fmt.Errorf("checking if descendant of highest block: %w", err) + return 0, 0, fmt.Errorf("checking if descendant of highest block: %w", err) } if !isDescendant { - return errVoteBlockMismatch + return 0, 0, errVoteBlockMismatch } auths, err := s.grandpaState.GetAuthorities(setID) if err != nil { - return fmt.Errorf("cannot get authorities for set ID: %w", err) + return 0, 0, fmt.Errorf("cannot get authorities for set ID: %w", err) } // threshold is two-thirds the number of authorities, @@ -457,7 +458,7 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt threshold := (2 * len(auths) / 3) if len(fj.Commit.Precommits) < threshold { - return ErrMinVotesNotMet + return 0, 0, ErrMinVotesNotMet } authPubKeys := make([]AuthData, len(fj.Commit.Precommits)) @@ -477,20 +478,20 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt // check if vote was for descendant of committed block isDescendant, err := s.blockState.IsDescendantOf(hash, just.Vote.Hash) if err != nil { - return err + return 0, 0, err } if !isDescendant { - return ErrPrecommitBlockMismatch + return 0, 0, ErrPrecommitBlockMismatch } publicKey, err := ed25519.NewPublicKey(just.AuthorityID[:]) if err != nil { - return err + return 0, 0, err } if !isInAuthSet(publicKey, auths) { - return ErrAuthorityNotInSet + return 0, 0, ErrAuthorityNotInSet } // verify signature for each precommit @@ -501,16 +502,16 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt SetID: setID, }) if err != nil { - return err + return 0, 0, err } ok, err := publicKey.Verify(msg, just.Signature[:]) if err != nil { - return err + return 0, 0, err } if !ok { - return ErrInvalidSignature + return 0, 0, ErrInvalidSignature } if _, ok := equivocatoryVoters[just.AuthorityID]; ok { @@ -521,30 +522,21 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt } if count+len(equivocatoryVoters) < threshold { - return ErrMinVotesNotMet + return 0, 0, ErrMinVotesNotMet } err = verifyBlockHashAgainstBlockNumber(s.blockState, fj.Commit.Hash, uint(fj.Commit.Number)) if err != nil { - return fmt.Errorf("verifying block hash against block number: %w", err) + return 0, 0, fmt.Errorf("verifying block hash against block number: %w", err) } for _, preCommit := range fj.Commit.Precommits { err := verifyBlockHashAgainstBlockNumber(s.blockState, preCommit.Vote.Hash, uint(preCommit.Vote.Number)) if err != nil { - return fmt.Errorf("verifying block hash against block number: %w", err) + return 0, 0, fmt.Errorf("verifying block hash against block number: %w", err) } } - - err = s.blockState.SetFinalisedHash(hash, fj.Round, setID) - if err != nil { - return fmt.Errorf("setting finalised hash: %w", err) - } - - logger.Debugf( - "set finalised block with hash %s, round %d and set id %d", - hash, fj.Round, setID) - return nil + return fj.Round, setID, nil } func verifyBlockHashAgainstBlockNumber(bs BlockState, hash common.Hash, number uint) error { diff --git a/lib/grandpa/message_handler_integration_test.go b/lib/grandpa/message_handler_integration_test.go index 831d863e64..3e137dc380 100644 --- a/lib/grandpa/message_handler_integration_test.go +++ b/lib/grandpa/message_handler_integration_test.go @@ -772,8 +772,11 @@ func TestMessageHandler_VerifyBlockJustification_WithEquivocatoryVotes(t *testin just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + + actualRound, actualSetID, err := gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) + require.Equal(t, round, actualRound) + require.Equal(t, setID, actualSetID) } func TestMessageHandler_VerifyBlockJustification(t *testing.T) { @@ -840,8 +843,10 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + actualRound, actualSetID, err := gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) + require.Equal(t, round, actualRound) + require.Equal(t, setID, actualSetID) // use wrong hash, shouldn't verify precommits = buildTestJustification(t, 2, round+1, setID, kr, precommit) @@ -849,7 +854,7 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = testHeader2.Hash() data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrPrecommitBlockMismatch, err) } @@ -899,7 +904,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = genhash data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrPrecommitBlockMismatch, err) // use wrong round, shouldn't verify @@ -907,7 +912,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+2, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrInvalidSignature, err) // add authority not in set, shouldn't verify @@ -915,7 +920,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrAuthorityNotInSet, err) // not enough signatures, shouldn't verify @@ -923,7 +928,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrMinVotesNotMet, err) // mismatch justification header and block header @@ -932,7 +937,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { data, err = scale.Marshal(*just) require.NoError(t, err) otherHeader := types.NewEmptyHeader() - err = gs.VerifyBlockJustification(otherHeader.Hash(), data) + _, _, err = gs.VerifyBlockJustification(otherHeader.Hash(), data) require.ErrorIs(t, err, ErrJustificationMismatch) expectedErr := fmt.Sprintf("%s: justification %s and block hash %s", ErrJustificationMismatch, @@ -1001,7 +1006,7 @@ func TestMessageHandler_VerifyBlockJustification_ErrFinalisedBlockMismatch(t *te just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + _, _, err = gs.VerifyBlockJustification(testHash, data) require.ErrorIs(t, err, errFinalisedBlocksMismatch) } @@ -1517,8 +1522,6 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). Return(true, nil).Times(3) mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) - mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), - uint64(0)).Return(nil) return mockBlockState }, grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { @@ -1547,8 +1550,6 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). Return(true, nil).Times(3) mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) - mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), - uint64(0)).Return(nil) return mockBlockState }, grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { @@ -1578,7 +1579,7 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint blockState: tt.fields.blockStateBuilder(ctrl), grandpaState: tt.fields.grandpaStateBuilder(ctrl), } - err := s.VerifyBlockJustification(tt.args.hash, tt.args.justification) + _, _, err := s.VerifyBlockJustification(tt.args.hash, tt.args.justification) if tt.wantErr != nil { assert.ErrorContains(t, err, tt.wantErr.Error()) } else { diff --git a/lib/grandpa/votes_tracker_test.go b/lib/grandpa/votes_tracker_test.go index 91a9b220b8..54857b3678 100644 --- a/lib/grandpa/votes_tracker_test.go +++ b/lib/grandpa/votes_tracker_test.go @@ -5,16 +5,22 @@ package grandpa import ( "container/list" + "fmt" "sort" "testing" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +func TestA(t *testing.T) { + fmt.Println(scale.MustMarshal([]byte{})) +} + // buildVoteMessage creates a test vote message using the // given block hash and authority ID only. func buildVoteMessage(blockHash common.Hash, From a9c1f8f98882daaa1067aa889687b96782008a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Wed, 29 Nov 2023 11:55:34 -0400 Subject: [PATCH 03/19] chore(chain): update Kusama boot nodes (#3608) --- chain/kusama/genesis.json | 48 ++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/chain/kusama/genesis.json b/chain/kusama/genesis.json index e391afc193..7c83d63ccd 100644 --- a/chain/kusama/genesis.json +++ b/chain/kusama/genesis.json @@ -3,12 +3,14 @@ "id": "ksmcc3", "chainType": "Live", "bootNodes": [ - "/dns/p2p.cc3-0.kusama.network/tcp/30100/p2p/12D3KooWDgtynm4S9M3m6ZZhXYu2RrWKdvkCSScc25xKDVSg1Sjd", - "/dns/p2p.cc3-1.kusama.network/tcp/30100/p2p/12D3KooWNpGriWPmf621Lza9UWU9eLLBdCFaErf6d4HSK7Bcqnv4", - "/dns/p2p.cc3-2.kusama.network/tcp/30100/p2p/12D3KooWLmLiB4AenmN2g2mHbhNXbUcNiGi99sAkSk1kAQedp8uE", - "/dns/p2p.cc3-3.kusama.network/tcp/30100/p2p/12D3KooWEGHw84b4hfvXEfyq4XWEmWCbRGuHMHQMpby4BAtZ4xJf", - "/dns/p2p.cc3-4.kusama.network/tcp/30100/p2p/12D3KooWF9KDPRMN8WpeyXhEeURZGP8Dmo7go1tDqi7hTYpxV9uW", - "/dns/p2p.cc3-5.kusama.network/tcp/30100/p2p/12D3KooWDiwMeqzvgWNreS9sV1HW3pZv1PA7QGA7HUCo7FzN5gcA", + "/dns/kusama-connect-0.parity.io/tcp/443/wss/p2p/12D3KooWBjxpFhVNM9poSsMEfdnXJaSWSZQ7otK9aV1SPA9zJp5W", + "/dns/kusama-connect-1.parity.io/tcp/443/wss/p2p/12D3KooWAJRVca93jLm4zft4rtTLLxNV4ZrHPMBkbGy5XkXooBFt", + "/dns/kusama-connect-2.parity.io/tcp/443/wss/p2p/12D3KooWLn22TSPR3HXMRSSmWoK4pkDtspdCVi5j86QyyUNViDeL", + "/dns/kusama-connect-3.parity.io/tcp/443/wss/p2p/12D3KooWSwnJSP3QJ6cnFCTpcXq4EEFotVEiQuCWVprzCnWj5e4G", + "/dns/kusama-connect-4.parity.io/tcp/443/wss/p2p/12D3KooWHi7zHUev7n1zs9kSQwh4KMPJcS8Jky2JN58cNabcXGvK", + "/dns/kusama-connect-5.parity.io/tcp/443/wss/p2p/12D3KooWMBF6DXADrNLg6kNt1A1zmKzw478gJw79NmTQhSDxuZvR", + "/dns/kusama-connect-6.parity.io/tcp/443/wss/p2p/12D3KooWNnG7YqYB9eEoACRuSEax8qhuPQzRn878AWKN4vUUtQXd", + "/dns/kusama-connect-7.parity.io/tcp/443/wss/p2p/12D3KooWMmtoLnkVCGyuCpsWw4zoNtWPH4nsVLn92mutvjQknEqR", "/dns/p2p.0.kusama.network/tcp/30333/p2p/12D3KooWJDohybWd7FvRmyeGjgi56yy36mRWLHmgRprFdUadUt6b", "/dns/p2p.1.kusama.network/tcp/30333/p2p/12D3KooWC7dnTvDY97afoLrvQSBrh7dDFEkWniTwyxAsBjfpaZk6", "/dns/p2p.2.kusama.network/tcp/30333/p2p/12D3KooWGGK6Mj1pWF1bk4R1HjBQ4E7bgkfSJ5gmEfVRuwRZapT5", @@ -17,7 +19,31 @@ "/dns/p2p.5.kusama.network/tcp/30333/p2p/12D3KooWBsJKGJFuv83ixryzMsUS53A8JzEVeTA8PGi4U6T2dnif", "/dns/kusama-bootnode-0.paritytech.net/tcp/30333/p2p/12D3KooWSueCPH3puP2PcvqPJdNaDNF3jMZjtJtDiSy35pWrbt5h", "/dns/kusama-bootnode-0.paritytech.net/tcp/30334/ws/p2p/12D3KooWSueCPH3puP2PcvqPJdNaDNF3jMZjtJtDiSy35pWrbt5h", - "/dns/kusama-bootnode-1.paritytech.net/tcp/30333/p2p/12D3KooWQKqane1SqWJNWMQkbia9qiMWXkcHtAdfW5eVF8hbwEDw" + "/dns/kusama-bootnode-1.paritytech.net/tcp/30333/p2p/12D3KooWQKqane1SqWJNWMQkbia9qiMWXkcHtAdfW5eVF8hbwEDw", + "/dns/kusama-boot.dwellir.com/tcp/30333/ws/p2p/12D3KooWFj2ndawdYyk2spc42Y2arYwb2TUoHLHFAsKuHRzWXwoJ", + "/dns/kusama-boot.dwellir.com/tcp/443/wss/p2p/12D3KooWFj2ndawdYyk2spc42Y2arYwb2TUoHLHFAsKuHRzWXwoJ", + "/dns/boot.stake.plus/tcp/31333/p2p/12D3KooWLa1UyG5xLPds2GbiRBCTJjpsVwRWHWN7Dff14yiNJRpR", + "/dns/boot.stake.plus/tcp/31334/wss/p2p/12D3KooWLa1UyG5xLPds2GbiRBCTJjpsVwRWHWN7Dff14yiNJRpR", + "/dns/boot-node.helikon.io/tcp/7060/p2p/12D3KooWL4KPqfAsPE2aY1g5Zo1CxsDwcdJ7mmAghK7cg6M2fdbD", + "/dns/boot-node.helikon.io/tcp/7062/wss/p2p/12D3KooWL4KPqfAsPE2aY1g5Zo1CxsDwcdJ7mmAghK7cg6M2fdbD", + "/dns/kusama.bootnode.amforc.com/tcp/30333/p2p/12D3KooWLx6nsj6Fpd8biP1VDyuCUjazvRiGWyBam8PsqRJkbUb9", + "/dns/kusama.bootnode.amforc.com/tcp/30334/wss/p2p/12D3KooWLx6nsj6Fpd8biP1VDyuCUjazvRiGWyBam8PsqRJkbUb9", + "/dns/kusama-bootnode.polkadotters.com/tcp/30333/p2p/12D3KooWHB5rTeNkQdXNJ9ynvGz8Lpnmsctt7Tvp7mrYv6bcwbPG", + "/dns/kusama-bootnode.polkadotters.com/tcp/30334/wss/p2p/12D3KooWHB5rTeNkQdXNJ9ynvGz8Lpnmsctt7Tvp7mrYv6bcwbPG", + "/dns/boot-cr.gatotech.network/tcp/33200/p2p/12D3KooWRNZXf99BfzQDE1C8YhuBbuy7Sj18UEf7FNpD8egbURYD", + "/dns/boot-cr.gatotech.network/tcp/35200/wss/p2p/12D3KooWRNZXf99BfzQDE1C8YhuBbuy7Sj18UEf7FNpD8egbURYD", + "/dns/boot-kusama.metaspan.io/tcp/23012/p2p/12D3KooWE1tq9ZL9AAxMiUBBqy1ENmh5pwfWabnoBPMo8gFPXhn6", + "/dns/boot-kusama.metaspan.io/tcp/23015/ws/p2p/12D3KooWE1tq9ZL9AAxMiUBBqy1ENmh5pwfWabnoBPMo8gFPXhn6", + "/dns/boot-kusama.metaspan.io/tcp/23016/wss/p2p/12D3KooWE1tq9ZL9AAxMiUBBqy1ENmh5pwfWabnoBPMo8gFPXhn6", + "/dns/kusama-bootnode.turboflakes.io/tcp/30305/p2p/12D3KooWR6cMhCYRhbJdqYZfzWZT6bcck3unpRLk8GBQGmHBgPwu", + "/dns/kusama-bootnode.turboflakes.io/tcp/30405/wss/p2p/12D3KooWR6cMhCYRhbJdqYZfzWZT6bcck3unpRLk8GBQGmHBgPwu", + "/dns/kusama-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWLswepVYVdCNduvWRTyNTaDMXEBcmvJdZ9Bhw3u2Jhad2", + "/dns/kusama-boot-ng.dwellir.com/tcp/30334/p2p/12D3KooWLswepVYVdCNduvWRTyNTaDMXEBcmvJdZ9Bhw3u2Jhad2", + "/dns/kusama-bootnode.radiumblock.com/tcp/30335/wss/p2p/12D3KooWGzKffWe7JSXeKMQeSQC5xfBafZtgBDCuBVxmwe2TJRuc", + "/dns/kusama-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWGzKffWe7JSXeKMQeSQC5xfBafZtgBDCuBVxmwe2TJRuc", + "/dns/ksm-bootnode.stakeworld.io/tcp/30300/p2p/12D3KooWFRin7WWVS6RgUsSpkfUHSv4tfGKnr2zJPmf1pbMv118H", + "/dns/ksm-bootnode.stakeworld.io/tcp/30301/ws/p2p/12D3KooWFRin7WWVS6RgUsSpkfUHSv4tfGKnr2zJPmf1pbMv118H", + "/dns/ksm-bootnode.stakeworld.io/tcp/30302/wss/p2p/12D3KooWFRin7WWVS6RgUsSpkfUHSv4tfGKnr2zJPmf1pbMv118H" ], "telemetryEndpoints": [ [ @@ -34,12 +60,12 @@ "consensusEngine": null, "forkBlocks": null, "badBlocks": [ - "0x15b1b925b0aa5cfe43c88cd024f74258cb5cfe3af424882c901014e8acd0d241", - "0x2563260209012232649ab9dc003f62e274c684037de499a23062f8e0e816c605" + "0x15b1b925b0aa5cfe43c88cd024f74258cb5cfe3af424882c901014e8acd0d241", + "0x2563260209012232649ab9dc003f62e274c684037de499a23062f8e0e816c605" ], "genesis": { "raw": { - "top": { + "top": { "0x9c5d795d0297be56027a4b2464e333979c5d795d0297be56027a4b2464e33397974a8f6e094002e424b603628718939b060c4c6305a73d36a014468c29b8b7d7": "0x00c0e1d0612100000000000000000000", "0x9c5d795d0297be56027a4b2464e333979c5d795d0297be56027a4b2464e33397997f7003f78328f30c57e6ce10b1956c77d2187fe08441845cc0c18273852039": "0x00703874580800000000000000000000", "0xc2261276cc9d1f8598ea4b6a74b15c2f6482b9ade7bc6657aaca787ba1add3b41a7b36634518c4bd258451d3afca781ef41c43e2cc13767ade6d58216bb4b54e": "0x0000c52ebca2b1000000000000000000", @@ -3460,7 +3486,7 @@ "0x9c5d795d0297be56027a4b2464e333979c5d795d0297be56027a4b2464e33397a95fc10899f9939fe9f376f90b678d436e6cbd6cfbad752e1d16e1bd207970fd": "0x00aa8af681571e000000000000000000", "0x9c5d795d0297be56027a4b2464e333979c5d795d0297be56027a4b2464e33397be0013089e49d5187af79a902767da35cf39652bf8ee558f7780d185a484dd3c": "0x007202ee615f09000000000000000000" }, - "childrenDefault":{} + "childrenDefault": {} } } } From 8e1650e0f16115ea2bf5f922207f5a40050fd122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Wed, 29 Nov 2023 15:52:25 -0400 Subject: [PATCH 04/19] feat(dot/sync): include block origin and skip extra validation on `initialSync` (#3392) --- dot/sync/chain_sync.go | 76 +++++++++++++++++++++++++------------ dot/sync/chain_sync_test.go | 62 +++++++++++++++--------------- dot/sync/syncer.go | 1 + 3 files changed, 84 insertions(+), 55 deletions(-) diff --git a/dot/sync/chain_sync.go b/dot/sync/chain_sync.go index 6f104c48c8..979f73f7ab 100644 --- a/dot/sync/chain_sync.go +++ b/dot/sync/chain_sync.go @@ -37,6 +37,13 @@ const ( tip ) +type blockOrigin byte + +const ( + networkInitialSync blockOrigin = iota + networkBroadcast +) + func (s chainSyncState) String() string { switch s { case bootstrap: @@ -126,6 +133,7 @@ type chainSync struct { telemetry Telemetry badBlocks []string requestMaker network.RequestMaker + waitPeersDuration time.Duration } type chainSyncConfig struct { @@ -142,6 +150,7 @@ type chainSyncConfig struct { blockImportHandler BlockImportHandler telemetry Telemetry badBlocks []string + waitPeersDuration time.Duration } func newChainSync(cfg chainSyncConfig) *chainSync { @@ -166,26 +175,40 @@ func newChainSync(cfg chainSyncConfig) *chainSync { workerPool: newSyncWorkerPool(cfg.net, cfg.requestMaker), badBlocks: cfg.badBlocks, requestMaker: cfg.requestMaker, + waitPeersDuration: cfg.waitPeersDuration, } } -func (cs *chainSync) start() { - // since the default status from sync mode is syncMode(tip) - isSyncedGauge.Set(1) +func (cs *chainSync) waitEnoughPeersAndTarget() { + waitPeersTimer := time.NewTimer(cs.waitPeersDuration) - // wait until we have a minimal workers in the sync worker pool for { + cs.workerPool.useConnectedPeers() + _, err := cs.getTarget() + totalAvailable := cs.workerPool.totalWorkers() - if totalAvailable >= uint(cs.minPeers) { - break + if totalAvailable >= uint(cs.minPeers) && err == nil { + return } - // TODO: https://github.com/ChainSafe/gossamer/issues/3402 - time.Sleep(time.Second) + select { + case <-waitPeersTimer.C: + waitPeersTimer.Reset(cs.waitPeersDuration) + case <-cs.stopCh: + return + } } +} + +func (cs *chainSync) start() { + // since the default status from sync mode is syncMode(tip) + isSyncedGauge.Set(1) cs.wg.Add(1) go cs.pendingBlocks.run(cs.finalisedCh, cs.stopCh, &cs.wg) + + // wait until we have a minimal workers in the sync worker pool + cs.waitEnoughPeersAndTarget() } func (cs *chainSync) stop() error { @@ -265,7 +288,7 @@ func (cs *chainSync) bootstrapSync() { if isFarFromTarget { cs.workerPool.useConnectedPeers() - err = cs.requestMaxBlocksFrom(bestBlockHeader) + err = cs.requestMaxBlocksFrom(bestBlockHeader, networkInitialSync) if err != nil { logger.Errorf("requesting max blocks from best block header: %s", err) } @@ -424,7 +447,7 @@ func (cs *chainSync) requestChainBlocks(announcedHeader, bestBlockHeader *types. resultsQueue := make(chan *syncTaskResult) cs.workerPool.submitRequest(request, &peerWhoAnnounced, resultsQueue) - err := cs.handleWorkersResults(resultsQueue, startAtBlock, totalBlocks) + err := cs.handleWorkersResults(resultsQueue, networkBroadcast, startAtBlock, totalBlocks) if err != nil { return fmt.Errorf("while handling workers results: %w", err) } @@ -462,7 +485,7 @@ func (cs *chainSync) requestForkBlocks(bestBlockHeader, highestFinalizedHeader, resultsQueue := make(chan *syncTaskResult) cs.workerPool.submitRequest(request, &peerWhoAnnounced, resultsQueue) - err = cs.handleWorkersResults(resultsQueue, startAtBlock, gapLength) + err = cs.handleWorkersResults(resultsQueue, networkBroadcast, startAtBlock, gapLength) if err != nil { return fmt.Errorf("while handling workers results: %w", err) } @@ -490,7 +513,7 @@ func (cs *chainSync) requestPendingBlocks(highestFinalizedHeader *types.Header) } if parentExists { - err := cs.handleReadyBlock(pendingBlock.toBlockData()) + err := cs.handleReadyBlock(pendingBlock.toBlockData(), networkBroadcast) if err != nil { return fmt.Errorf("handling ready block: %w", err) } @@ -515,7 +538,7 @@ func (cs *chainSync) requestPendingBlocks(highestFinalizedHeader *types.Header) // TODO: we should handle the requests concurrently // a way of achieve that is by constructing a new `handleWorkersResults` for // handling only tip sync requests - err = cs.handleWorkersResults(resultsQueue, startAtBlock, *descendingGapRequest.Max) + err = cs.handleWorkersResults(resultsQueue, networkBroadcast, startAtBlock, *descendingGapRequest.Max) if err != nil { return fmt.Errorf("while handling workers results: %w", err) } @@ -524,7 +547,7 @@ func (cs *chainSync) requestPendingBlocks(highestFinalizedHeader *types.Header) return nil } -func (cs *chainSync) requestMaxBlocksFrom(bestBlockHeader *types.Header) error { +func (cs *chainSync) requestMaxBlocksFrom(bestBlockHeader *types.Header, origin blockOrigin) error { //nolint:unparam startRequestAt := bestBlockHeader.Number + 1 // targetBlockNumber is the virtual target we will request, however @@ -551,7 +574,7 @@ func (cs *chainSync) requestMaxBlocksFrom(bestBlockHeader *types.Header) error { } resultsQueue := cs.workerPool.submitRequests(requests) - err = cs.handleWorkersResults(resultsQueue, startRequestAt, expectedAmountOfBlocks) + err = cs.handleWorkersResults(resultsQueue, origin, startRequestAt, expectedAmountOfBlocks) if err != nil { return fmt.Errorf("while handling workers results: %w", err) } @@ -589,7 +612,7 @@ func (cs *chainSync) getTarget() (uint, error) { // in the queue and wait for it to completes // TODO: handle only justification requests func (cs *chainSync) handleWorkersResults( - workersResults chan *syncTaskResult, startAtBlock uint, expectedSyncedBlocks uint32) error { + workersResults chan *syncTaskResult, origin blockOrigin, startAtBlock uint, expectedSyncedBlocks uint32) error { startTime := time.Now() defer func() { @@ -739,7 +762,7 @@ taskResultLoop: // response was validated! place into ready block queue for _, bd := range syncingChain { // block is ready to be processed! - if err := cs.handleReadyBlock(bd); err != nil { + if err := cs.handleReadyBlock(bd, origin); err != nil { return fmt.Errorf("while handling ready block: %w", err) } } @@ -747,7 +770,7 @@ taskResultLoop: return nil } -func (cs *chainSync) handleReadyBlock(bd *types.BlockData) error { +func (cs *chainSync) handleReadyBlock(bd *types.BlockData, origin blockOrigin) error { // if header was not requested, get it from the pending set // if we're expecting headers, validate should ensure we have a header if bd.Header == nil { @@ -779,7 +802,7 @@ func (cs *chainSync) handleReadyBlock(bd *types.BlockData) error { bd.Header = block.header } - err := cs.processBlockData(*bd) + err := cs.processBlockData(*bd, origin) if err != nil { // depending on the error, we might want to save this block for later logger.Errorf("block data processing for block with hash %s failed: %s", bd.Hash, err) @@ -793,7 +816,7 @@ func (cs *chainSync) handleReadyBlock(bd *types.BlockData) error { // processBlockData processes the BlockData from a BlockResponse and // returns the index of the last BlockData it handled on success, // or the index of the block data that errored on failure. -func (cs *chainSync) processBlockData(blockData types.BlockData) error { +func (cs *chainSync) processBlockData(blockData types.BlockData, origin blockOrigin) error { // while in bootstrap mode we don't need to broadcast block announcements announceImportedBlock := cs.getSyncMode() == tip var blockDataJustification []byte @@ -808,7 +831,7 @@ func (cs *chainSync) processBlockData(blockData types.BlockData) error { } if blockData.Body != nil { - err = cs.processBlockDataWithHeaderAndBody(blockData, announceImportedBlock) + err = cs.processBlockDataWithHeaderAndBody(blockData, origin, announceImportedBlock) if err != nil { return fmt.Errorf("processing block data with header and body: %w", err) } @@ -842,10 +865,13 @@ func (cs *chainSync) verifyJustification(headerHash common.Hash, justification [ } func (cs *chainSync) processBlockDataWithHeaderAndBody(blockData types.BlockData, - announceImportedBlock bool) (err error) { - err = cs.babeVerifier.VerifyBlock(blockData.Header) - if err != nil { - return fmt.Errorf("babe verifying block: %w", err) + origin blockOrigin, announceImportedBlock bool) (err error) { + + if origin != networkInitialSync { + err = cs.babeVerifier.VerifyBlock(blockData.Header) + if err != nil { + return fmt.Errorf("babe verifying block: %w", err) + } } cs.handleBody(blockData.Body) diff --git a/dot/sync/chain_sync_test.go b/dot/sync/chain_sync_test.go index 27f8bb5845..af5a82fd8c 100644 --- a/dot/sync/chain_sync_test.go +++ b/dot/sync/chain_sync_test.go @@ -185,7 +185,7 @@ func Test_chainSync_onBlockAnnounce(t *testing.T) { const announceBlock = true ensureSuccessfulBlockImportFlow(t, block1AnnounceHeader, mockedBlockResponse.BlockData, blockStateMock, babeVerifierMock, storageStateMock, importHandlerMock, telemetryMock, - announceBlock) + networkBroadcast, announceBlock) workerPool := newSyncWorkerPool(networkMock, requestMaker) // include the peer who announced the block in the pool @@ -306,10 +306,10 @@ func Test_chainSync_onBlockAnnounceHandshake_tipModeNeedToCatchup(t *testing.T) ensureSuccessfulBlockImportFlow(t, block1AnnounceHeader, firstMockedResponse.BlockData, blockStateMock, babeVerifierMock, storageStateMock, importHandlerMock, telemetryMock, - announceBlock) + networkInitialSync, announceBlock) ensureSuccessfulBlockImportFlow(t, latestItemFromMockedResponse.Header, secondMockedResponse.BlockData, blockStateMock, babeVerifierMock, storageStateMock, importHandlerMock, telemetryMock, - announceBlock) + networkInitialSync, announceBlock) state := atomic.Value{} state.Store(tip) @@ -535,7 +535,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithOneWorker(t *testing.T) { const announceBlock = false // setup mocks for new synced blocks that doesn't exists in our local database ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, totalBlockResponse.BlockData, mockedBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // setup a chain sync which holds in its peer view map // 3 peers, each one announce block X as its best block number. @@ -555,7 +555,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithOneWorker(t *testing.T) { // the worker pool executes the workers management cs.workerPool.fromBlockAnnounce(peer.ID("noot")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -591,7 +591,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithTwoWorkers(t *testing.T) { // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -600,7 +600,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithTwoWorkers(t *testing.T) { // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[len(worker1Response.BlockData)-1] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // we use gomock.Any since I cannot guarantee which peer picks which request // but the first call to DoBlockRequest will return the first set and the second @@ -641,7 +641,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithTwoWorkers(t *testing.T) { cs.workerPool.fromBlockAnnounce(peer.ID("noot")) cs.workerPool.fromBlockAnnounce(peer.ID("noot2")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -678,7 +678,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithOneWorkerFailing(t *testing. // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -687,7 +687,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithOneWorkerFailing(t *testing. // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[len(worker1Response.BlockData)-1] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // we use gomock.Any since I cannot guarantee which peer picks which request // but the first call to DoBlockRequest will return the first set and the second @@ -735,7 +735,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithOneWorkerFailing(t *testing. cs.workerPool.fromBlockAnnounce(peer.ID("alice")) cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -772,7 +772,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithProtocolNotSupported(t *test // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -781,7 +781,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithProtocolNotSupported(t *test // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[len(worker1Response.BlockData)-1] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // we use gomock.Any since I cannot guarantee which peer picks which request // but the first call to DoBlockRequest will return the first set and the second @@ -835,7 +835,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithProtocolNotSupported(t *test cs.workerPool.fromBlockAnnounce(peer.ID("alice")) cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -872,7 +872,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithNilHeaderInResponse(t *testi // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -881,7 +881,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithNilHeaderInResponse(t *testi // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[127] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // we use gomock.Any since I cannot guarantee which peer picks which request // but the first call to DoBlockRequest will return the first set and the second @@ -937,7 +937,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithNilHeaderInResponse(t *testi cs.workerPool.fromBlockAnnounce(peer.ID("alice")) cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -974,7 +974,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithResponseIsNotAChain(t *testi // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -983,7 +983,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithResponseIsNotAChain(t *testi // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[127] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) // we use gomock.Any since I cannot guarantee which peer picks which request // but the first call to DoBlockRequest will return the first set and the second @@ -1035,7 +1035,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithResponseIsNotAChain(t *testi cs.workerPool.fromBlockAnnounce(peer.ID("alice")) cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -1072,7 +1072,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithReceivedBadBlock(t *testing. // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker2Response := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[128:], @@ -1081,7 +1081,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithReceivedBadBlock(t *testing. // will setup the expectations starting from block 128, from previous worker, until block 256 parent := worker1Response.BlockData[len(worker1Response.BlockData)-1] ensureSuccessfulBlockImportFlow(t, parent.Header, worker2Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) fakeBadBlockHash := common.MustHexToHash("0x18767cb4bb4cc13bf119f6613aec5487d4c06a2e453de53d34aea6f3f1ee9855") @@ -1149,7 +1149,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithReceivedBadBlock(t *testing. cs.workerPool.fromBlockAnnounce(peer.ID("alice")) cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -1190,7 +1190,7 @@ func TestChainSync_BootstrapSync_SucessfulSync_ReceivedPartialBlockData(t *testi // the first peer will respond the from the block 1 to 96 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 96 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) worker1MissingBlocksResponse := &network.BlockResponseMessage{ BlockData: blockResponse.BlockData[97:], @@ -1199,7 +1199,7 @@ func TestChainSync_BootstrapSync_SucessfulSync_ReceivedPartialBlockData(t *testi // last item from the previous response parent := worker1Response.BlockData[96] ensureSuccessfulBlockImportFlow(t, parent.Header, worker1MissingBlocksResponse.BlockData, mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) doBlockRequestCount := 0 mockRequestMaker.EXPECT(). @@ -1231,7 +1231,7 @@ func TestChainSync_BootstrapSync_SucessfulSync_ReceivedPartialBlockData(t *testi cs.workerPool.fromBlockAnnounce(peer.ID("alice")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.NoError(t, err) err = cs.workerPool.stop() @@ -1284,11 +1284,13 @@ func createSuccesfullBlockResponse(t *testing.T, parentHeader common.Hash, func ensureSuccessfulBlockImportFlow(t *testing.T, parentHeader *types.Header, blocksReceived []*types.BlockData, mockBlockState *MockBlockState, mockBabeVerifier *MockBabeVerifier, mockStorageState *MockStorageState, - mockImportHandler *MockBlockImportHandler, mockTelemetry *MockTelemetry, announceBlock bool) { + mockImportHandler *MockBlockImportHandler, mockTelemetry *MockTelemetry, origin blockOrigin, announceBlock bool) { t.Helper() for idx, blockData := range blocksReceived { - mockBabeVerifier.EXPECT().VerifyBlock(blockData.Header).Return(nil) + if origin != networkInitialSync { + mockBabeVerifier.EXPECT().VerifyBlock(blockData.Header).Return(nil) + } var previousHeader *types.Header if idx == 0 { @@ -1710,7 +1712,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithInvalidJusticationBlock(t *t // the first peer will respond the from the block 1 to 128 so the ensureBlockImportFlow // will setup the expectations starting from the genesis header until block 128 ensureSuccessfulBlockImportFlow(t, mockedGenesisHeader, worker1Response.BlockData[:90], mockBlockState, - mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, announceBlock) + mockBabeVerifier, mockStorageState, mockImportHandler, mockTelemetry, networkInitialSync, announceBlock) errVerifyBlockJustification := errors.New("VerifyBlockJustification mock error") mockFinalityGadget.EXPECT(). @@ -1754,7 +1756,7 @@ func TestChainSync_BootstrapSync_SuccessfulSync_WithInvalidJusticationBlock(t *t cs.workerPool.fromBlockAnnounce(peer.ID("alice")) //cs.workerPool.fromBlockAnnounce(peer.ID("bob")) - err = cs.requestMaxBlocksFrom(mockedGenesisHeader) + err = cs.requestMaxBlocksFrom(mockedGenesisHeader, networkInitialSync) require.ErrorIs(t, err, errVerifyBlockJustification) err = cs.workerPool.stop() diff --git a/dot/sync/syncer.go b/dot/sync/syncer.go index 32ec786f99..c511f2644c 100644 --- a/dot/sync/syncer.go +++ b/dot/sync/syncer.go @@ -64,6 +64,7 @@ func NewService(cfg *Config) (*Service, error) { telemetry: cfg.Telemetry, badBlocks: cfg.BadBlocks, requestMaker: cfg.RequestMaker, + waitPeersDuration: 100 * time.Millisecond, } chainSync := newChainSync(csCfg) 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 05/19] 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) { From 11b96dcfa326a74911c76b120de7373c47de37a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Mon, 4 Dec 2023 08:03:53 -0400 Subject: [PATCH 06/19] fix(dot/sync): Revert verify justification before importing blocks (#3615) --- dot/interfaces.go | 2 +- dot/state/block.go | 15 ----- dot/state/block_test.go | 20 ------ dot/sync/chain_sync.go | 62 ++++++------------ dot/sync/chain_sync_test.go | 3 +- dot/sync/interfaces.go | 4 +- dot/sync/mocks_test.go | 36 +---------- dot/sync/syncer_integration_test.go | 7 +- lib/grandpa/message_handler.go | 64 +++++++++++-------- .../message_handler_integration_test.go | 29 ++++----- lib/grandpa/votes_tracker_test.go | 6 -- 11 files changed, 79 insertions(+), 169 deletions(-) diff --git a/dot/interfaces.go b/dot/interfaces.go index 880b258f26..33beecb61c 100644 --- a/dot/interfaces.go +++ b/dot/interfaces.go @@ -27,7 +27,7 @@ type ServiceRegisterer interface { // BlockJustificationVerifier has a verification method for block justifications. type BlockJustificationVerifier interface { - VerifyBlockJustification(common.Hash, []byte) (round uint64, setID uint64, err error) + VerifyBlockJustification(common.Hash, []byte) error } // Telemetry is the telemetry client to send telemetry messages. diff --git a/dot/state/block.go b/dot/state/block.go index c8ed6afd76..789cfb7c00 100644 --- a/dot/state/block.go +++ b/dot/state/block.go @@ -492,21 +492,6 @@ func (bs *BlockState) AddBlockWithArrivalTime(block *types.Block, arrivalTime ti return nil } -// AddBlockToBlockTree adds the given block to the blocktree. It does not write it to the database. -// TODO: remove this func and usage from sync (after sync refactor?) -func (bs *BlockState) AddBlockToBlockTree(block *types.Block) error { - bs.Lock() - defer bs.Unlock() - - arrivalTime, err := bs.GetArrivalTime(block.Header.Hash()) - if err != nil { - arrivalTime = time.Now() - } - - bs.unfinalisedBlocks.store(block) - return bs.bt.AddBlock(&block.Header, arrivalTime) -} - // GetAllBlocksAtNumber returns all unfinalised blocks with the given number func (bs *BlockState) GetAllBlocksAtNumber(num uint) ([]common.Hash, error) { header, err := bs.GetHeaderByNumber(num) diff --git a/dot/state/block_test.go b/dot/state/block_test.go index 8243bf586e..ced6cd4263 100644 --- a/dot/state/block_test.go +++ b/dot/state/block_test.go @@ -635,26 +635,6 @@ func TestAddBlock_WithReOrg(t *testing.T) { require.Equal(t, header3a.Hash(), block3hash) } -func TestAddBlockToBlockTree(t *testing.T) { - bs := newTestBlockState(t, newTriesEmpty()) - - header := &types.Header{ - Number: 1, - Digest: createPrimaryBABEDigest(t), - ParentHash: testGenesisHeader.Hash(), - } - - err := bs.setArrivalTime(header.Hash(), time.Now()) - require.NoError(t, err) - - err = bs.AddBlockToBlockTree(&types.Block{ - Header: *header, - Body: types.Body{}, - }) - require.NoError(t, err) - require.Equal(t, bs.BestBlockHash(), header.Hash()) -} - func TestNumberIsFinalised(t *testing.T) { tries := newTriesEmpty() diff --git a/dot/sync/chain_sync.go b/dot/sync/chain_sync.go index 979f73f7ab..eea6301a89 100644 --- a/dot/sync/chain_sync.go +++ b/dot/sync/chain_sync.go @@ -816,33 +816,25 @@ func (cs *chainSync) handleReadyBlock(bd *types.BlockData, origin blockOrigin) e // processBlockData processes the BlockData from a BlockResponse and // returns the index of the last BlockData it handled on success, // or the index of the block data that errored on failure. +// TODO: https://github.com/ChainSafe/gossamer/issues/3468 func (cs *chainSync) processBlockData(blockData types.BlockData, origin blockOrigin) error { // while in bootstrap mode we don't need to broadcast block announcements announceImportedBlock := cs.getSyncMode() == tip - var blockDataJustification []byte - if blockData.Justification != nil { - blockDataJustification = *blockData.Justification - } if blockData.Header != nil { - round, setID, err := cs.verifyJustification(blockData.Header.Hash(), blockDataJustification) - if err != nil { - return err - } - if blockData.Body != nil { - err = cs.processBlockDataWithHeaderAndBody(blockData, origin, announceImportedBlock) + err := cs.processBlockDataWithHeaderAndBody(blockData, origin, announceImportedBlock) if err != nil { return fmt.Errorf("processing block data with header and body: %w", err) } } - err = cs.finalizeAndSetJustification( - blockData.Header, - round, setID, - blockDataJustification) - if err != nil { - return fmt.Errorf("while setting justification: %w", err) + if blockData.Justification != nil && len(*blockData.Justification) > 0 { + logger.Infof("handling justification for block %s (#%d)", blockData.Hash.Short(), blockData.Number()) + err := cs.handleJustification(blockData.Header, *blockData.Justification) + if err != nil { + return fmt.Errorf("handling justification: %w", err) + } } } @@ -854,16 +846,6 @@ func (cs *chainSync) processBlockData(blockData types.BlockData, origin blockOri return nil } -func (cs *chainSync) verifyJustification(headerHash common.Hash, justification []byte) ( - round uint64, setID uint64, err error) { - if len(justification) > 0 { - round, setID, err = cs.finalityGadget.VerifyBlockJustification(headerHash, justification) - return round, setID, err - } - - return 0, 0, nil -} - func (cs *chainSync) processBlockDataWithHeaderAndBody(blockData types.BlockData, origin blockOrigin, announceImportedBlock bool) (err error) { @@ -900,27 +882,21 @@ func (cs *chainSync) handleBody(body *types.Body) { blockSizeGauge.Set(float64(acc)) } -func (cs *chainSync) finalizeAndSetJustification(header *types.Header, - round, setID uint64, justification []byte) (err error) { - if len(justification) > 0 { - err = cs.blockState.SetFinalisedHash(header.Hash(), round, setID) - if err != nil { - return fmt.Errorf("setting finalised hash: %w", err) - } - - logger.Debugf( - "finalised block with hash #%d (%s), round %d and set id %d", - header.Number, header.Hash(), round, setID) +func (cs *chainSync) handleJustification(header *types.Header, justification []byte) (err error) { + logger.Debugf("handling justification for block %d...", header.Number) - err = cs.blockState.SetJustification(header.Hash(), justification) - if err != nil { - return fmt.Errorf("setting justification for block number %d: %w", - header.Number, err) - } + headerHash := header.Hash() + err = cs.finalityGadget.VerifyBlockJustification(headerHash, justification) + if err != nil { + return fmt.Errorf("verifying block number %d justification: %w", header.Number, err) + } - logger.Infof("🔨 finalised block number #%d (%s)", header.Number, header.Hash()) + err = cs.blockState.SetJustification(headerHash, justification) + if err != nil { + return fmt.Errorf("setting justification for block number %d: %w", header.Number, err) } + logger.Infof("🔨 finalised block number %d with hash %s", header.Number, headerHash) return nil } diff --git a/dot/sync/chain_sync_test.go b/dot/sync/chain_sync_test.go index 3da8dae5da..f4fb045074 100644 --- a/dot/sync/chain_sync_test.go +++ b/dot/sync/chain_sync_test.go @@ -1676,8 +1676,9 @@ func TestChainSync_getHighestBlock(t *testing.T) { }) } } - func TestChainSync_BootstrapSync_SuccessfulSync_WithInvalidJusticationBlock(t *testing.T) { + // TODO: https://github.com/ChainSafe/gossamer/issues/3468 + t.Skip() t.Parallel() ctrl := gomock.NewController(t) diff --git a/dot/sync/interfaces.go b/dot/sync/interfaces.go index 29ac858ee6..bfc0575d3f 100644 --- a/dot/sync/interfaces.go +++ b/dot/sync/interfaces.go @@ -29,7 +29,6 @@ type BlockState interface { GetMessageQueue(common.Hash) ([]byte, error) GetJustification(common.Hash) ([]byte, error) SetJustification(hash common.Hash, data []byte) error - AddBlockToBlockTree(block *types.Block) error GetHashByNumber(blockNumber uint) (common.Hash, error) GetBlockByHash(common.Hash) (*types.Block, error) GetRuntime(blockHash common.Hash) (runtime runtime.Instance, err error) @@ -39,7 +38,6 @@ type BlockState interface { GetHeaderByNumber(num uint) (*types.Header, error) GetAllBlocksAtNumber(num uint) ([]common.Hash, error) IsDescendantOf(parent, child common.Hash) (bool, error) - SetFinalisedHash(common.Hash, uint64, uint64) error } // StorageState is the interface for the storage state @@ -60,7 +58,7 @@ type BabeVerifier interface { // FinalityGadget implements justification verification functionality type FinalityGadget interface { - VerifyBlockJustification(common.Hash, []byte) (round uint64, setID uint64, err error) + VerifyBlockJustification(common.Hash, []byte) error } // BlockImportHandler is the interface for the handler of newly imported blocks diff --git a/dot/sync/mocks_test.go b/dot/sync/mocks_test.go index f1827ed6e6..9ab3ea3acb 100644 --- a/dot/sync/mocks_test.go +++ b/dot/sync/mocks_test.go @@ -43,20 +43,6 @@ func (m *MockBlockState) EXPECT() *MockBlockStateMockRecorder { return m.recorder } -// AddBlockToBlockTree mocks base method. -func (m *MockBlockState) AddBlockToBlockTree(arg0 *types.Block) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddBlockToBlockTree", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// AddBlockToBlockTree indicates an expected call of AddBlockToBlockTree. -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) -} - // BestBlockHeader mocks base method. func (m *MockBlockState) BestBlockHeader() (*types.Header, error) { m.ctrl.T.Helper() @@ -340,20 +326,6 @@ func (mr *MockBlockStateMockRecorder) RangeInMemory(arg0, arg1 any) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeInMemory", reflect.TypeOf((*MockBlockState)(nil).RangeInMemory), arg0, arg1) } -// SetFinalisedHash mocks base method. -func (m *MockBlockState) SetFinalisedHash(arg0 common.Hash, arg1, arg2 uint64) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetFinalisedHash", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetFinalisedHash indicates an expected call of SetFinalisedHash. -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) -} - // SetJustification mocks base method. func (m *MockBlockState) SetJustification(arg0 common.Hash, arg1 []byte) error { m.ctrl.T.Helper() @@ -538,13 +510,11 @@ func (m *MockFinalityGadget) EXPECT() *MockFinalityGadgetMockRecorder { } // VerifyBlockJustification mocks base method. -func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) (uint64, uint64, error) { +func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyBlockJustification", arg0, arg1) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(uint64) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret0, _ := ret[0].(error) + return ret0 } // VerifyBlockJustification indicates an expected call of VerifyBlockJustification. diff --git a/dot/sync/syncer_integration_test.go b/dot/sync/syncer_integration_test.go index 09f7ba9c5a..ac4ddf34e4 100644 --- a/dot/sync/syncer_integration_test.go +++ b/dot/sync/syncer_integration_test.go @@ -111,10 +111,9 @@ func newTestSyncer(t *testing.T) *Service { cfg.LogLvl = log.Trace mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(gomock.AssignableToTypeOf(common.Hash{}), - gomock.AssignableToTypeOf([]byte{})).DoAndReturn( - func(hash common.Hash, justification []byte) (uint64, uint64, error) { - return 1, 1, nil - }).AnyTimes() + gomock.AssignableToTypeOf([]byte{})).DoAndReturn(func(hash common.Hash, justification []byte) error { + return nil + }).AnyTimes() cfg.FinalityGadget = mockFinalityGadget cfg.Network = NewMockNetwork(ctrl) diff --git a/lib/grandpa/message_handler.go b/lib/grandpa/message_handler.go index 6d7cf472fd..cb5105324f 100644 --- a/lib/grandpa/message_handler.go +++ b/lib/grandpa/message_handler.go @@ -402,55 +402,54 @@ func (h *MessageHandler) verifyPreCommitJustification(msg *CatchUpResponse) erro return nil } -// VerifyBlockJustification verifies the finality justification for a block, -// if the justification is valid the return the round and set id otherwise error -func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) ( - round uint64, setID uint64, err error) { +// VerifyBlockJustification verifies the finality justification for a block, returns scale encoded justification with +// any extra bytes removed. +func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) error { fj := Justification{} - err = scale.Unmarshal(justification, &fj) + err := scale.Unmarshal(justification, &fj) if err != nil { - return 0, 0, err + return err } if hash != fj.Commit.Hash { - return 0, 0, fmt.Errorf("%w: justification %s and block hash %s", + return fmt.Errorf("%w: justification %s and block hash %s", ErrJustificationMismatch, fj.Commit.Hash.Short(), hash.Short()) } - setID, err = s.grandpaState.GetSetIDByBlockNumber(uint(fj.Commit.Number)) + setID, err := s.grandpaState.GetSetIDByBlockNumber(uint(fj.Commit.Number)) if err != nil { - return 0, 0, fmt.Errorf("cannot get set ID from block number: %w", err) + return fmt.Errorf("cannot get set ID from block number: %w", err) } has, err := s.blockState.HasFinalisedBlock(fj.Round, setID) if err != nil { - return 0, 0, fmt.Errorf("checking if round and set id has finalised block: %w", err) + return fmt.Errorf("checking if round and set id has finalised block: %w", err) } if has { storedFinalisedHash, err := s.blockState.GetFinalisedHash(fj.Round, setID) if err != nil { - return 0, 0, fmt.Errorf("getting finalised hash: %w", err) + return fmt.Errorf("getting finalised hash: %w", err) } if storedFinalisedHash != hash { - return 0, 0, fmt.Errorf("%w, setID=%d and round=%d", errFinalisedBlocksMismatch, setID, fj.Round) + return fmt.Errorf("%w, setID=%d and round=%d", errFinalisedBlocksMismatch, setID, fj.Round) } - return fj.Round, setID, nil + return nil } isDescendant, err := isDescendantOfHighestFinalisedBlock(s.blockState, fj.Commit.Hash) if err != nil { - return 0, 0, fmt.Errorf("checking if descendant of highest block: %w", err) + return fmt.Errorf("checking if descendant of highest block: %w", err) } if !isDescendant { - return 0, 0, errVoteBlockMismatch + return errVoteBlockMismatch } auths, err := s.grandpaState.GetAuthorities(setID) if err != nil { - return 0, 0, fmt.Errorf("cannot get authorities for set ID: %w", err) + return fmt.Errorf("cannot get authorities for set ID: %w", err) } // threshold is two-thirds the number of authorities, @@ -458,7 +457,7 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt threshold := (2 * len(auths) / 3) if len(fj.Commit.Precommits) < threshold { - return 0, 0, ErrMinVotesNotMet + return ErrMinVotesNotMet } authPubKeys := make([]AuthData, len(fj.Commit.Precommits)) @@ -478,20 +477,20 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt // check if vote was for descendant of committed block isDescendant, err := s.blockState.IsDescendantOf(hash, just.Vote.Hash) if err != nil { - return 0, 0, err + return err } if !isDescendant { - return 0, 0, ErrPrecommitBlockMismatch + return ErrPrecommitBlockMismatch } publicKey, err := ed25519.NewPublicKey(just.AuthorityID[:]) if err != nil { - return 0, 0, err + return err } if !isInAuthSet(publicKey, auths) { - return 0, 0, ErrAuthorityNotInSet + return ErrAuthorityNotInSet } // verify signature for each precommit @@ -502,16 +501,16 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt SetID: setID, }) if err != nil { - return 0, 0, err + return err } ok, err := publicKey.Verify(msg, just.Signature[:]) if err != nil { - return 0, 0, err + return err } if !ok { - return 0, 0, ErrInvalidSignature + return ErrInvalidSignature } if _, ok := equivocatoryVoters[just.AuthorityID]; ok { @@ -522,21 +521,30 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt } if count+len(equivocatoryVoters) < threshold { - return 0, 0, ErrMinVotesNotMet + return ErrMinVotesNotMet } err = verifyBlockHashAgainstBlockNumber(s.blockState, fj.Commit.Hash, uint(fj.Commit.Number)) if err != nil { - return 0, 0, fmt.Errorf("verifying block hash against block number: %w", err) + return fmt.Errorf("verifying block hash against block number: %w", err) } for _, preCommit := range fj.Commit.Precommits { err := verifyBlockHashAgainstBlockNumber(s.blockState, preCommit.Vote.Hash, uint(preCommit.Vote.Number)) if err != nil { - return 0, 0, fmt.Errorf("verifying block hash against block number: %w", err) + return fmt.Errorf("verifying block hash against block number: %w", err) } } - return fj.Round, setID, nil + + err = s.blockState.SetFinalisedHash(hash, fj.Round, setID) + if err != nil { + return fmt.Errorf("setting finalised hash: %w", err) + } + + logger.Debugf( + "set finalised block with hash %s, round %d and set id %d", + hash, fj.Round, setID) + return nil } func verifyBlockHashAgainstBlockNumber(bs BlockState, hash common.Hash, number uint) error { diff --git a/lib/grandpa/message_handler_integration_test.go b/lib/grandpa/message_handler_integration_test.go index 2368051944..d1321b0a01 100644 --- a/lib/grandpa/message_handler_integration_test.go +++ b/lib/grandpa/message_handler_integration_test.go @@ -772,11 +772,8 @@ func TestMessageHandler_VerifyBlockJustification_WithEquivocatoryVotes(t *testin just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - - actualRound, actualSetID, err := gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) - require.Equal(t, round, actualRound) - require.Equal(t, setID, actualSetID) } func TestMessageHandler_VerifyBlockJustification(t *testing.T) { @@ -843,10 +840,8 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - actualRound, actualSetID, err := gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) - require.Equal(t, round, actualRound) - require.Equal(t, setID, actualSetID) // use wrong hash, shouldn't verify precommits = buildTestJustification(t, 2, round+1, setID, kr, precommit) @@ -854,7 +849,7 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = testHeader2.Hash() data, err = scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrPrecommitBlockMismatch, err) } @@ -904,7 +899,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = genhash data, err := scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrPrecommitBlockMismatch, err) // use wrong round, shouldn't verify @@ -912,7 +907,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+2, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrInvalidSignature, err) // add authority not in set, shouldn't verify @@ -920,7 +915,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrAuthorityNotInSet, err) // not enough signatures, shouldn't verify @@ -928,7 +923,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrMinVotesNotMet, err) // mismatch justification header and block header @@ -937,7 +932,7 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { data, err = scale.Marshal(*just) require.NoError(t, err) otherHeader := types.NewEmptyHeader() - _, _, err = gs.VerifyBlockJustification(otherHeader.Hash(), data) + err = gs.VerifyBlockJustification(otherHeader.Hash(), data) require.ErrorIs(t, err, ErrJustificationMismatch) expectedErr := fmt.Sprintf("%s: justification %s and block hash %s", ErrJustificationMismatch, @@ -1006,7 +1001,7 @@ func TestMessageHandler_VerifyBlockJustification_ErrFinalisedBlockMismatch(t *te just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - _, _, err = gs.VerifyBlockJustification(testHash, data) + err = gs.VerifyBlockJustification(testHash, data) require.ErrorIs(t, err, errFinalisedBlocksMismatch) } @@ -1522,6 +1517,8 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). Return(true, nil).Times(3) mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) + mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), + uint64(0)).Return(nil) return mockBlockState }, grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { @@ -1550,6 +1547,8 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). Return(true, nil).Times(3) mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) + mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), + uint64(0)).Return(nil) return mockBlockState }, grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { @@ -1579,7 +1578,7 @@ func TestService_VerifyBlockJustification(t *testing.T) { //nolint blockState: tt.fields.blockStateBuilder(ctrl), grandpaState: tt.fields.grandpaStateBuilder(ctrl), } - _, _, err := s.VerifyBlockJustification(tt.args.hash, tt.args.justification) + err := s.VerifyBlockJustification(tt.args.hash, tt.args.justification) if tt.wantErr != nil { assert.ErrorContains(t, err, tt.wantErr.Error()) } else { diff --git a/lib/grandpa/votes_tracker_test.go b/lib/grandpa/votes_tracker_test.go index 54857b3678..91a9b220b8 100644 --- a/lib/grandpa/votes_tracker_test.go +++ b/lib/grandpa/votes_tracker_test.go @@ -5,22 +5,16 @@ package grandpa import ( "container/list" - "fmt" "sort" "testing" "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func TestA(t *testing.T) { - fmt.Println(scale.MustMarshal([]byte{})) -} - // buildVoteMessage creates a test vote message using the // given block hash and authority ID only. func buildVoteMessage(blockHash common.Hash, From 4888ce4cf10919a758f0f511256081bbd306f54c Mon Sep 17 00:00:00 2001 From: Timothy Wu Date: Mon, 4 Dec 2023 10:25:08 -0500 Subject: [PATCH 07/19] feat(pkg/scale): Add `Marshaler` and `Unmarshaler` interfaces and functionality (#3617) --- pkg/scale/decode.go | 17 ++++++++ pkg/scale/decode_test.go | 85 ++++++++++++++++++++++++++++++++++++++++ pkg/scale/encode.go | 16 ++++++++ pkg/scale/encode_test.go | 23 +++++++++++ 4 files changed, 141 insertions(+) diff --git a/pkg/scale/decode.go b/pkg/scale/decode.go index 45a527f0b8..bcd99c8d1c 100644 --- a/pkg/scale/decode.go +++ b/pkg/scale/decode.go @@ -75,6 +75,11 @@ func Unmarshal(data []byte, dst interface{}) (err error) { return } +// Unmarshaler is the interface for custom SCALE unmarshalling for a given type +type Unmarshaler interface { + UnmarshalSCALE(io.Reader) error +} + // Decoder is used to decode from an io.Reader type Decoder struct { decodeState @@ -108,6 +113,18 @@ type decodeState struct { } func (ds *decodeState) unmarshal(dstv reflect.Value) (err error) { + unmarshalerType := reflect.TypeOf((*Unmarshaler)(nil)).Elem() + if dstv.CanAddr() && dstv.Addr().Type().Implements(unmarshalerType) { + methodVal := dstv.Addr().MethodByName("UnmarshalSCALE") + values := methodVal.Call([]reflect.Value{reflect.ValueOf(ds.Reader)}) + if !values[0].IsNil() { + errIn := values[0].Interface() + err := errIn.(error) + return err + } + return + } + in := dstv.Interface() switch in.(type) { case *big.Int: diff --git a/pkg/scale/decode_test.go b/pkg/scale/decode_test.go index 3309c58a9b..713f3a7bce 100644 --- a/pkg/scale/decode_test.go +++ b/pkg/scale/decode_test.go @@ -5,6 +5,9 @@ package scale import ( "bytes" + "encoding/binary" + "fmt" + "io" "math/big" "reflect" "testing" @@ -535,3 +538,85 @@ func Test_decodeState_decodeUint(t *testing.T) { }) } } + +type myStruct struct { + First uint32 + Middle any + Last uint32 +} + +func (ms *myStruct) UnmarshalSCALE(reader io.Reader) (err error) { + buf := make([]byte, 4) + _, err = reader.Read(buf) + if err != nil { + return + } + ms.First = binary.LittleEndian.Uint32(buf) + + buf = make([]byte, 4) + _, err = reader.Read(buf) + if err != nil { + return + } + ms.Middle = binary.LittleEndian.Uint32(buf) + + buf = make([]byte, 4) + _, err = reader.Read(buf) + if err != nil { + return + } + ms.Last = binary.LittleEndian.Uint32(buf) + return nil +} + +type myStructError struct { + First uint32 + Middle any + Last uint32 +} + +func (mse *myStructError) UnmarshalSCALE(reader io.Reader) (err error) { + err = fmt.Errorf("eh?") + return err +} + +var _ Unmarshaler = &myStruct{} + +func Test_decodeState_Unmarshaller(t *testing.T) { + expected := myStruct{ + First: 1, + Middle: uint32(2), + Last: 3, + } + bytes := MustMarshal(expected) + ms := myStruct{} + Unmarshal(bytes, &ms) + assert.Equal(t, expected, ms) + + type myParentStruct struct { + First uint + Middle myStruct + Last uint + } + expectedParent := myParentStruct{ + First: 1, + Middle: expected, + Last: 3, + } + bytes = MustMarshal(expectedParent) + mps := myParentStruct{} + Unmarshal(bytes, &mps) + assert.Equal(t, expectedParent, mps) +} + +func Test_decodeState_Unmarshaller_Error(t *testing.T) { + expected := myStruct{ + First: 1, + Middle: uint32(2), + Last: 3, + } + bytes := MustMarshal(expected) + mse := myStructError{} + err := Unmarshal(bytes, &mse) + assert.Error(t, err, "eh?") +} diff --git a/pkg/scale/encode.go b/pkg/scale/encode.go index d312b85f91..c9830aef9d 100644 --- a/pkg/scale/encode.go +++ b/pkg/scale/encode.go @@ -47,6 +47,11 @@ func Marshal(v interface{}) (b []byte, err error) { return } +// Marshaler is the interface for custom SCALE marshalling for a given type +type Marshaler interface { + MarshalSCALE() ([]byte, error) +} + // MustMarshal runs Marshal and panics on error. func MustMarshal(v interface{}) (b []byte) { b, err := Marshal(v) @@ -62,6 +67,17 @@ type encodeState struct { } func (es *encodeState) marshal(in interface{}) (err error) { + marshaler, ok := in.(Marshaler) + if ok { + var bytes []byte + bytes, err = marshaler.MarshalSCALE() + if err != nil { + return + } + _, err = es.Write(bytes) + return + } + switch in := in.(type) { case int: err = es.encodeUint(uint(in)) diff --git a/pkg/scale/encode_test.go b/pkg/scale/encode_test.go index 92de411919..8f5d9a60ca 100644 --- a/pkg/scale/encode_test.go +++ b/pkg/scale/encode_test.go @@ -5,6 +5,7 @@ package scale import ( "bytes" + "fmt" "math/big" "reflect" "strings" @@ -1250,3 +1251,25 @@ var byteArray = func(length int) []byte { } return b } + +type myMarshalerType uint64 + +func (mmt myMarshalerType) MarshalSCALE() ([]byte, error) { + return []byte{9, 9, 9}, nil +} + +type myMarshalerTypeError uint64 + +func (mmt myMarshalerTypeError) MarshalSCALE() ([]byte, error) { + return nil, fmt.Errorf("eh?") +} + +func Test_encodeState_Mashaler(t *testing.T) { + bytes := MustMarshal(myMarshalerType(888)) + assert.Equal(t, []byte{9, 9, 9}, bytes) +} + +func Test_encodeState_Mashaler_Error(t *testing.T) { + _, err := Marshal(myMarshalerTypeError(888)) + assert.Error(t, err, "eh?") +} From 19dc82961e5c0d955ed0425b90caae94032b9ed1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:35:57 -0500 Subject: [PATCH 08/19] chore(deps): bump github.com/libp2p/go-libp2p-kad-dht from 0.25.1 to 0.25.2 (#3619) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eclésio Junior Co-authored-by: Diego Romero --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index da0afcf1f5..0ddf207590 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/jpillora/ipfilter v1.2.9 github.com/klauspost/compress v1.17.3 github.com/libp2p/go-libp2p v0.31.0 - github.com/libp2p/go-libp2p-kad-dht v0.25.1 + github.com/libp2p/go-libp2p-kad-dht v0.25.2 github.com/minio/sha256-simd v1.0.1 github.com/multiformats/go-multiaddr v0.12.0 github.com/nanobox-io/golang-scribble v0.0.0-20190309225732-aa3e7c118975 diff --git a/go.sum b/go.sum index fd178c2a57..bd0ab72669 100644 --- a/go.sum +++ b/go.sum @@ -500,8 +500,8 @@ github.com/libp2p/go-libp2p v0.31.0 h1:LFShhP8F6xthWiBBq3euxbKjZsoRajVEyBS9snfHx github.com/libp2p/go-libp2p v0.31.0/go.mod h1:W/FEK1c/t04PbRH3fA9i5oucu5YcgrG0JVoBWT1B7Eg= github.com/libp2p/go-libp2p-asn-util v0.3.0 h1:gMDcMyYiZKkocGXDQ5nsUQyquC9+H+iLEQHwOCZ7s8s= github.com/libp2p/go-libp2p-asn-util v0.3.0/go.mod h1:B1mcOrKUE35Xq/ASTmQ4tN3LNzVVaMNmq2NACuqyB9w= -github.com/libp2p/go-libp2p-kad-dht v0.25.1 h1:ofFNrf6MMEy4vi3R1VbJ7LOcTn3Csh0cDcaWHTxtWNA= -github.com/libp2p/go-libp2p-kad-dht v0.25.1/go.mod h1:6za56ncRHYXX4Nc2vn8z7CZK0P4QiMcrn77acKLM2Oo= +github.com/libp2p/go-libp2p-kad-dht v0.25.2 h1:FOIk9gHoe4YRWXTu8SY9Z1d0RILol0TrtApsMDPjAVQ= +github.com/libp2p/go-libp2p-kad-dht v0.25.2/go.mod h1:6za56ncRHYXX4Nc2vn8z7CZK0P4QiMcrn77acKLM2Oo= github.com/libp2p/go-libp2p-kbucket v0.6.3 h1:p507271wWzpy2f1XxPzCQG9NiN6R6lHL9GiSErbQQo0= github.com/libp2p/go-libp2p-kbucket v0.6.3/go.mod h1:RCseT7AH6eJWxxk2ol03xtP9pEHetYSPXOaJnOiD8i0= github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= From bb4c105335264403454300cba52e4261fac176c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:11:21 -0400 Subject: [PATCH 09/19] chore(deps): bump golang.org/x/term from 0.14.0 to 0.15.0 (#3621) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 0ddf207590..6e53725b84 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( 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 + golang.org/x/term v0.15.0 google.golang.org/protobuf v1.31.0 ) @@ -191,7 +191,7 @@ require ( golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.13.0 // indirect gonum.org/v1/gonum v0.13.0 // indirect diff --git a/go.sum b/go.sum index bd0ab72669..ef0703914d 100644 --- a/go.sum +++ b/go.sum @@ -1052,11 +1052,11 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 7ebf37aeb21adb69b3e3b8ffdda33e4b22554ca2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:58:57 +0000 Subject: [PATCH 10/19] chore(deps): bump github.com/klauspost/compress from 1.17.3 to 1.17.4 (#3620) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6e53725b84..da6fafebd6 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/gtank/merlin v0.1.1 github.com/ipfs/go-ds-badger2 v0.1.3 github.com/jpillora/ipfilter v1.2.9 - github.com/klauspost/compress v1.17.3 + github.com/klauspost/compress v1.17.4 github.com/libp2p/go-libp2p v0.31.0 github.com/libp2p/go-libp2p-kad-dht v0.25.2 github.com/minio/sha256-simd v1.0.1 diff --git a/go.sum b/go.sum index ef0703914d..e7401fcb5b 100644 --- a/go.sum +++ b/go.sum @@ -467,8 +467,8 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= From 43828fe0c20b0ae4dc58f2a45d2cd00f1768569b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Wed, 6 Dec 2023 16:38:56 -0400 Subject: [PATCH 11/19] feat(dot/rpc): export block trie state entries for a block hash (#3607) --- dot/rpc/modules/rpc.go | 1 + dot/rpc/modules/state.go | 47 +++++++++++++++++ dot/rpc/modules/state_test.go | 93 ++++++++++++++++++++++++++++++++++ tests/rpc/rpc_05-state_test.go | 31 +++++++++++- 4 files changed, 170 insertions(+), 2 deletions(-) diff --git a/dot/rpc/modules/rpc.go b/dot/rpc/modules/rpc.go index 9170d76e06..1a01adabbd 100644 --- a/dot/rpc/modules/rpc.go +++ b/dot/rpc/modules/rpc.go @@ -19,6 +19,7 @@ var ( "state_getPairs", "state_getKeysPaged", "state_queryStorage", + "state_trie", } // AliasesMethods is a map that links the original methods to their aliases diff --git a/dot/rpc/modules/state.go b/dot/rpc/modules/state.go index 742b023f6f..1cae7e3612 100644 --- a/dot/rpc/modules/state.go +++ b/dot/rpc/modules/state.go @@ -11,6 +11,7 @@ import ( "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" ) @@ -82,6 +83,10 @@ type StateStorageQueryAtRequest struct { At common.Hash `json:"at"` } +type StateTrieAtRequest struct { + At *common.Hash `json:"at"` +} + // StateStorageKeysQuery field to store storage keys type StateStorageKeysQuery [][]byte @@ -112,6 +117,8 @@ type StateStorageResponse string // StatePairResponse is a key values type StatePairResponse []interface{} +type StateTrieResponse []string + // StateStorageKeysResponse field for storage keys type StateStorageKeysResponse []string @@ -245,6 +252,46 @@ func (sm *StateModule) GetPairs(_ *http.Request, req *StatePairRequest, res *Sta return nil } +// Trie RPC method returns a list of scale encoded trie.Entry{Key byte, Value byte} representing +// all the entries in a trie for a block hash, if no block hash is given then it uses the best block hash +func (sm *StateModule) Trie(_ *http.Request, req *StateTrieAtRequest, res *StateTrieResponse) error { + var blockHash common.Hash + + if req.At != nil { + blockHash = *req.At + } else { + blockHash = sm.blockAPI.BestBlockHash() + } + + blockHeader, err := sm.blockAPI.GetHeader(blockHash) + if err != nil { + return fmt.Errorf("getting header: %w", err) + } + + entries, err := sm.storageAPI.Entries(&blockHeader.StateRoot) + if err != nil { + return fmt.Errorf("getting entries: %w", err) + } + + entriesArr := make([]string, 0, len(entries)) + for key, value := range entries { + entry := trie.Entry{ + Key: []byte(key), + Value: value, + } + + encodedEntry, err := scale.Marshal(entry) + if err != nil { + return fmt.Errorf("scale encoding entry: %w", err) + } + + entriesArr = append(entriesArr, common.BytesToHex(encodedEntry)) + } + + *res = entriesArr + return nil +} + // Call makes a call to the runtime. func (sm *StateModule) Call(_ *http.Request, req *StateCallRequest, res *StateCallResponse) error { var blockHash common.Hash diff --git a/dot/rpc/modules/state_test.go b/dot/rpc/modules/state_test.go index 3d6a6764eb..491922804d 100644 --- a/dot/rpc/modules/state_test.go +++ b/dot/rpc/modules/state_test.go @@ -18,9 +18,11 @@ package modules import ( "errors" "net/http" + "slices" "testing" wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero" + "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" testdata "github.com/ChainSafe/gossamer/dot/rpc/modules/test_data" @@ -30,6 +32,7 @@ import ( "github.com/ChainSafe/gossamer/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) @@ -308,6 +311,96 @@ func TestCall(t *testing.T) { assert.NotEmpty(t, res) } +func TestStateTrie(t *testing.T) { + expecificBlockHash := common.Hash([32]byte{6, 6, 6, 6, 6, 6}) + var expectedEncodedSlice []string + entries := []trie.Entry{ + {Key: []byte("entry-1"), Value: []byte{0, 1, 2, 3}}, + {Key: []byte("entry-2"), Value: []byte{3, 4, 5, 6}}, + } + + for _, entry := range entries { + expectedEncodedSlice = append(expectedEncodedSlice, common.BytesToHex(scale.MustMarshal(entry))) + } + + testcases := map[string]struct { + request StateTrieAtRequest + newStateModule func(t *testing.T) *StateModule + expected StateTrieResponse + }{ + "blockhash_parameter_nil": { + request: StateTrieAtRequest{At: nil}, + expected: expectedEncodedSlice, + newStateModule: func(t *testing.T) *StateModule { + ctrl := gomock.NewController(t) + + bestBlockHash := common.Hash([32]byte{1, 0, 1, 0, 1}) + blockAPIMock := NewMockBlockAPI(ctrl) + blockAPIMock.EXPECT().BestBlockHash().Return(bestBlockHash) + + fakeStateRoot := common.Hash([32]byte{5, 5, 5, 5, 5}) + fakeBlockHeader := types.NewHeader(common.EmptyHash, fakeStateRoot, + common.EmptyHash, 1, scale.VaryingDataTypeSlice{}) + + blockAPIMock.EXPECT().GetHeader(bestBlockHash).Return(fakeBlockHeader, nil) + + fakeEntries := map[string][]byte{ + "entry-1": {0, 1, 2, 3}, + "entry-2": {3, 4, 5, 6}, + } + storageAPIMock := NewMockStorageAPI(ctrl) + storageAPIMock.EXPECT().Entries(&fakeStateRoot). + Return(fakeEntries, nil) + + sm := NewStateModule(nil, storageAPIMock, nil, blockAPIMock) + return sm + }, + }, + "blockhash_parameter_not_nil": { + request: StateTrieAtRequest{At: &expecificBlockHash}, + expected: expectedEncodedSlice, + newStateModule: func(t *testing.T) *StateModule { + ctrl := gomock.NewController(t) + blockAPIMock := NewMockBlockAPI(ctrl) + + fakeStateRoot := common.Hash([32]byte{5, 5, 5, 5, 5}) + fakeBlockHeader := types.NewHeader(common.EmptyHash, fakeStateRoot, + common.EmptyHash, 1, scale.VaryingDataTypeSlice{}) + + blockAPIMock.EXPECT().GetHeader(expecificBlockHash). + Return(fakeBlockHeader, nil) + + fakeEntries := map[string][]byte{ + "entry-1": {0, 1, 2, 3}, + "entry-2": {3, 4, 5, 6}, + } + storageAPIMock := NewMockStorageAPI(ctrl) + storageAPIMock.EXPECT().Entries(&fakeStateRoot). + Return(fakeEntries, nil) + + sm := NewStateModule(nil, storageAPIMock, nil, blockAPIMock) + return sm + }, + }, + } + + for tname, tt := range testcases { + tt := tt + + t.Run(tname, func(t *testing.T) { + sm := tt.newStateModule(t) + + var res StateTrieResponse + err := sm.Trie(nil, &tt.request, &res) + require.NoError(t, err) + + slices.Sort(tt.expected) + slices.Sort(res) + require.Equal(t, tt.expected, res) + }) + } +} + func TestStateModuleGetMetadata(t *testing.T) { ctrl := gomock.NewController(t) diff --git a/tests/rpc/rpc_05-state_test.go b/tests/rpc/rpc_05-state_test.go index e40b21e523..9d3573cce8 100644 --- a/tests/rpc/rpc_05-state_test.go +++ b/tests/rpc/rpc_05-state_test.go @@ -10,10 +10,11 @@ import ( "time" "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/lib/trie" libutils "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/pkg/scale" "github.com/ChainSafe/gossamer/tests/utils/config" "github.com/ChainSafe/gossamer/tests/utils/node" "github.com/ChainSafe/gossamer/tests/utils/rpc" @@ -33,6 +34,32 @@ func TestStateRPCResponseValidation(t *testing.T) { //nolint:tparallel getBlockHashCancel() require.NoError(t, err) + t.Run("state_trie", func(t *testing.T) { + t.Parallel() + const westendDevGenesisHash = "0x276bfa91f70859348285599321ea96afd3ae681f0be47d36196bac8075ea32e8" + const westendDevStateRoot = "0x953044ba4386a72ae434d2a2fbdfca77640a28ac3841a924674cbfe7a8b9a81c" + params := fmt.Sprintf(`["%s"]`, westendDevGenesisHash) + + var response modules.StateTrieResponse + fetchWithTimeout(ctx, t, "state_trie", params, &response) + + entries := make(map[string]string, len(response)) + for _, encodedEntry := range response { + bytesEncodedEntry := common.MustHexToBytes(encodedEntry) + + entry := trie.Entry{} + err := scale.Unmarshal(bytesEncodedEntry, &entry) + require.NoError(t, err) + entries[common.BytesToHex(entry.Key)] = common.BytesToHex(entry.Value) + } + + newTrie, err := trie.LoadFromMap(entries) + require.NoError(t, err) + + trieHash := newTrie.MustHash(trie.V0.MaxInlineValue()) + require.Equal(t, westendDevStateRoot, trieHash.String()) + }) + // TODO: Improve runtime tests // https://github.com/ChainSafe/gossamer/issues/3234 t.Run("state_call", func(t *testing.T) { From ecb1ad91b9119d2c6e8eec0894e769aa0cf5b586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Thu, 7 Dec 2023 10:59:05 -0400 Subject: [PATCH 12/19] fix(lib/runtime): Fix `wasm error: out of bounds memory access` at `#9412261` (#3588) --- go.mod | 2 +- go.sum | 4 ++-- lib/runtime/allocator/freeing_bump.go | 2 +- lib/runtime/memory.go | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index da6fafebd6..f3d84cdd51 100644 --- a/go.mod +++ b/go.mod @@ -203,6 +203,6 @@ require ( go 1.21 -replace github.com/tetratelabs/wazero => github.com/ChainSafe/wazero v0.0.0-20230710171859-39a4c235ec1f +replace github.com/tetratelabs/wazero => github.com/ChainSafe/wazero v0.0.0-20231114190045-1d874d099362 replace github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/timwu20/go-substrate-rpc-client/v4 v4.0.0-20231110032757-3d8e441b7303 diff --git a/go.sum b/go.sum index e7401fcb5b..7953584412 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.1.0 h1:rZ6EU+CZFCjB4sHUE1jIu8VDoB/wRKZxoe1tkcO71Wk= github.com/ChainSafe/go-schnorrkel v1.1.0/go.mod h1:ABkENxiP+cvjFiByMIZ9LYbRoNNLeBLiakC1XeTFxfE= -github.com/ChainSafe/wazero v0.0.0-20230710171859-39a4c235ec1f h1:/sI8TMJ77HL2UImQs7pY7khVN96EXQJGVOrX88dTpcY= -github.com/ChainSafe/wazero v0.0.0-20230710171859-39a4c235ec1f/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= +github.com/ChainSafe/wazero v0.0.0-20231114190045-1d874d099362 h1:hbvvSSB436JJalwq/2fRZwJpptvq9HMOLYVZX9oVHKM= +github.com/ChainSafe/wazero v0.0.0-20231114190045-1d874d099362/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= diff --git a/lib/runtime/allocator/freeing_bump.go b/lib/runtime/allocator/freeing_bump.go index 6c328f2e48..14635a0741 100644 --- a/lib/runtime/allocator/freeing_bump.go +++ b/lib/runtime/allocator/freeing_bump.go @@ -37,7 +37,7 @@ const ( MaxPossibleAllocations uint32 = 33554432 PageSize = 65536 - MaxWasmPages = 4 * 1024 * 1024 * 1024 / PageSize + MaxWasmPages = (4 * 1024 * 1024 * 1024 / PageSize) - 1 ) var ( diff --git a/lib/runtime/memory.go b/lib/runtime/memory.go index 4bc277c073..a89090f1ac 100644 --- a/lib/runtime/memory.go +++ b/lib/runtime/memory.go @@ -3,9 +3,6 @@ package runtime -// PageSize is 65kb -const PageSize = 65536 - // Memory is the interface for WASM memory type Memory interface { // Size returns the size in bytes available. e.g. If the underlying memory From 1126ad46aadc06e6244203c28a661c0a918b35f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:13:39 +0000 Subject: [PATCH 13/19] chore(deps): bump golang.org/x/crypto from 0.15.0 to 0.16.0 (#3618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eclésio Junior --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f3d84cdd51..d90dd52ff9 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( 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/crypto v0.16.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/term v0.15.0 google.golang.org/protobuf v1.31.0 diff --git a/go.sum b/go.sum index 7953584412..2d48ba19ee 100644 --- a/go.sum +++ b/go.sum @@ -868,8 +868,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= From 58f741d8d4d98ef7e8a66116f7ef77fe945b8fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ecl=C3=A9sio=20Junior?= Date: Thu, 7 Dec 2023 15:49:17 -0400 Subject: [PATCH 14/19] fix(dot/state): store raw authority keys and decode when verifying block signature (#3627) Co-authored-by: Timothy Wu --- dot/digest/digest_integration_test.go | 5 +- dot/state/epoch.go | 61 +++++++------------ dot/state/epoch_test.go | 32 ++++------ dot/types/consensus_digest.go | 13 ++-- lib/babe/babe.go | 12 ++-- lib/babe/babe_integration_test.go | 6 +- lib/babe/crypto.go | 6 +- lib/babe/epoch.go | 8 +-- lib/babe/epoch_handler_integration_test.go | 14 +++-- lib/babe/epoch_integration_test.go | 57 +++++++----------- lib/babe/epoch_test.go | 18 +++--- lib/babe/mock_state_test.go | 42 +++++-------- lib/babe/state.go | 5 +- lib/babe/types.go | 2 +- lib/babe/verify.go | 30 +++++----- lib/babe/verify_integration_test.go | 37 ++++-------- lib/babe/verify_test.go | 70 +++++++++++----------- 17 files changed, 177 insertions(+), 241 deletions(-) diff --git a/dot/digest/digest_integration_test.go b/dot/digest/digest_integration_test.go index 5080fdd276..9133f4af9a 100644 --- a/dot/digest/digest_integration_test.go +++ b/dot/digest/digest_integration_test.go @@ -316,7 +316,7 @@ func TestHandler_HandleNextEpochData(t *testing.T) { handler.handleBlockFinalisation(ctx) - stored, err := handler.epochState.(*state.EpochState).GetEpochData(targetEpoch, nil) + stored, err := handler.epochState.(*state.EpochState).GetEpochDataRaw(targetEpoch, nil) require.NoError(t, err) digestValue, err := digest.Value() @@ -326,8 +326,7 @@ func TestHandler_HandleNextEpochData(t *testing.T) { t.Fatal() } - res, err := act.ToEpochData() - require.NoError(t, err) + res := act.ToEpochDataRaw() require.Equal(t, res, stored) } diff --git a/dot/state/epoch.go b/dot/state/epoch.go index c318c3874e..98f124eaf6 100644 --- a/dot/state/epoch.go +++ b/dot/state/epoch.go @@ -95,15 +95,12 @@ func NewEpochStateFromGenesis(db database.Database, blockState *BlockState, nextConfigData: make(nextEpochMap[types.NextConfigDataV1]), } - auths, err := types.BABEAuthorityRawToAuthority(genesisConfig.GenesisAuthorities) - if err != nil { - return nil, err + epochDataRaw := &types.EpochDataRaw{ + Authorities: genesisConfig.GenesisAuthorities, + Randomness: genesisConfig.Randomness, } - err = s.SetEpochData(0, &types.EpochData{ - Authorities: auths, - Randomness: genesisConfig.Randomness, - }) + err = s.SetEpochDataRaw(0, epochDataRaw) if err != nil { return nil, err } @@ -235,10 +232,8 @@ func (s *EpochState) GetEpochForBlock(header *types.Header) (uint64, error) { return 0, errNoPreRuntimeDigest } -// SetEpochData sets the epoch data for a given epoch -func (s *EpochState) SetEpochData(epoch uint64, info *types.EpochData) error { - raw := info.ToEpochDataRaw() - +// SetEpochDataRaw sets the epoch data raw for a given epoch +func (s *EpochState) SetEpochDataRaw(epoch uint64, raw *types.EpochDataRaw) error { enc, err := scale.Marshal(*raw) if err != nil { return err @@ -247,17 +242,17 @@ func (s *EpochState) SetEpochData(epoch uint64, info *types.EpochData) error { return s.db.Put(epochDataKey(epoch), enc) } -// GetEpochData returns the epoch data for a given epoch persisted in database +// GetEpochDataRaw returns the raw epoch data for a given epoch persisted in database // otherwise will try to get the data from the in-memory map using the header // if the header params is nil then it will search only in database -func (s *EpochState) GetEpochData(epoch uint64, header *types.Header) (*types.EpochData, error) { - epochData, err := s.getEpochDataFromDatabase(epoch) +func (s *EpochState) GetEpochDataRaw(epoch uint64, header *types.Header) (*types.EpochDataRaw, error) { + epochDataRaw, err := s.getEpochDataRawFromDatabase(epoch) if err != nil && !errors.Is(err, database.ErrNotFound) { return nil, fmt.Errorf("failed to retrieve epoch data from database: %w", err) } - if epochData != nil { - return epochData, nil + if epochDataRaw != nil { + return epochDataRaw, nil } if header == nil { @@ -272,38 +267,33 @@ func (s *EpochState) GetEpochData(epoch uint64, header *types.Header) (*types.Ep return nil, fmt.Errorf("failed to get epoch data from memory: %w", err) } - epochData, err = inMemoryEpochData.ToEpochData() - if err != nil { - return nil, fmt.Errorf("cannot transform into epoch data: %w", err) - } - - return epochData, nil + return inMemoryEpochData.ToEpochDataRaw(), nil } -// getEpochDataFromDatabase returns the epoch data for a given epoch persisted in database -func (s *EpochState) getEpochDataFromDatabase(epoch uint64) (*types.EpochData, error) { +// getEpochDataRawFromDatabase returns the epoch data for a given epoch persisted in database +func (s *EpochState) getEpochDataRawFromDatabase(epoch uint64) (*types.EpochDataRaw, error) { enc, err := s.db.Get(epochDataKey(epoch)) if err != nil { return nil, err } - raw := &types.EpochDataRaw{} + raw := new(types.EpochDataRaw) err = scale.Unmarshal(enc, raw) if err != nil { - return nil, err + return nil, fmt.Errorf("unmarshaling into epoch data raw: %w", err) } - return raw.ToEpochData() + return raw, nil } -// GetLatestEpochData returns the EpochData for the current epoch -func (s *EpochState) GetLatestEpochData() (*types.EpochData, error) { +// GetLatestEpochDataRaw returns the EpochData for the current epoch +func (s *EpochState) GetLatestEpochDataRaw() (*types.EpochDataRaw, error) { curr, err := s.GetCurrentEpoch() if err != nil { return nil, err } - return s.GetEpochData(curr, nil) + return s.GetEpochDataRaw(curr, nil) } // SetConfigData sets the BABE config data for a given epoch @@ -586,7 +576,7 @@ func (s *EpochState) FinalizeBABENextEpochData(finalizedHeader *types.Header) er nextEpoch = finalizedBlockEpoch + 1 } - epochInDatabase, err := s.getEpochDataFromDatabase(nextEpoch) + epochRawInDatabase, err := s.getEpochDataRawFromDatabase(nextEpoch) // if an error occurs and the error is database.ErrNotFound we ignore // since this error is what we will handle in the next lines @@ -595,7 +585,7 @@ func (s *EpochState) FinalizeBABENextEpochData(finalizedHeader *types.Header) er } // epoch data already defined we don't need to lookup in the map - if epochInDatabase != nil { + if epochRawInDatabase != nil { return nil } @@ -604,12 +594,7 @@ func (s *EpochState) FinalizeBABENextEpochData(finalizedHeader *types.Header) er return fmt.Errorf("cannot find next epoch data: %w", err) } - ed, err := finalizedNextEpochData.ToEpochData() - if err != nil { - return fmt.Errorf("cannot transform epoch data: %w", err) - } - - err = s.SetEpochData(nextEpoch, ed) + err = s.SetEpochDataRaw(nextEpoch, finalizedNextEpochData.ToEpochDataRaw()) if err != nil { return fmt.Errorf("cannot set epoch data: %w", err) } diff --git a/dot/state/epoch_test.go b/dot/state/epoch_test.go index 93ec72b2b2..7a8c92c8d4 100644 --- a/dot/state/epoch_test.go +++ b/dot/state/epoch_test.go @@ -58,46 +58,42 @@ func TestEpochState_EpochData(t *testing.T) { keyring, err := keystore.NewSr25519Keyring() require.NoError(t, err) - auth := types.Authority{ - Key: keyring.Alice().Public().(*sr25519.PublicKey), + auth := types.AuthorityRaw{ + Key: keyring.Alice().Public().(*sr25519.PublicKey).AsBytes(), Weight: 1, } - info := &types.EpochData{ - Authorities: []types.Authority{auth}, + info := &types.EpochDataRaw{ + Authorities: []types.AuthorityRaw{auth}, Randomness: [32]byte{77}, } - err = s.SetEpochData(1, info) + err = s.SetEpochDataRaw(1, info) require.NoError(t, err) - res, err := s.GetEpochData(1, nil) + res, err := s.GetEpochDataRaw(1, nil) require.NoError(t, err) require.Equal(t, info.Randomness, res.Randomness) for i, auth := range res.Authorities { - expected, err := info.Authorities[i].Encode() - require.NoError(t, err) - res, err := auth.Encode() - require.NoError(t, err) - require.Equal(t, expected, res) + require.Equal(t, info.Authorities[i], auth) } } func TestEpochState_GetStartSlotForEpoch(t *testing.T) { s := newEpochStateFromGenesis(t) - info := &types.EpochData{ + info := &types.EpochDataRaw{ Randomness: [32]byte{77}, } - err := s.SetEpochData(2, info) + err := s.SetEpochDataRaw(2, info) require.NoError(t, err) - info = &types.EpochData{ + info = &types.EpochDataRaw{ Randomness: [32]byte{77}, } - err = s.SetEpochData(3, info) + err = s.SetEpochDataRaw(3, info) require.NoError(t, err) start, err := s.GetStartSlotForEpoch(0) @@ -405,10 +401,8 @@ func TestStoreAndFinalizeBabeNextEpochData(t *testing.T) { } else { require.NoError(t, err) - expected, err := expectedNextEpochData.ToEpochData() - require.NoError(t, err) - - gotNextEpochData, err := epochState.GetEpochData(tt.finalizeEpoch, nil) + expected := expectedNextEpochData.ToEpochDataRaw() + gotNextEpochData, err := epochState.GetEpochDataRaw(tt.finalizeEpoch, nil) require.NoError(t, err) require.Equal(t, expected, gotNextEpochData) diff --git a/dot/types/consensus_digest.go b/dot/types/consensus_digest.go index 9cb061e325..d6719c3b91 100644 --- a/dot/types/consensus_digest.go +++ b/dot/types/consensus_digest.go @@ -102,16 +102,11 @@ func (d NextEpochData) String() string { //skipcq: GO-W1029 } // ToEpochData returns the NextEpochData as EpochData -func (d *NextEpochData) ToEpochData() (*EpochData, error) { //skipcq: GO-W1029 - auths, err := BABEAuthorityRawToAuthority(d.Authorities) - if err != nil { - return nil, err - } - - return &EpochData{ - Authorities: auths, +func (d *NextEpochData) ToEpochDataRaw() *EpochDataRaw { + return &EpochDataRaw{ + Authorities: d.Authorities, Randomness: d.Randomness, - }, nil + } } // BABEOnDisabled represents a GRANDPA authority being disabled diff --git a/lib/babe/babe.go b/lib/babe/babe.go index 0ef35b8244..a7aa8d3c19 100644 --- a/lib/babe/babe.go +++ b/lib/babe/babe.go @@ -258,12 +258,8 @@ func (b *Service) Stop() error { } // Authorities returns the current BABE authorities -func (b *Service) Authorities() []types.Authority { - auths := make([]types.Authority, len(b.epochHandler.epochData.authorities)) - for i, auth := range b.epochHandler.epochData.authorities { - auths[i] = *auth.DeepCopy() - } - return auths +func (b *Service) AuthoritiesRaw() []types.AuthorityRaw { + return b.epochHandler.epochData.authorities } // IsStopped returns true if the service is stopped (ie not producing blocks) @@ -271,7 +267,7 @@ func (b *Service) IsStopped() bool { return b.ctx.Err() != nil } -func (b *Service) getAuthorityIndex(Authorities []types.Authority) (uint32, error) { +func (b *Service) getAuthorityIndex(Authorities []types.AuthorityRaw) (uint32, error) { if !b.authority { return 0, ErrNotAuthority } @@ -279,7 +275,7 @@ func (b *Service) getAuthorityIndex(Authorities []types.Authority) (uint32, erro pub := b.keypair.Public() for i, auth := range Authorities { - if bytes.Equal(pub.Encode(), auth.Key.Encode()) { + if bytes.Equal(pub.Encode(), auth.Key[:]) { return uint32(i), nil } } diff --git a/lib/babe/babe_integration_test.go b/lib/babe/babe_integration_test.go index 43a216e445..1a2c2f303e 100644 --- a/lib/babe/babe_integration_test.go +++ b/lib/babe/babe_integration_test.go @@ -64,9 +64,9 @@ func TestService_GetAuthorityIndex(t *testing.T) { pubA := kpA.Public().(*sr25519.PublicKey) pubB := kpB.Public().(*sr25519.PublicKey) - authData := []types.Authority{ - {Key: pubA, Weight: 1}, - {Key: pubB, Weight: 1}, + authData := []types.AuthorityRaw{ + {Key: pubA.AsBytes(), Weight: 1}, + {Key: pubB.AsBytes(), Weight: 1}, } bs := &Service{ diff --git a/lib/babe/crypto.go b/lib/babe/crypto.go index 63830f149c..9458c82459 100644 --- a/lib/babe/crypto.go +++ b/lib/babe/crypto.go @@ -94,7 +94,7 @@ func checkPrimaryThreshold(randomness Randomness, func claimSecondarySlotVRF(randomness Randomness, slot, epoch uint64, - authorities []types.Authority, + authorities []types.AuthorityRaw, keypair *sr25519.Keypair, authorityIndex uint32, ) (*VrfOutputAndProof, error) { @@ -123,8 +123,8 @@ func claimSecondarySlotVRF(randomness Randomness, }, nil } -func claimSecondarySlotPlain(randomness Randomness, slot uint64, authorities []types.Authority, authorityIndex uint32, -) error { +func claimSecondarySlotPlain(randomness Randomness, slot uint64, + authorities []types.AuthorityRaw, authorityIndex uint32) error { secondarySlotAuthor, err := getSecondarySlotAuthor(slot, len(authorities), randomness) if err != nil { return fmt.Errorf("cannot get secondary slot author: %w", err) diff --git a/lib/babe/epoch.go b/lib/babe/epoch.go index 7cf51873be..69b8493b2b 100644 --- a/lib/babe/epoch.go +++ b/lib/babe/epoch.go @@ -95,7 +95,7 @@ func (b *Service) getEpochData(epoch uint64, bestBlock *types.Header) (*epochDat return epochData, nil } - currEpochData, err := b.epochState.GetEpochData(epoch, bestBlock) + currEpochData, err := b.epochState.GetEpochDataRaw(epoch, bestBlock) if err != nil { return nil, fmt.Errorf("cannot get epoch data for epoch %d: %w", epoch, err) } @@ -127,13 +127,13 @@ func (b *Service) getEpochData(epoch uint64, bestBlock *types.Header) (*epochDat func (b *Service) getLatestEpochData() (resEpochData *epochData, error error) { resEpochData = &epochData{} - epochData, err := b.epochState.GetLatestEpochData() + epochDataRaw, err := b.epochState.GetLatestEpochDataRaw() if err != nil { return nil, fmt.Errorf("cannot get latest epoch data: %w", err) } - resEpochData.randomness = epochData.Randomness - resEpochData.authorities = epochData.Authorities + resEpochData.randomness = epochDataRaw.Randomness + resEpochData.authorities = epochDataRaw.Authorities configData, err := b.epochState.GetLatestConfigData() if err != nil { diff --git a/lib/babe/epoch_handler_integration_test.go b/lib/babe/epoch_handler_integration_test.go index bb8eac33a5..f1c7d98774 100644 --- a/lib/babe/epoch_handler_integration_test.go +++ b/lib/babe/epoch_handler_integration_test.go @@ -24,8 +24,11 @@ func TestEpochHandler_run_shouldReturnAfterContextCancel(t *testing.T) { epochData := &epochData{ threshold: scale.MaxUint128, authorityIndex: authorityIndex, - authorities: []types.Authority{ - *types.NewAuthority(aliceKeyPair.Public(), 1), + authorities: []types.AuthorityRaw{ + { + Key: [32]byte(aliceKeyPair.Public().Encode()), + Weight: 1, + }, }, } @@ -66,8 +69,11 @@ func TestEpochHandler_run(t *testing.T) { epochData := &epochData{ threshold: scale.MaxUint128, authorityIndex: authorityIndex, - authorities: []types.Authority{ - *types.NewAuthority(aliceKeyPair.Public(), 1), + authorities: []types.AuthorityRaw{ + { + Key: [32]byte(aliceKeyPair.Public().Encode()), + Weight: 1, + }, }, } diff --git a/lib/babe/epoch_integration_test.go b/lib/babe/epoch_integration_test.go index 6cdd6a8946..5094ae0374 100644 --- a/lib/babe/epoch_integration_test.go +++ b/lib/babe/epoch_integration_test.go @@ -42,15 +42,15 @@ func TestInitiateEpoch_Epoch1(t *testing.T) { state.AddBlocksToState(t, babeService.blockState.(*state.BlockState), 1, false) // epoch 1, check that genesis EpochData and ConfigData was properly set - auth := types.Authority{ - Key: babeService.keypair.Public().(*sr25519.PublicKey), + auth := types.AuthorityRaw{ + Key: babeService.keypair.Public().(*sr25519.PublicKey).AsBytes(), Weight: 1, } - data, err := babeService.epochState.GetEpochData(0, nil) + data, err := babeService.epochState.GetEpochDataRaw(0, nil) require.NoError(t, err) - data.Authorities = []types.Authority{auth} - err = babeService.epochState.(*state.EpochState).SetEpochData(1, data) + data.Authorities = []types.AuthorityRaw{auth} + err = babeService.epochState.(*state.EpochState).SetEpochDataRaw(1, data) require.NoError(t, err) ed, err := babeService.initiateEpoch(1) @@ -58,7 +58,7 @@ func TestInitiateEpoch_Epoch1(t *testing.T) { expected := &epochData{ randomness: [32]byte{}, - authorities: []types.Authority{auth}, + authorities: []types.AuthorityRaw{auth}, authorityIndex: 0, threshold: ed.threshold, } @@ -67,20 +67,16 @@ func TestInitiateEpoch_Epoch1(t *testing.T) { require.Equal(t, expected.threshold, ed.threshold) for i, auth := range ed.authorities { - expAuth, err := expected.authorities[i].Encode() - require.NoError(t, err) - res, err := auth.Encode() - require.NoError(t, err) - require.Equal(t, expAuth, res) + require.Equal(t, expected.authorities[i], auth) } // for epoch 2, set EpochData but not ConfigData - edata := &types.EpochData{ + edata := &types.EpochDataRaw{ Authorities: ed.authorities, Randomness: [32]byte{9}, } - err = babeService.epochState.(*state.EpochState).SetEpochData(2, edata) + err = babeService.epochState.(*state.EpochState).SetEpochDataRaw(2, edata) require.NoError(t, err) expected = &epochData{ @@ -97,20 +93,16 @@ func TestInitiateEpoch_Epoch1(t *testing.T) { require.Equal(t, expected.threshold, ed.threshold) for i, auth := range ed.authorities { - expAuth, err := expected.authorities[i].Encode() - require.NoError(t, err) - res, err := auth.Encode() - require.NoError(t, err) - require.Equal(t, expAuth, res) + require.Equal(t, expected.authorities[i], auth) } // for epoch 3, set EpochData and ConfigData - edata = &types.EpochData{ + edata = &types.EpochDataRaw{ Authorities: ed.authorities, Randomness: [32]byte{9}, } - err = babeService.epochState.(*state.EpochState).SetEpochData(3, edata) + err = babeService.epochState.(*state.EpochState).SetEpochDataRaw(3, edata) require.NoError(t, err) cdata := &types.ConfigData{ @@ -158,12 +150,11 @@ func TestService_getLatestEpochData_genesis(t *testing.T) { latestEpochData, err := service.getLatestEpochData() require.NoError(t, err) - auths, err := types.BABEAuthorityRawToAuthority(genesisCfg.GenesisAuthorities) - require.NoError(t, err) - threshold, err := CalculateThreshold(genesisCfg.C1, genesisCfg.C2, len(auths)) + + threshold, err := CalculateThreshold(genesisCfg.C1, genesisCfg.C2, len(genesisCfg.GenesisAuthorities)) require.NoError(t, err) - require.Equal(t, auths, latestEpochData.authorities) + require.Equal(t, genesisCfg.GenesisAuthorities, latestEpochData.authorities) require.Equal(t, threshold, latestEpochData.threshold) require.Equal(t, genesisCfg.Randomness, latestEpochData.randomness) } @@ -175,14 +166,11 @@ func TestService_getLatestEpochData_epochData(t *testing.T) { err := epochState.SetCurrentEpoch(1) require.NoError(t, err) - auths, err := types.BABEAuthorityRawToAuthority(genesisCfg.GenesisAuthorities) - require.NoError(t, err) - - data := &types.EpochData{ - Authorities: auths, + data := &types.EpochDataRaw{ + Authorities: genesisCfg.GenesisAuthorities, Randomness: [types.RandomnessLength]byte{99, 88, 77}, } - err = epochState.SetEpochData(1, data) + err = epochState.SetEpochDataRaw(1, data) require.NoError(t, err) ed, err := service.getLatestEpochData() @@ -201,14 +189,11 @@ func TestService_getLatestEpochData_configData(t *testing.T) { err := epochState.SetCurrentEpoch(7) require.NoError(t, err) - auths, err := types.BABEAuthorityRawToAuthority(genesisCfg.GenesisAuthorities) - require.NoError(t, err) - - data := &types.EpochData{ - Authorities: auths, + data := &types.EpochDataRaw{ + Authorities: genesisCfg.GenesisAuthorities, Randomness: [types.RandomnessLength]byte{99, 88, 77}, } - err = epochState.SetEpochData(7, data) + err = epochState.SetEpochDataRaw(7, data) require.NoError(t, err) cfgData := &types.ConfigData{ diff --git a/lib/babe/epoch_test.go b/lib/babe/epoch_test.go index d8d9f20d2c..2aae08d6f7 100644 --- a/lib/babe/epoch_test.go +++ b/lib/babe/epoch_test.go @@ -73,9 +73,9 @@ func TestBabeService_checkAndSetFirstSlot(t *testing.T) { func TestBabeService_getEpochDataAndStartSlot(t *testing.T) { kp := keyring.Alice().(*sr25519.Keypair) authority := types.NewAuthority(kp.Public(), uint64(1)) - testEpochData := &types.EpochData{ + testEpochData := &types.EpochDataRaw{ Randomness: [32]byte{1}, - Authorities: []types.Authority{*authority}, + Authorities: []types.AuthorityRaw{*authority.ToRaw()}, } testConfigData := &types.ConfigData{ @@ -88,9 +88,11 @@ func TestBabeService_getEpochDataAndStartSlot(t *testing.T) { C2: 2, } - testEpochDataEpoch0 := &types.EpochData{ - Randomness: [32]byte{9}, - Authorities: []types.Authority{*authority}, + testEpochDataEpoch0 := &types.EpochDataRaw{ + Randomness: [32]byte{9}, + Authorities: []types.AuthorityRaw{ + *authority.ToRaw(), + }, } threshold0, err := CalculateThreshold(testConfigData.C1, testConfigData.C2, 1) @@ -111,7 +113,7 @@ func TestBabeService_getEpochDataAndStartSlot(t *testing.T) { service: func(ctrl *gomock.Controller) *Service { mockEpochState := NewMockEpochState(ctrl) - mockEpochState.EXPECT().GetLatestEpochData().Return(testEpochDataEpoch0, nil) + mockEpochState.EXPECT().GetLatestEpochDataRaw().Return(testEpochDataEpoch0, nil) mockEpochState.EXPECT().GetLatestConfigData().Return(testConfigData, nil) return &Service{ @@ -134,7 +136,7 @@ func TestBabeService_getEpochDataAndStartSlot(t *testing.T) { service: func(ctrl *gomock.Controller) *Service { mockEpochState := NewMockEpochState(ctrl) - mockEpochState.EXPECT().GetEpochData(uint64(1), nil).Return(testEpochData, nil) + mockEpochState.EXPECT().GetEpochDataRaw(uint64(1), nil).Return(testEpochData, nil) mockEpochState.EXPECT().GetConfigData(uint64(1), nil).Return(testConfigData, nil) return &Service{ @@ -157,7 +159,7 @@ func TestBabeService_getEpochDataAndStartSlot(t *testing.T) { service: func(ctrl *gomock.Controller) *Service { mockEpochState := NewMockEpochState(ctrl) - mockEpochState.EXPECT().GetEpochData(uint64(1), nil).Return(testEpochData, nil) + mockEpochState.EXPECT().GetEpochDataRaw(uint64(1), nil).Return(testEpochData, nil) mockEpochState.EXPECT().GetConfigData(uint64(1), nil).Return(testLatestConfigData, nil) return &Service{ diff --git a/lib/babe/mock_state_test.go b/lib/babe/mock_state_test.go index c7f2984d64..cc609ec52d 100644 --- a/lib/babe/mock_state_test.go +++ b/lib/babe/mock_state_test.go @@ -473,19 +473,19 @@ func (mr *MockEpochStateMockRecorder) GetCurrentEpoch() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentEpoch", reflect.TypeOf((*MockEpochState)(nil).GetCurrentEpoch)) } -// GetEpochData mocks base method. -func (m *MockEpochState) GetEpochData(arg0 uint64, arg1 *types.Header) (*types.EpochData, error) { +// GetEpochDataRaw mocks base method. +func (m *MockEpochState) GetEpochDataRaw(arg0 uint64, arg1 *types.Header) (*types.EpochDataRaw, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetEpochData", arg0, arg1) - ret0, _ := ret[0].(*types.EpochData) + ret := m.ctrl.Call(m, "GetEpochDataRaw", arg0, arg1) + ret0, _ := ret[0].(*types.EpochDataRaw) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetEpochData indicates an expected call of GetEpochData. -func (mr *MockEpochStateMockRecorder) GetEpochData(arg0, arg1 any) *gomock.Call { +// GetEpochDataRaw indicates an expected call of GetEpochDataRaw. +func (mr *MockEpochStateMockRecorder) GetEpochDataRaw(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) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpochDataRaw", reflect.TypeOf((*MockEpochState)(nil).GetEpochDataRaw), arg0, arg1) } // GetEpochForBlock mocks base method. @@ -533,19 +533,19 @@ func (mr *MockEpochStateMockRecorder) GetLatestConfigData() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestConfigData", reflect.TypeOf((*MockEpochState)(nil).GetLatestConfigData)) } -// GetLatestEpochData mocks base method. -func (m *MockEpochState) GetLatestEpochData() (*types.EpochData, error) { +// GetLatestEpochDataRaw mocks base method. +func (m *MockEpochState) GetLatestEpochDataRaw() (*types.EpochDataRaw, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLatestEpochData") - ret0, _ := ret[0].(*types.EpochData) + ret := m.ctrl.Call(m, "GetLatestEpochDataRaw") + ret0, _ := ret[0].(*types.EpochDataRaw) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetLatestEpochData indicates an expected call of GetLatestEpochData. -func (mr *MockEpochStateMockRecorder) GetLatestEpochData() *gomock.Call { +// GetLatestEpochDataRaw indicates an expected call of GetLatestEpochDataRaw. +func (mr *MockEpochStateMockRecorder) GetLatestEpochDataRaw() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestEpochData", reflect.TypeOf((*MockEpochState)(nil).GetLatestEpochData)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestEpochDataRaw", reflect.TypeOf((*MockEpochState)(nil).GetLatestEpochDataRaw)) } // GetSlotDuration mocks base method. @@ -592,20 +592,6 @@ func (mr *MockEpochStateMockRecorder) SetCurrentEpoch(arg0 any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentEpoch", reflect.TypeOf((*MockEpochState)(nil).SetCurrentEpoch), arg0) } -// SetEpochData mocks base method. -func (m *MockEpochState) SetEpochData(arg0 uint64, arg1 *types.EpochData) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetEpochData", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// SetEpochData indicates an expected call of SetEpochData. -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) -} - // SetFirstSlot mocks base method. func (m *MockEpochState) SetFirstSlot(arg0 uint64) error { m.ctrl.T.Helper() diff --git a/lib/babe/state.go b/lib/babe/state.go index 7652d0f2bc..47de36a930 100644 --- a/lib/babe/state.go +++ b/lib/babe/state.go @@ -61,16 +61,15 @@ type EpochState interface { GetSlotDuration() (time.Duration, error) SetCurrentEpoch(epoch uint64) error GetCurrentEpoch() (uint64, error) - SetEpochData(epoch uint64, info *types.EpochData) error - GetEpochData(epoch uint64, header *types.Header) (*types.EpochData, error) + GetEpochDataRaw(epoch uint64, header *types.Header) (*types.EpochDataRaw, error) GetConfigData(epoch uint64, header *types.Header) (*types.ConfigData, error) GetLatestConfigData() (*types.ConfigData, error) GetStartSlotForEpoch(epoch uint64) (uint64, error) GetEpochForBlock(header *types.Header) (uint64, error) SetFirstSlot(slot uint64) error - GetLatestEpochData() (*types.EpochData, error) + GetLatestEpochDataRaw() (*types.EpochDataRaw, error) SkipVerify(*types.Header) (bool, error) } diff --git a/lib/babe/types.go b/lib/babe/types.go index accea21c49..02457ea083 100644 --- a/lib/babe/types.go +++ b/lib/babe/types.go @@ -58,7 +58,7 @@ func (d Authorities) String() string { type epochData struct { randomness Randomness authorityIndex uint32 - authorities []types.Authority + authorities []types.AuthorityRaw threshold *scale.Uint128 allowedSlots types.AllowedSlots } diff --git a/lib/babe/verify.go b/lib/babe/verify.go index c66022e4ca..8f4841eb04 100644 --- a/lib/babe/verify.go +++ b/lib/babe/verify.go @@ -20,7 +20,7 @@ var errEmptyKeyOwnershipProof = errors.New("key ownership proof is nil") // verifierInfo contains the information needed to verify blocks // it remains the same for an epoch type verifierInfo struct { - authorities []types.Authority + authorities []types.AuthorityRaw randomness Randomness threshold *scale.Uint128 secondarySlots bool @@ -195,7 +195,7 @@ func (v *VerificationManager) VerifyBlock(header *types.Header) error { } func (v *VerificationManager) getVerifierInfo(epoch uint64, header *types.Header) (*verifierInfo, error) { - epochData, err := v.epochState.GetEpochData(epoch, header) + epochData, err := v.epochState.GetEpochDataRaw(epoch, header) if err != nil { return nil, fmt.Errorf("failed to get epoch data for epoch %d: %w", epoch, err) } @@ -223,7 +223,7 @@ type verifier struct { blockState BlockState slotState SlotState epoch uint64 - authorities []types.Authority + authorities []types.AuthorityRaw randomness Randomness threshold *scale.Uint128 secondarySlots bool @@ -294,7 +294,11 @@ func (b *verifier) verifyAuthorshipRight(header *types.Header) error { authIdx = d.AuthorityIndex } - authorPub := b.authorities[authIdx].Key + authority := new(types.Authority) + err = authority.FromRawSr25519(&b.authorities[authIdx]) + if err != nil { + return fmt.Errorf("from raw sr25519: %w", err) + } // remove seal before verifying signature h := types.NewDigest() @@ -331,7 +335,7 @@ func (b *verifier) verifyAuthorshipRight(header *types.Header) error { return err } - ok, err = authorPub.Verify(hash[:], seal.Data) + ok, err = authority.Key.Verify(hash[:], seal.Data) if err != nil { return err } @@ -396,7 +400,7 @@ func (b *verifier) verifyBlockEquivocation(header *types.Header) (bool, error) { } slotNow := getCurrentSlot(b.slotDuration) - signer := types.AuthorityID(b.authorities[authorityIndex].ToRaw().Key) + signer := b.authorities[authorityIndex].Key equivocationProof, err := b.slotState.CheckEquivocation(slotNow, slotNumber, header, signer) if err != nil { @@ -449,9 +453,8 @@ func (b *verifier) verifyPreRuntimeDigest(digest *types.PreRuntimeDigest) (scale ok = false break } - pub := b.authorities[d.AuthorityIndex].Key - - pk, err := sr25519.NewPublicKey(pub.Encode()) + authority := b.authorities[d.AuthorityIndex] + pk, err := sr25519.NewPublicKey(authority.Key[:]) if err != nil { return nil, err } @@ -487,9 +490,8 @@ func (b *verifier) verifyPreRuntimeDigest(digest *types.PreRuntimeDigest) (scale func (b *verifier) verifyPrimarySlotWinner(authorityIndex uint32, slot uint64, vrfOutput [sr25519.VRFOutputLength]byte, vrfProof [sr25519.VRFProofLength]byte) (bool, error) { - pub := b.authorities[authorityIndex].Key - - pk, err := sr25519.NewPublicKey(pub.Encode()) + authority := b.authorities[authorityIndex] + pk, err := sr25519.NewPublicKey(authority.Key[:]) if err != nil { return false, err } @@ -511,10 +513,10 @@ func (b *verifier) verifyPrimarySlotWinner(authorityIndex uint32, // validate VRF proof logger.Tracef("verifyPrimarySlotWinner authority index %d, "+ - "public key %s, randomness 0x%x, slot %d, epoch %d, "+ + "public key 0x%x, randomness 0x%x, slot %d, epoch %d, "+ "output 0x%x and proof 0x%x", authorityIndex, - pub.Hex(), b.randomness, slot, b.epoch, + authority.Key[:], b.randomness, slot, b.epoch, vrfOutput, vrfProof[:]) t := makeTranscript(b.randomness, slot, b.epoch) diff --git a/lib/babe/verify_integration_test.go b/lib/babe/verify_integration_test.go index 5f6e76a5e6..480731817d 100644 --- a/lib/babe/verify_integration_test.go +++ b/lib/babe/verify_integration_test.go @@ -236,9 +236,9 @@ func TestVerificationManager_VerifyBlock_FutureEpoch(t *testing.T) { require.NoError(t, err) const futureEpoch = uint64(2) - err = babeService.epochState.SetEpochData(futureEpoch, &types.EpochData{ - Authorities: []types.Authority{{ - Key: keyring.Alice().(*sr25519.Keypair).Public(), + err = babeService.epochState.(*state.EpochState).SetEpochDataRaw(futureEpoch, &types.EpochDataRaw{ + Authorities: []types.AuthorityRaw{{ + Key: [32]byte(keyring.Alice().(*sr25519.Keypair).Public().Encode()), }}, }) require.NoError(t, err) @@ -286,9 +286,9 @@ func TestVerificationManager_VerifyBlock_MultipleEpochs(t *testing.T) { require.NoError(t, err) const futureEpoch = uint64(2) - err = babeService.epochState.SetEpochData(futureEpoch, &types.EpochData{ - Authorities: []types.Authority{{ - Key: keyring.Alice().(*sr25519.Keypair).Public(), + err = babeService.epochState.(*state.EpochState).SetEpochDataRaw(futureEpoch, &types.EpochDataRaw{ + Authorities: []types.AuthorityRaw{{ + Key: [32]byte(keyring.Alice().(*sr25519.Keypair).Public().Encode()), }}, }) require.NoError(t, err) @@ -664,13 +664,8 @@ func TestVerifyForkBlocksWithRespectiveEpochData(t *testing.T) { require.NoError(t, err) require.Equal(t, len(authorities[3:]), len(verifierInfo.authorities)) - rawAuthorities := make([]types.AuthorityRaw, len(verifierInfo.authorities)) + require.ElementsMatch(t, authorities[3:], verifierInfo.authorities) - for i, auth := range verifierInfo.authorities { - rawAuthorities[i] = *auth.ToRaw() - } - - require.ElementsMatch(t, authorities[3:], rawAuthorities) require.True(t, verifierInfo.secondarySlots) require.Equal(t, expectedThreshold, verifierInfo.threshold) } @@ -686,14 +681,9 @@ func TestVerifyForkBlocksWithRespectiveEpochData(t *testing.T) { require.NoError(t, err) require.Equal(t, len(authorities[6:]), len(verifierInfo.authorities)) - rawAuthorities := make([]types.AuthorityRaw, len(verifierInfo.authorities)) - - for i, auth := range verifierInfo.authorities { - rawAuthorities[i] = *auth.ToRaw() - } - // should keep the original authorities - require.ElementsMatch(t, authorities[6:], rawAuthorities) + require.ElementsMatch(t, authorities[6:], verifierInfo.authorities) + require.True(t, verifierInfo.secondarySlots) require.Equal(t, expectedThreshold, verifierInfo.threshold) } @@ -719,14 +709,9 @@ func TestVerifyForkBlocksWithRespectiveEpochData(t *testing.T) { require.NoError(t, err) require.Equal(t, len(authorities[6:]), len(verifierInfo.authorities)) - rawAuthorities := make([]types.AuthorityRaw, len(verifierInfo.authorities)) - - for i, auth := range verifierInfo.authorities { - rawAuthorities[i] = *auth.ToRaw() - } - // should keep the original authorities - require.ElementsMatch(t, authorities[6:], rawAuthorities) + require.ElementsMatch(t, authorities[6:], verifierInfo.authorities) + require.True(t, verifierInfo.secondarySlots) require.Equal(t, expectedThreshold, verifierInfo.threshold) } diff --git a/lib/babe/verify_test.go b/lib/babe/verify_test.go index e91f54ea08..a70879fe3d 100644 --- a/lib/babe/verify_test.go +++ b/lib/babe/verify_test.go @@ -75,7 +75,7 @@ func newTestVerifier(kp *sr25519.Keypair, blockState BlockState, slotState SlotS threshold *scale.Uint128, secSlots bool) *verifier { authority := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*authority, *authority}, + authorities: []types.AuthorityRaw{*authority.ToRaw(), *authority.ToRaw()}, randomness: Randomness{}, threshold: threshold, secondarySlots: secSlots, @@ -221,12 +221,12 @@ func Test_verifier_verifyPrimarySlotWinner(t *testing.T) { auth := types.NewAuthority(kp.Public(), uint64(1)) vi := &verifierInfo{ - authorities: []types.Authority{*auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw()}, threshold: &scale.Uint128{}, } vi1 := &verifierInfo{ - authorities: []types.Authority{*auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw()}, threshold: scale.MaxUint128, } @@ -315,7 +315,7 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { auth := types.NewAuthority(kp.Public(), uint64(1)) vi := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: scale.MaxUint128, } @@ -328,7 +328,7 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { // Above threshold case vi1 := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: &scale.Uint128{}, } @@ -352,12 +352,12 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { authVRFSec := types.NewAuthority(kp.Public(), uint64(1)) viVRFSec := &verifierInfo{ - authorities: []types.Authority{*authVRFSec, *authVRFSec}, + authorities: []types.AuthorityRaw{*authVRFSec.ToRaw(), *authVRFSec.ToRaw()}, threshold: scale.MaxUint128, } viVRFSec2 := &verifierInfo{ - authorities: []types.Authority{*authVRFSec, *authVRFSec}, + authorities: []types.AuthorityRaw{*authVRFSec.ToRaw(), *authVRFSec.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, } @@ -369,12 +369,12 @@ func Test_verifier_verifyPreRuntimeDigest(t *testing.T) { authSec := types.NewAuthority(kp.Public(), uint64(1)) viSec := &verifierInfo{ - authorities: []types.Authority{*authSec, *authSec}, + authorities: []types.AuthorityRaw{*authSec.ToRaw(), *authSec.ToRaw()}, threshold: scale.MaxUint128, } viSec2 := &verifierInfo{ - authorities: []types.Authority{*authSec, *authSec}, + authorities: []types.AuthorityRaw{*authSec.ToRaw(), *authSec.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, } @@ -730,7 +730,7 @@ func Test_verifyBlockEquivocation(t *testing.T) { wantErr: types.ErrNoFirstPreDigest, buildVerifier: func(t *testing.T) *verifier { return &verifier{ - authorities: []types.Authority{}, + authorities: []types.AuthorityRaw{}, } }, }, @@ -740,7 +740,7 @@ func Test_verifyBlockEquivocation(t *testing.T) { wantErr: ErrAuthIndexOutOfBound, buildVerifier: func(t *testing.T) *verifier { return &verifier{ - authorities: []types.Authority{}, + authorities: []types.AuthorityRaw{}, } }, }, @@ -763,9 +763,9 @@ func Test_verifyBlockEquivocation(t *testing.T) { Return(nil, slotStateMockErr) return &verifier{ - authorities: []types.Authority{ + authorities: []types.AuthorityRaw{ { - Key: kp.Public(), + Key: [32]byte(kp.Public().Encode()), Weight: 1, }, }, @@ -792,9 +792,9 @@ func Test_verifyBlockEquivocation(t *testing.T) { Return(nil, nil) return &verifier{ - authorities: []types.Authority{ + authorities: []types.AuthorityRaw{ { - Key: kp.Public(), + Key: [32]byte(kp.Public().Encode()), Weight: 1, }, }, @@ -848,9 +848,9 @@ func Test_verifyBlockEquivocation(t *testing.T) { mockBlockState.EXPECT().GetRuntime(defaultHeader.Hash()).Return(mockRuntimeInstance, nil) return &verifier{ - authorities: []types.Authority{ + authorities: []types.AuthorityRaw{ { - Key: kp.Public(), + Key: [32]byte(kp.Public().Encode()), Weight: 1, }, }, @@ -893,9 +893,9 @@ func Test_verifyBlockEquivocation(t *testing.T) { mockBlockState.EXPECT().GetRuntime(defaultHeader.Hash()).Return(nil, getRuntimeErr) return &verifier{ - authorities: []types.Authority{ + authorities: []types.AuthorityRaw{ { - Key: kp.Public(), + Key: [32]byte(kp.Public().Encode()), Weight: 1, }, }, @@ -933,7 +933,7 @@ func Test_verifier_submitAndReportEquivocation(t *testing.T) { auth := types.NewAuthority(keyPair.Public(), uint64(1)) vi := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: scale.MaxUint128, } @@ -976,7 +976,7 @@ func Test_verifier_submitAndReportEquivocation(t *testing.T) { secondHeader := newTestHeader(t, *preRuntimeDigest2) - offenderPublicKey := verifier.authorities[authorityIndex].ToRaw().Key + offenderPublicKey := verifier.authorities[authorityIndex].Key keyOwnershipProof := testKeyOwnershipProof mockRuntime := mocks.NewMockInstance(ctrl) @@ -1071,7 +1071,7 @@ func Test_verifier_verifyAuthorshipRightEquivocatory(t *testing.T) { mockBlockState.EXPECT().GetRuntime(header.Hash()).Return(mockRuntime, nil) auth := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: scale.MaxUint128, } @@ -1132,7 +1132,7 @@ func Test_verifier_verifyAuthorshipRightEquivocatory(t *testing.T) { mockBlockState.EXPECT().GetRuntime(header.Hash()).Return(mockRuntime, nil) auth := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, randomness: Randomness{}, @@ -1203,7 +1203,7 @@ func Test_verifier_verifyAuthorshipRightEquivocatory(t *testing.T) { auth := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*auth, *auth}, + authorities: []types.AuthorityRaw{*auth.ToRaw(), *auth.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, randomness: Randomness{}, @@ -1236,19 +1236,19 @@ func TestVerificationManager_getVerifierInfo(t *testing.T) { testHeader := types.NewEmptyHeader() - mockEpochStateGetErr.EXPECT().GetEpochData(uint64(0), testHeader).Return(nil, state.ErrEpochNotInMemory) + mockEpochStateGetErr.EXPECT().GetEpochDataRaw(uint64(0), testHeader).Return(nil, state.ErrEpochNotInMemory) - mockEpochStateHasErr.EXPECT().GetEpochData(uint64(0), testHeader).Return(&types.EpochData{}, nil) + mockEpochStateHasErr.EXPECT().GetEpochDataRaw(uint64(0), testHeader).Return(&types.EpochDataRaw{}, nil) mockEpochStateHasErr.EXPECT().GetConfigData(uint64(0), testHeader).Return(&types.ConfigData{}, state.ErrConfigNotFound) - mockEpochStateThresholdErr.EXPECT().GetEpochData(uint64(0), testHeader).Return(&types.EpochData{}, nil) + mockEpochStateThresholdErr.EXPECT().GetEpochDataRaw(uint64(0), testHeader).Return(&types.EpochDataRaw{}, nil) mockEpochStateThresholdErr.EXPECT().GetConfigData(uint64(0), testHeader). Return(&types.ConfigData{ C1: 3, C2: 1, }, nil) - mockEpochStateOk.EXPECT().GetEpochData(uint64(0), testHeader).Return(&types.EpochData{}, nil) + mockEpochStateOk.EXPECT().GetEpochDataRaw(uint64(0), testHeader).Return(&types.EpochDataRaw{}, nil) mockEpochStateOk.EXPECT().GetConfigData(uint64(0), testHeader). Return(&types.ConfigData{ C1: 1, @@ -1345,16 +1345,16 @@ func TestVerificationManager_VerifyBlock(t *testing.T) { mockEpochStateSkipVerifyErr.EXPECT().GetEpochForBlock(testBlockHeaderEmpty).Return(uint64(1), nil) errTestGetEpochData := errors.New("test get epoch data error") - mockEpochStateSkipVerifyErr.EXPECT().GetEpochData(uint64(1), testBlockHeaderEmpty).Return(nil, errTestGetEpochData) + mockEpochStateSkipVerifyErr.EXPECT().GetEpochDataRaw(uint64(1), testBlockHeaderEmpty).Return(nil, errTestGetEpochData) errTestSkipVerify := errors.New("test skip verify error") mockEpochStateSkipVerifyErr.EXPECT().SkipVerify(testBlockHeaderEmpty).Return(false, errTestSkipVerify) mockEpochStateSkipVerifyTrue.EXPECT().GetEpochForBlock(testBlockHeaderEmpty).Return(uint64(1), nil) - mockEpochStateSkipVerifyTrue.EXPECT().GetEpochData(uint64(1), testBlockHeaderEmpty).Return(nil, errTestGetEpochData) + mockEpochStateSkipVerifyTrue.EXPECT().GetEpochDataRaw(uint64(1), testBlockHeaderEmpty).Return(nil, errTestGetEpochData) mockEpochStateSkipVerifyTrue.EXPECT().SkipVerify(testBlockHeaderEmpty).Return(true, nil) mockEpochStateGetVerifierInfoErr.EXPECT().GetEpochForBlock(testBlockHeaderEmpty).Return(uint64(1), nil) - mockEpochStateGetVerifierInfoErr.EXPECT().GetEpochData(uint64(1), testBlockHeaderEmpty). + mockEpochStateGetVerifierInfoErr.EXPECT().GetEpochDataRaw(uint64(1), testBlockHeaderEmpty). Return(nil, errTestGetEpochData) mockEpochStateGetVerifierInfoErr.EXPECT().SkipVerify(testBlockHeaderEmpty).Return(false, nil) @@ -1376,7 +1376,7 @@ func TestVerificationManager_VerifyBlock(t *testing.T) { authority := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*authority, *authority}, + authorities: []types.AuthorityRaw{*authority.ToRaw(), *authority.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, } @@ -1488,7 +1488,9 @@ func TestVerificationManager_SetOnDisabled(t *testing.T) { mockEpochStateGetEpochDataErr.EXPECT().GetEpochForBlock(types.NewEmptyHeader()).Return(uint64(0), nil) errTestGetEpochData := errors.New("test get epoch data error") - mockEpochStateGetEpochDataErr.EXPECT().GetEpochData(uint64(0), types.NewEmptyHeader()).Return(nil, errTestGetEpochData) + mockEpochStateGetEpochDataErr.EXPECT(). + GetEpochDataRaw(uint64(0), types.NewEmptyHeader()). + Return(nil, errTestGetEpochData) mockEpochStateIndexLenErr.EXPECT().GetEpochForBlock(types.NewEmptyHeader()).Return(uint64(2), nil) @@ -1508,7 +1510,7 @@ func TestVerificationManager_SetOnDisabled(t *testing.T) { authority := types.NewAuthority(kp.Public(), uint64(1)) info := &verifierInfo{ - authorities: []types.Authority{*authority, *authority}, + authorities: []types.AuthorityRaw{*authority.ToRaw(), *authority.ToRaw()}, threshold: scale.MaxUint128, secondarySlots: true, } From 31b748b977c8c18331ad71335c5c93b634aac64d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 06:28:22 -0700 Subject: [PATCH 15/19] chore(deps): bump github.com/spf13/viper from 1.17.0 to 1.18.1 (#3635) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +-- go.sum | 322 +++------------------------------------------------------ 2 files changed, 23 insertions(+), 313 deletions(-) diff --git a/go.mod b/go.mod index d90dd52ff9..8503708b3d 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/client_model v0.5.0 github.com/qdm12/gotree v0.2.0 github.com/spf13/cobra v1.8.0 - github.com/spf13/viper v1.17.0 + github.com/spf13/viper v1.18.1 github.com/stretchr/testify v1.8.4 github.com/tetratelabs/wazero v1.1.0 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 @@ -71,7 +71,7 @@ require ( github.com/elastic/gosigar v0.14.2 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-logr/logr v1.2.4 // indirect @@ -164,14 +164,14 @@ require ( github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.8.2 // indirect - github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/smartystreets/assertions v1.13.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/afero v1.10.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -189,8 +189,8 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.25.0 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sync v0.3.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.13.0 // indirect diff --git a/go.sum b/go.sum index 2d48ba19ee..d1d9dd77d1 100644 --- a/go.sum +++ b/go.sum @@ -2,50 +2,13 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.1.0 h1:rZ6EU+CZFCjB4sHUE1jIu8VDoB/wRKZxoe1tkcO71Wk= github.com/ChainSafe/go-schnorrkel v1.1.0/go.mod h1:ABkENxiP+cvjFiByMIZ9LYbRoNNLeBLiakC1XeTFxfE= github.com/ChainSafe/wazero v0.0.0-20231114190045-1d874d099362 h1:hbvvSSB436JJalwq/2fRZwJpptvq9HMOLYVZX9oVHKM= @@ -114,13 +77,9 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chyeh/pubip v0.0.0-20170203095919-b7e679cf541c h1:++BhWlmSX+n8m3O4gPfy3S4PTZ0TMzH6nelerBLPUng= github.com/chyeh/pubip v0.0.0-20170203095919-b7e679cf541c/go.mod h1:C7ma6h458jTWT65mXC58L1Q6hnEtr0unur8cMc0UEXM= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= @@ -199,8 +158,6 @@ github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= @@ -215,12 +172,12 @@ github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= @@ -235,9 +192,6 @@ github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclK github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -278,27 +232,17 @@ github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzq github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 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/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -318,17 +262,13 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXi github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -340,18 +280,7 @@ github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6 github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f h1:pDhu5sgp8yJlEF/g6osliIIpF9K4F5jvkULXa4daRDQ= github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -361,9 +290,6 @@ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -386,8 +312,6 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -398,8 +322,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -451,7 +373,6 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= @@ -474,7 +395,6 @@ github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/q github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -642,7 +562,6 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -685,8 +604,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= -github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= @@ -732,11 +651,11 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= @@ -745,8 +664,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= -github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/spf13/viper v1.18.1 h1:rmuU42rScKWlhhJDyXZRKJQHXFX02chSVW1IvkPGiVM= +github.com/spf13/viper v1.18.1/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -805,18 +724,10 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmv github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= @@ -855,7 +766,6 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -865,48 +775,23 @@ golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -923,52 +808,25 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -976,13 +834,10 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -990,54 +845,28 @@ golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1046,7 +875,6 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1057,12 +885,10 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -1070,8 +896,6 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1081,55 +905,16 @@ golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1144,96 +929,28 @@ gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1243,7 +960,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -1282,15 +998,9 @@ grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJd honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= From 8dc1ccec49742f05d832ffd9a399b1eb44423efb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:20:02 +0000 Subject: [PATCH 16/19] chore(deps): bump actions/setup-go from 4 to 5 (#3636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eclésio Junior --- .github/workflows/build.yml | 4 ++-- .github/workflows/checks.yml | 2 +- .github/workflows/copyright.yml | 2 +- .github/workflows/devnet.yml | 2 +- .github/workflows/fuzz.yml | 2 +- .github/workflows/integration-tests.yml | 2 +- .github/workflows/mocks.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- .github/workflows/zombienet.yml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37cdddfc37..2bdb5efdd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: platform: [macos-latest, buildjet-4vcpu-ubuntu-2204] runs-on: ${{ matrix.platform }} steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true @@ -65,7 +65,7 @@ jobs: timeout-minutes: 60 runs-on: buildjet-4vcpu-ubuntu-2204 steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0629c341ba..0dbb6a9c28 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index 9d7f7c9894..d2d9d67cfd 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/devnet.yml b/.github/workflows/devnet.yml index 3a13105ca9..5f4ff7adce 100644 --- a/.github/workflows/devnet.yml +++ b/.github/workflows/devnet.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index ef6f00b5a2..3010ce19e0 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -12,7 +12,7 @@ jobs: with: all_but_latest: true - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index adca01e045..3e5acfbcd3 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -42,7 +42,7 @@ jobs: with: all_but_latest: true - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/mocks.yml b/.github/workflows/mocks.yml index 1442bb907a..774957ef43 100644 --- a/.github/workflows/mocks.yml +++ b/.github/workflows/mocks.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fe779a042e..c9aa8bc1ea 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,7 +27,7 @@ jobs: with: all_but_latest: true - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true diff --git a/.github/workflows/zombienet.yml b/.github/workflows/zombienet.yml index 09a342bada..5561a1fd5d 100644 --- a/.github/workflows/zombienet.yml +++ b/.github/workflows/zombienet.yml @@ -7,7 +7,7 @@ jobs: zombienet-tests: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" stable: true From 619be1b71b3fae344e8f1ae141ca875ce0ae25fc Mon Sep 17 00:00:00 2001 From: Timothy Wu Date: Mon, 11 Dec 2023 16:44:48 -0500 Subject: [PATCH 17/19] fix(.github/workflows): update node.js version (#3637) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 415d628470..4421ee707d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 16 + node-version: latest - name: Install dependencies run: npm install @semantic-release/changelog @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec @semantic-release/git semantic-release/release-notes-generator - name: Release From 989b6bf1e2ee200439b777842d54d31e7d33d827 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 11 Dec 2023 21:46:43 +0000 Subject: [PATCH 18/19] chore(release): 0.8.0 [skip ci] # [0.8.0](https://github.com/ChainSafe/gossamer/compare/v0.7.0...v0.8.0) (2023-12-11) ### Bug Fixes * **.github/workflows:** update node.js version ([#3637](https://github.com/ChainSafe/gossamer/issues/3637)) ([619be1b](https://github.com/ChainSafe/gossamer/commit/619be1b71b3fae344e8f1ae141ca875ce0ae25fc)) * **babe:** Add support for versioned NextConfigData decoding ([#3239](https://github.com/ChainSafe/gossamer/issues/3239)) ([5ee3a64](https://github.com/ChainSafe/gossamer/commit/5ee3a641ff02153b7d1e9611f4fc8c90d7c66fad)) * **blockstate:** if blocktree fails to search a hash in memory, load it from disk ([#3059](https://github.com/ChainSafe/gossamer/issues/3059)) ([6442544](https://github.com/ChainSafe/gossamer/commit/64425445e6be472ae1e2dffba85f8ce4221d2eb8)) * cache slot to header data while checking BABE equivocation ([#3364](https://github.com/ChainSafe/gossamer/issues/3364)) ([dcfa4a4](https://github.com/ChainSafe/gossamer/commit/dcfa4a44acbfea9dc062fcf8eccb15dc61480ea2)) * **chain:** Fix `chain=westend` option ([#3123](https://github.com/ChainSafe/gossamer/issues/3123)) ([64dbba6](https://github.com/ChainSafe/gossamer/commit/64dbba63b663cb9eb662a0dee24d0406f2d22baf)) * **ci:** cancel previous workflow runs ([#3140](https://github.com/ChainSafe/gossamer/issues/3140)) ([a322a19](https://github.com/ChainSafe/gossamer/commit/a322a1934c1ca1b3db8d91823028e08fb10b841b)) * **ci:** fix all Deepsource issues ([#3046](https://github.com/ChainSafe/gossamer/issues/3046)) ([4ea0a70](https://github.com/ChainSafe/gossamer/commit/4ea0a703339ca06e617b06eeb7d56308e7b48093)) * **ci:** fix broken docker build ([#3231](https://github.com/ChainSafe/gossamer/issues/3231)) ([f796430](https://github.com/ChainSafe/gossamer/commit/f7964304beecd5631466b74f0de638848e97971c)) * **ci:** Fix staging metrics collection ([#3138](https://github.com/ChainSafe/gossamer/issues/3138)) ([05a5c4c](https://github.com/ChainSafe/gossamer/commit/05a5c4c6264b32bb0f765377572d08252dfa0f98)) * **cli:** parse module log-levels ([#3285](https://github.com/ChainSafe/gossamer/issues/3285)) ([86c7577](https://github.com/ChainSafe/gossamer/commit/86c7577dbf5d603422ee1cc237014c74235c374f)) * **cmd/gossamer:** embed default toml config files ([#3091](https://github.com/ChainSafe/gossamer/issues/3091)) ([af38364](https://github.com/ChainSafe/gossamer/commit/af38364f5ec209f56b6ae69072b60e22f2d6c093)) * **cmd/gossamer:** update error message ([#3301](https://github.com/ChainSafe/gossamer/issues/3301)) ([960a9d4](https://github.com/ChainSafe/gossamer/commit/960a9d48e52dde4785cfa3c9c05c6493d5dbb452)) * **dot/babe:** use `bs.latestFinalised` instead of using `round/set id` ([#3167](https://github.com/ChainSafe/gossamer/issues/3167)) ([46c0ef7](https://github.com/ChainSafe/gossamer/commit/46c0ef7d4013a2bba225c8e502978894c4eb571a)) * **dot/digest:** create `BlockImportHandler` and remove channel ([#3312](https://github.com/ChainSafe/gossamer/issues/3312)) ([a179855](https://github.com/ChainSafe/gossamer/commit/a179855cd2ed7614e94c090e80111d2bc3ea365c)) * **dot/network:** `findPeers` returns on timeout if a peer is found ([#3001](https://github.com/ChainSafe/gossamer/issues/3001)) ([2a05ce7](https://github.com/ChainSafe/gossamer/commit/2a05ce76a84765da17147598c99a66e06486b754)) * **dot/network:** remove `maxReads` limitation to read stream ([#3287](https://github.com/ChainSafe/gossamer/issues/3287)) ([483b23f](https://github.com/ChainSafe/gossamer/commit/483b23f19467eaa22ece4fb26566dcf70f28e0c7)) * **dot/state:** clean up scheduled changes once a forced change is applied ([#3219](https://github.com/ChainSafe/gossamer/issues/3219)) ([5ebec46](https://github.com/ChainSafe/gossamer/commit/5ebec4651ff88514cdb2e8a536c680fc6475d267)) * **dot/state:** fix a bug in IsDescendantOf ([#3125](https://github.com/ChainSafe/gossamer/issues/3125)) ([4fd4a89](https://github.com/ChainSafe/gossamer/commit/4fd4a89610da35a5a1424121a808b93ac9983d42)) * **dot/state:** store raw authority keys and decode when verifying block signature ([#3627](https://github.com/ChainSafe/gossamer/issues/3627)) ([58f741d](https://github.com/ChainSafe/gossamer/commit/58f741d8d4d98ef7e8a66116f7ef77fe945b8fd5)) * **dot/sync:** fix `Timestamp slot must match 'CurrentSlot'` while using `westend` spec file ([#3040](https://github.com/ChainSafe/gossamer/issues/3040)) ([e6da01b](https://github.com/ChainSafe/gossamer/commit/e6da01b2f323d377dbcb2e053a4b2bc2daa34e3f)) * **dot/sync:** Revert verify justification before importing blocks ([#3615](https://github.com/ChainSafe/gossamer/issues/3615)) ([11b96dc](https://github.com/ChainSafe/gossamer/commit/11b96dcfa326a74911c76b120de7373c47de37a2)) * **dot/sync:** rework on bootstrap/tip sync ([#3227](https://github.com/ChainSafe/gossamer/issues/3227)) ([ab6650a](https://github.com/ChainSafe/gossamer/commit/ab6650a1ae722071f6415e2ce2649a8a13f99dc4)) * **dot/sync:** use `Range` instead of `SubChain` at `handleDescedingRequest` ([#3006](https://github.com/ChainSafe/gossamer/issues/3006)) ([a83c1a3](https://github.com/ChainSafe/gossamer/commit/a83c1a36521c1954953d524517ed774a93a21122)) * **dot/sync:** verify justification before importing blocks ([#3576](https://github.com/ChainSafe/gossamer/issues/3576)) ([2954fc0](https://github.com/ChainSafe/gossamer/commit/2954fc0b2c49eee6e93d5ac82ae5cae2c6bff440)) * **dot/sync:** wrong error message at `checkOrGetDescendantHash` ([#2971](https://github.com/ChainSafe/gossamer/issues/2971)) ([b1c6bf1](https://github.com/ChainSafe/gossamer/commit/b1c6bf1a6ca48622276f59457e5e32a50b3fa0da)) * **dot:** use tempDir in tests as base path to avoid creating `dot/~` ([#3363](https://github.com/ChainSafe/gossamer/issues/3363)) ([04514d5](https://github.com/ChainSafe/gossamer/commit/04514d53e5d81bae57ca81d0e69193ef52ab05c3)) * **go.mod:** Replace `centrifuge/go-substrate-rpc-client` dependency to `timwu20/go-substrate-rpc-client` temporarily to fix build ([#3572](https://github.com/ChainSafe/gossamer/issues/3572)) ([ea49251](https://github.com/ChainSafe/gossamer/commit/ea4925135525e77c00a2e9f959af39d944cf4628)) * **lib/babe:** Add context and additional assertion to TestBuildBlock_ok ([#3101](https://github.com/ChainSafe/gossamer/issues/3101)) ([a9a89ed](https://github.com/ChainSafe/gossamer/commit/a9a89ed8afa2a75b5a09fc7a1da2009025111680)) * **lib/babe:** rewrite TestBuildBlock_failing ([#3089](https://github.com/ChainSafe/gossamer/issues/3089)) ([28a3d0b](https://github.com/ChainSafe/gossamer/commit/28a3d0b4ffb379b04472d4823d82c3e56186d152)) * **lib/babe:** use current system time to yield a new slot ([#3133](https://github.com/ChainSafe/gossamer/issues/3133)) ([9cd6f25](https://github.com/ChainSafe/gossamer/commit/9cd6f25447d06092df199e06b770f65c12e7a0ec)) * **lib/grandpa:** on verifying block justification, compare given block hash with finalised hash ([#3081](https://github.com/ChainSafe/gossamer/issues/3081)) ([fc91843](https://github.com/ChainSafe/gossamer/commit/fc9184372a725b8f411e141be96fa3dcfadce92e)) * **lib/grandpa:** ensure `finalisationEngine` exits when stop channel is triggered ([#3141](https://github.com/ChainSafe/gossamer/issues/3141)) ([d7f7c06](https://github.com/ChainSafe/gossamer/commit/d7f7c068560f75597d6535dc3b95f905095af5a1)) * **lib/runtime:** `ext_default_child_storage_next_key_version_1` return `None` correctly ([#3473](https://github.com/ChainSafe/gossamer/issues/3473)) ([c7d574b](https://github.com/ChainSafe/gossamer/commit/c7d574bbd949f76537cc1cf8f87681d1250f20ec)) * **lib/runtime:** Fix `wasm error: out of bounds memory access` at `[#9412261](https://github.com/ChainSafe/gossamer/issues/9412261)` ([#3588](https://github.com/ChainSafe/gossamer/issues/3588)) ([ecb1ad9](https://github.com/ChainSafe/gossamer/commit/ecb1ad91b9119d2c6e8eec0894e769aa0cf5b586)) * **lib/runtime:** prevents polkadot zero-address bug using `sr25519_verify` version 1 ([#3494](https://github.com/ChainSafe/gossamer/issues/3494)) ([8b93d5e](https://github.com/ChainSafe/gossamer/commit/8b93d5e532d551d5284a14c202e85f4e850632f1)) * **lib/runtime:** return correct encoded value for `None` ([#3451](https://github.com/ChainSafe/gossamer/issues/3451)) ([3e11bc2](https://github.com/ChainSafe/gossamer/commit/3e11bc2647548ee593e4494fd4c0b119b0be0f2c)) * **lib/runtime:** update `MaxPossibleAllocation` to `2^25` ([#3393](https://github.com/ChainSafe/gossamer/issues/3393)) ([91eabdc](https://github.com/ChainSafe/gossamer/commit/91eabdcc0b4c52bda79caa1604ee558747fcf269)) * **lib/runtime:** use `westend-dev` spec file in `TestNodeRuntime_ValidateTransaction` ([#3047](https://github.com/ChainSafe/gossamer/issues/3047)) ([043f5eb](https://github.com/ChainSafe/gossamer/commit/043f5eb77f0468f61e5721b8833b032df9f84562)) * **lib/trie:** `ClearFromChild` should update parent trie ([#3482](https://github.com/ChainSafe/gossamer/issues/3482)) ([70e2d2b](https://github.com/ChainSafe/gossamer/commit/70e2d2beea3d14a41f0cdbd162fca94043c29e6b)) * **lib/trie:** create an empty child trie if not found ([#3459](https://github.com/ChainSafe/gossamer/issues/3459)) ([5d68447](https://github.com/ChainSafe/gossamer/commit/5d6844748bc26e3ca9be2e8a62cd0276abe578e4)) * **lib/trie:** record deleted Merkle values fixed ([#2873](https://github.com/ChainSafe/gossamer/issues/2873)) ([61f0216](https://github.com/ChainSafe/gossamer/commit/61f02161e0aadf988b1627857e6b90d2e1c138b2)) * **peerset:** check for incoming slot error ([#2952](https://github.com/ChainSafe/gossamer/issues/2952)) ([a1602bc](https://github.com/ChainSafe/gossamer/commit/a1602bc21084919c299bd11218560125404b870b)) * **rpc-tests:** Fix node port to execute tests on macOS ([#3223](https://github.com/ChainSafe/gossamer/issues/3223)) ([f758575](https://github.com/ChainSafe/gossamer/commit/f758575c4c5bb4312fef9bd40b330aa2c78e5a0c)) * **rpc/modules:** use `westend-local` in `TestAuthorModule_SubmitExtrinsic_invalid` test ([#3051](https://github.com/ChainSafe/gossamer/issues/3051)) ([b6429b7](https://github.com/ChainSafe/gossamer/commit/b6429b75001bd4582ed3848840f4ae46dc6a7caa)) * **runtime:** initialize TransactionState when creating runtime instance ([#3188](https://github.com/ChainSafe/gossamer/issues/3188)) ([29fe7a0](https://github.com/ChainSafe/gossamer/commit/29fe7a01db0a389f4d81c1740c190fd84f950b4b)) * **scale:** Use *int for scale index ([#3274](https://github.com/ChainSafe/gossamer/issues/3274)) ([9b04d30](https://github.com/ChainSafe/gossamer/commit/9b04d307e148a4659ac330e0e1edd42e57ceb527)) * **staging:** fixes the staging deployment issues caused by the new cli ([#3266](https://github.com/ChainSafe/gossamer/issues/3266)) ([1f4e786](https://github.com/ChainSafe/gossamer/commit/1f4e786883f6223c9db151a45c2bef04116fa251)) * **state:** clarify node hashes vs merkle values ([#2915](https://github.com/ChainSafe/gossamer/issues/2915)) ([e4033e8](https://github.com/ChainSafe/gossamer/commit/e4033e8cefbe7c5176e956cb14cb5259353207fc)) * **test/rpc:** use `westend-local` in `TestStateRPCAPI` ([#3049](https://github.com/ChainSafe/gossamer/issues/3049)) ([c57ade6](https://github.com/ChainSafe/gossamer/commit/c57ade66bd9ce3fded39e076ec1b7920068f1342)) * **tests/polkadot_js:** Use `westend-local` to run polkadot js test suite ([#3052](https://github.com/ChainSafe/gossamer/issues/3052)) ([2d5ead1](https://github.com/ChainSafe/gossamer/commit/2d5ead18ed3aa8fd1e412b26755a165de2248c02)) * **tests/rpc:** ensure new blocks are created before assert ([#3042](https://github.com/ChainSafe/gossamer/issues/3042)) ([a116d58](https://github.com/ChainSafe/gossamer/commit/a116d58bd1d19a6de71894486cd31816c0ec2550)) * **tests/rpc:** flaky test `TestChainSubscriptionRPC/chain_subscribeNewHeads` ([#3092](https://github.com/ChainSafe/gossamer/issues/3092)) ([5b56238](https://github.com/ChainSafe/gossamer/commit/5b5623852e5c7397d19b3b60286185e6a990a909)) * **tests/rpc:** place `GreaterOrEqual` arguments in the correct order at `chain_subscribeNewHeads` test ([#3137](https://github.com/ChainSafe/gossamer/issues/3137)) ([33bdf28](https://github.com/ChainSafe/gossamer/commit/33bdf28ca69dcee0e6fe23756b267446b5e6ce92)) * **tests:** Export unimplemented runtime fuctions ([#3461](https://github.com/ChainSafe/gossamer/issues/3461)) ([3e4546c](https://github.com/ChainSafe/gossamer/commit/3e4546c407341f7a1e689a8a2651d646e92db0cc)) * **trie:** do not create buffer for nil child ([#2928](https://github.com/ChainSafe/gossamer/issues/2928)) ([d70af4f](https://github.com/ChainSafe/gossamer/commit/d70af4ff5040a3d1299ce03c8f30331465bbd896)) * **wasmer:** `ext_storage_exists_version_1` for empty values ([#2973](https://github.com/ChainSafe/gossamer/issues/2973)) ([059268e](https://github.com/ChainSafe/gossamer/commit/059268e29b6240fbdec1ccb7f353bb0c35efa849)) ### Features * **chain:** Add Westend network as command line `chain` option ([#3103](https://github.com/ChainSafe/gossamer/issues/3103)) ([d9cdd45](https://github.com/ChainSafe/gossamer/commit/d9cdd45d63b0985878dc964c4b93ef7d706b2606)) * **chain:** remove unneeded spec files ([#3086](https://github.com/ChainSafe/gossamer/issues/3086)) ([c76387d](https://github.com/ChainSafe/gossamer/commit/c76387daa6d34bf080f47f584399efe8b784eebc)) * **cli:** use a single flag for log level in the CLI ([#3303](https://github.com/ChainSafe/gossamer/issues/3303)) ([caf3ea4](https://github.com/ChainSafe/gossamer/commit/caf3ea4ac2d738cbb89884a224f967e74c5c1701)) * **dot/network:** introduce libp2p resource manager + prometheus metrics ([#3333](https://github.com/ChainSafe/gossamer/issues/3333)) ([f166746](https://github.com/ChainSafe/gossamer/commit/f166746e22970cbe32c1cf01a019c11d89b4d4ef)) * **dot/rpc:** export block trie state entries for a block hash ([#3607](https://github.com/ChainSafe/gossamer/issues/3607)) ([43828fe](https://github.com/ChainSafe/gossamer/commit/43828fe0c20b0ae4dc58f2a45d2cd00f1768569b)) * **dot/rpc:** implement RPC method state_queryStorageAt ([#3191](https://github.com/ChainSafe/gossamer/issues/3191)) ([3bbdfe0](https://github.com/ChainSafe/gossamer/commit/3bbdfe076a49dcad0f060fc3e71ec9e7c54b2f96)) * **dot/state:** create `Range` to traverse the blocktree and the blocks in the disk ([#2990](https://github.com/ChainSafe/gossamer/issues/2990)) ([4442eee](https://github.com/ChainSafe/gossamer/commit/4442eee9f219144ae687e681c02a02406f17a6d9)) * **dot/state:** keep latest state trie in memory ([#3386](https://github.com/ChainSafe/gossamer/issues/3386)) ([421d087](https://github.com/ChainSafe/gossamer/commit/421d08721598ad27d890ebddf5f729bf9d62124f)) * **dot/sync:** include block origin and skip extra validation on `initialSync` ([#3392](https://github.com/ChainSafe/gossamer/issues/3392)) ([8e1650e](https://github.com/ChainSafe/gossamer/commit/8e1650e0f16115ea2bf5f922207f5a40050fd122)) * **dot/sync:** Remove the `EndBlockHash` from `BlockRequestMessage` ([#2977](https://github.com/ChainSafe/gossamer/issues/2977)) ([b25e0b4](https://github.com/ChainSafe/gossamer/commit/b25e0b47e04f91d5b2bc99c934f7eb777980cabe)) * **internal/database:** replace `chaindb/badgerdb` with `pebbledb` ([#3434](https://github.com/ChainSafe/gossamer/issues/3434)) ([344461d](https://github.com/ChainSafe/gossamer/commit/344461dfca4d7cc341379cc778f4eeabd411e4cb)) * introduces `SaturatingAdd` and `SaturatingSub` ([#3519](https://github.com/ChainSafe/gossamer/issues/3519)) ([daa9e25](https://github.com/ChainSafe/gossamer/commit/daa9e25e201e4a9459dad266bb9d979b9d250687)) * **lib/allocator:** Refactor `FreeingBumpHeapAllocator` ([#3570](https://github.com/ChainSafe/gossamer/issues/3570)) ([39ca47f](https://github.com/ChainSafe/gossamer/commit/39ca47fc407253426feeb5694c40b63848b51da2)) * **lib/babe:** Submit BABE equivocation report ([#2947](https://github.com/ChainSafe/gossamer/issues/2947)) ([55de62e](https://github.com/ChainSafe/gossamer/commit/55de62e2984a9e0a3db0a9a663f5133bb5928376)), closes [#2853](https://github.com/ChainSafe/gossamer/issues/2853) * **lib/blocktree:** reduce the entries in the runtimes mapping ([#3151](https://github.com/ChainSafe/gossamer/issues/3151)) ([1a34972](https://github.com/ChainSafe/gossamer/commit/1a34972b4cdfd49174bac566b3b26061fc23113f)) * **lib/grandpa:** include `t.Parallel()` to all `lib/grandpa` tests ([#2840](https://github.com/ChainSafe/gossamer/issues/2840)) ([5c93488](https://github.com/ChainSafe/gossamer/commit/5c9348852bea2aee20d724dcf7c7f863850f8882)) * **lib/runtime/wasmer:** report grandpa equivocations ([#3007](https://github.com/ChainSafe/gossamer/issues/3007)) ([e63aeea](https://github.com/ChainSafe/gossamer/commit/e63aeea4423fe05efc94756160ddcf47382dbe90)) * **lib/runtime:** `wazero` implementation of `runtime.Instance` ([#3279](https://github.com/ChainSafe/gossamer/issues/3279)) ([115d6f5](https://github.com/ChainSafe/gossamer/commit/115d6f53bd3b843aba03678909c20f111a8e6ddd)) * **lib/runtime:** add extra required runtime imports for parachain validation ([#3254](https://github.com/ChainSafe/gossamer/issues/3254)) ([dc1a521](https://github.com/ChainSafe/gossamer/commit/dc1a521f7104cfd8a26fa843858dd8538e0d90c7)) * **lib/runtime:** Update default `runtime.Instance` to `wazero` ([#3352](https://github.com/ChainSafe/gossamer/issues/3352)) ([308b10a](https://github.com/ChainSafe/gossamer/commit/308b10af3912a80a5e2c974b159092151366301e)) * **pkg/scale:** `VaryingDataType` String method ([#2970](https://github.com/ChainSafe/gossamer/issues/2970)) ([841636e](https://github.com/ChainSafe/gossamer/commit/841636ed034d29bcfd06fe93b52d3f9074b042ab)) * **pkg/scale:** Add `Marshaler` and `Unmarshaler` interfaces and functionality ([#3617](https://github.com/ChainSafe/gossamer/issues/3617)) ([4888ce4](https://github.com/ChainSafe/gossamer/commit/4888ce4cf10919a758f0f511256081bbd306f54c)) * **pkg/scale:** Use `New()` receiver function for construction of custom `VaryingDataType` ([#3315](https://github.com/ChainSafe/gossamer/issues/3315)) ([9688f6c](https://github.com/ChainSafe/gossamer/commit/9688f6c258f6f4cc48d99969d6573aca46bb2563)) * **runtime/wasmer:** create wrapper around wasmer.Memory ([#3160](https://github.com/ChainSafe/gossamer/issues/3160)) ([fc1055d](https://github.com/ChainSafe/gossamer/commit/fc1055dddce38cdcd61ec9afb593a10a30e2fde9)) * **runtime/wasmer:** write wasmer using latest wasmer version ([#3168](https://github.com/ChainSafe/gossamer/issues/3168)) ([32f1aa8](https://github.com/ChainSafe/gossamer/commit/32f1aa8950d0bcbd86588981778cb92f415d000a)) * **scale:** add `MustMarshal` function ([#2991](https://github.com/ChainSafe/gossamer/issues/2991)) ([32a80aa](https://github.com/ChainSafe/gossamer/commit/32a80aa9af7d0d6475ceeac27d85954da5818aed)) * **sync:** Validate bad blocks ([#3220](https://github.com/ChainSafe/gossamer/issues/3220)) ([0d0354b](https://github.com/ChainSafe/gossamer/commit/0d0354bb49d9c6c847d8bc716c5978ac8b026930)) * **telemetry:** Add scheduled and force changes telemetry metrics ([#3226](https://github.com/ChainSafe/gossamer/issues/3226)) ([c53b1cd](https://github.com/ChainSafe/gossamer/commit/c53b1cd425f691071316a6cf92ad1644af5e258b)) * **trie:** Add trie v1 new headers support ([#3295](https://github.com/ChainSafe/gossamer/issues/3295)) ([c30f463](https://github.com/ChainSafe/gossamer/commit/c30f46379022c2341dd0f86dab117f9ca039a574)) * **zombienet:** Add javascript tests to zombienet testing ([#3200](https://github.com/ChainSafe/gossamer/issues/3200)) ([aca9a5b](https://github.com/ChainSafe/gossamer/commit/aca9a5b58a9c81ba8324dd2c2bc71fdf2f83c2f1)) * **zombienet:** add zombienet testing to github workflow ([#3192](https://github.com/ChainSafe/gossamer/issues/3192)) ([d788bd6](https://github.com/ChainSafe/gossamer/commit/d788bd6871d57035e43eda35681351806669edbe)) ### Reverts * **lib/runtime:** rollback wasmer update `PR[#3168](https://github.com/ChainSafe/gossamer/issues/3168)` ([#3264](https://github.com/ChainSafe/gossamer/issues/3264)) ([e7ff0cf](https://github.com/ChainSafe/gossamer/commit/e7ff0cfbf184f5b914a37eaf1e4e90252d0dbae2)) --- CHANGELOG.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e161687db2..e75553924c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,107 @@ # Semantic Versioning Changelog +# [0.8.0](https://github.com/ChainSafe/gossamer/compare/v0.7.0...v0.8.0) (2023-12-11) + + +### Bug Fixes + +* **.github/workflows:** update node.js version ([#3637](https://github.com/ChainSafe/gossamer/issues/3637)) ([619be1b](https://github.com/ChainSafe/gossamer/commit/619be1b71b3fae344e8f1ae141ca875ce0ae25fc)) +* **babe:** Add support for versioned NextConfigData decoding ([#3239](https://github.com/ChainSafe/gossamer/issues/3239)) ([5ee3a64](https://github.com/ChainSafe/gossamer/commit/5ee3a641ff02153b7d1e9611f4fc8c90d7c66fad)) +* **blockstate:** if blocktree fails to search a hash in memory, load it from disk ([#3059](https://github.com/ChainSafe/gossamer/issues/3059)) ([6442544](https://github.com/ChainSafe/gossamer/commit/64425445e6be472ae1e2dffba85f8ce4221d2eb8)) +* cache slot to header data while checking BABE equivocation ([#3364](https://github.com/ChainSafe/gossamer/issues/3364)) ([dcfa4a4](https://github.com/ChainSafe/gossamer/commit/dcfa4a44acbfea9dc062fcf8eccb15dc61480ea2)) +* **chain:** Fix `chain=westend` option ([#3123](https://github.com/ChainSafe/gossamer/issues/3123)) ([64dbba6](https://github.com/ChainSafe/gossamer/commit/64dbba63b663cb9eb662a0dee24d0406f2d22baf)) +* **ci:** cancel previous workflow runs ([#3140](https://github.com/ChainSafe/gossamer/issues/3140)) ([a322a19](https://github.com/ChainSafe/gossamer/commit/a322a1934c1ca1b3db8d91823028e08fb10b841b)) +* **ci:** fix all Deepsource issues ([#3046](https://github.com/ChainSafe/gossamer/issues/3046)) ([4ea0a70](https://github.com/ChainSafe/gossamer/commit/4ea0a703339ca06e617b06eeb7d56308e7b48093)) +* **ci:** fix broken docker build ([#3231](https://github.com/ChainSafe/gossamer/issues/3231)) ([f796430](https://github.com/ChainSafe/gossamer/commit/f7964304beecd5631466b74f0de638848e97971c)) +* **ci:** Fix staging metrics collection ([#3138](https://github.com/ChainSafe/gossamer/issues/3138)) ([05a5c4c](https://github.com/ChainSafe/gossamer/commit/05a5c4c6264b32bb0f765377572d08252dfa0f98)) +* **cli:** parse module log-levels ([#3285](https://github.com/ChainSafe/gossamer/issues/3285)) ([86c7577](https://github.com/ChainSafe/gossamer/commit/86c7577dbf5d603422ee1cc237014c74235c374f)) +* **cmd/gossamer:** embed default toml config files ([#3091](https://github.com/ChainSafe/gossamer/issues/3091)) ([af38364](https://github.com/ChainSafe/gossamer/commit/af38364f5ec209f56b6ae69072b60e22f2d6c093)) +* **cmd/gossamer:** update error message ([#3301](https://github.com/ChainSafe/gossamer/issues/3301)) ([960a9d4](https://github.com/ChainSafe/gossamer/commit/960a9d48e52dde4785cfa3c9c05c6493d5dbb452)) +* **dot/babe:** use `bs.latestFinalised` instead of using `round/set id` ([#3167](https://github.com/ChainSafe/gossamer/issues/3167)) ([46c0ef7](https://github.com/ChainSafe/gossamer/commit/46c0ef7d4013a2bba225c8e502978894c4eb571a)) +* **dot/digest:** create `BlockImportHandler` and remove channel ([#3312](https://github.com/ChainSafe/gossamer/issues/3312)) ([a179855](https://github.com/ChainSafe/gossamer/commit/a179855cd2ed7614e94c090e80111d2bc3ea365c)) +* **dot/network:** `findPeers` returns on timeout if a peer is found ([#3001](https://github.com/ChainSafe/gossamer/issues/3001)) ([2a05ce7](https://github.com/ChainSafe/gossamer/commit/2a05ce76a84765da17147598c99a66e06486b754)) +* **dot/network:** remove `maxReads` limitation to read stream ([#3287](https://github.com/ChainSafe/gossamer/issues/3287)) ([483b23f](https://github.com/ChainSafe/gossamer/commit/483b23f19467eaa22ece4fb26566dcf70f28e0c7)) +* **dot/state:** clean up scheduled changes once a forced change is applied ([#3219](https://github.com/ChainSafe/gossamer/issues/3219)) ([5ebec46](https://github.com/ChainSafe/gossamer/commit/5ebec4651ff88514cdb2e8a536c680fc6475d267)) +* **dot/state:** fix a bug in IsDescendantOf ([#3125](https://github.com/ChainSafe/gossamer/issues/3125)) ([4fd4a89](https://github.com/ChainSafe/gossamer/commit/4fd4a89610da35a5a1424121a808b93ac9983d42)) +* **dot/state:** store raw authority keys and decode when verifying block signature ([#3627](https://github.com/ChainSafe/gossamer/issues/3627)) ([58f741d](https://github.com/ChainSafe/gossamer/commit/58f741d8d4d98ef7e8a66116f7ef77fe945b8fd5)) +* **dot/sync:** fix `Timestamp slot must match 'CurrentSlot'` while using `westend` spec file ([#3040](https://github.com/ChainSafe/gossamer/issues/3040)) ([e6da01b](https://github.com/ChainSafe/gossamer/commit/e6da01b2f323d377dbcb2e053a4b2bc2daa34e3f)) +* **dot/sync:** Revert verify justification before importing blocks ([#3615](https://github.com/ChainSafe/gossamer/issues/3615)) ([11b96dc](https://github.com/ChainSafe/gossamer/commit/11b96dcfa326a74911c76b120de7373c47de37a2)) +* **dot/sync:** rework on bootstrap/tip sync ([#3227](https://github.com/ChainSafe/gossamer/issues/3227)) ([ab6650a](https://github.com/ChainSafe/gossamer/commit/ab6650a1ae722071f6415e2ce2649a8a13f99dc4)) +* **dot/sync:** use `Range` instead of `SubChain` at `handleDescedingRequest` ([#3006](https://github.com/ChainSafe/gossamer/issues/3006)) ([a83c1a3](https://github.com/ChainSafe/gossamer/commit/a83c1a36521c1954953d524517ed774a93a21122)) +* **dot/sync:** verify justification before importing blocks ([#3576](https://github.com/ChainSafe/gossamer/issues/3576)) ([2954fc0](https://github.com/ChainSafe/gossamer/commit/2954fc0b2c49eee6e93d5ac82ae5cae2c6bff440)) +* **dot/sync:** wrong error message at `checkOrGetDescendantHash` ([#2971](https://github.com/ChainSafe/gossamer/issues/2971)) ([b1c6bf1](https://github.com/ChainSafe/gossamer/commit/b1c6bf1a6ca48622276f59457e5e32a50b3fa0da)) +* **dot:** use tempDir in tests as base path to avoid creating `dot/~` ([#3363](https://github.com/ChainSafe/gossamer/issues/3363)) ([04514d5](https://github.com/ChainSafe/gossamer/commit/04514d53e5d81bae57ca81d0e69193ef52ab05c3)) +* **go.mod:** Replace `centrifuge/go-substrate-rpc-client` dependency to `timwu20/go-substrate-rpc-client` temporarily to fix build ([#3572](https://github.com/ChainSafe/gossamer/issues/3572)) ([ea49251](https://github.com/ChainSafe/gossamer/commit/ea4925135525e77c00a2e9f959af39d944cf4628)) +* **lib/babe:** Add context and additional assertion to TestBuildBlock_ok ([#3101](https://github.com/ChainSafe/gossamer/issues/3101)) ([a9a89ed](https://github.com/ChainSafe/gossamer/commit/a9a89ed8afa2a75b5a09fc7a1da2009025111680)) +* **lib/babe:** rewrite TestBuildBlock_failing ([#3089](https://github.com/ChainSafe/gossamer/issues/3089)) ([28a3d0b](https://github.com/ChainSafe/gossamer/commit/28a3d0b4ffb379b04472d4823d82c3e56186d152)) +* **lib/babe:** use current system time to yield a new slot ([#3133](https://github.com/ChainSafe/gossamer/issues/3133)) ([9cd6f25](https://github.com/ChainSafe/gossamer/commit/9cd6f25447d06092df199e06b770f65c12e7a0ec)) +* **lib/grandpa:** on verifying block justification, compare given block hash with finalised hash ([#3081](https://github.com/ChainSafe/gossamer/issues/3081)) ([fc91843](https://github.com/ChainSafe/gossamer/commit/fc9184372a725b8f411e141be96fa3dcfadce92e)) +* **lib/grandpa:** ensure `finalisationEngine` exits when stop channel is triggered ([#3141](https://github.com/ChainSafe/gossamer/issues/3141)) ([d7f7c06](https://github.com/ChainSafe/gossamer/commit/d7f7c068560f75597d6535dc3b95f905095af5a1)) +* **lib/runtime:** `ext_default_child_storage_next_key_version_1` return `None` correctly ([#3473](https://github.com/ChainSafe/gossamer/issues/3473)) ([c7d574b](https://github.com/ChainSafe/gossamer/commit/c7d574bbd949f76537cc1cf8f87681d1250f20ec)) +* **lib/runtime:** Fix `wasm error: out of bounds memory access` at `[#9412261](https://github.com/ChainSafe/gossamer/issues/9412261)` ([#3588](https://github.com/ChainSafe/gossamer/issues/3588)) ([ecb1ad9](https://github.com/ChainSafe/gossamer/commit/ecb1ad91b9119d2c6e8eec0894e769aa0cf5b586)) +* **lib/runtime:** prevents polkadot zero-address bug using `sr25519_verify` version 1 ([#3494](https://github.com/ChainSafe/gossamer/issues/3494)) ([8b93d5e](https://github.com/ChainSafe/gossamer/commit/8b93d5e532d551d5284a14c202e85f4e850632f1)) +* **lib/runtime:** return correct encoded value for `None` ([#3451](https://github.com/ChainSafe/gossamer/issues/3451)) ([3e11bc2](https://github.com/ChainSafe/gossamer/commit/3e11bc2647548ee593e4494fd4c0b119b0be0f2c)) +* **lib/runtime:** update `MaxPossibleAllocation` to `2^25` ([#3393](https://github.com/ChainSafe/gossamer/issues/3393)) ([91eabdc](https://github.com/ChainSafe/gossamer/commit/91eabdcc0b4c52bda79caa1604ee558747fcf269)) +* **lib/runtime:** use `westend-dev` spec file in `TestNodeRuntime_ValidateTransaction` ([#3047](https://github.com/ChainSafe/gossamer/issues/3047)) ([043f5eb](https://github.com/ChainSafe/gossamer/commit/043f5eb77f0468f61e5721b8833b032df9f84562)) +* **lib/trie:** `ClearFromChild` should update parent trie ([#3482](https://github.com/ChainSafe/gossamer/issues/3482)) ([70e2d2b](https://github.com/ChainSafe/gossamer/commit/70e2d2beea3d14a41f0cdbd162fca94043c29e6b)) +* **lib/trie:** create an empty child trie if not found ([#3459](https://github.com/ChainSafe/gossamer/issues/3459)) ([5d68447](https://github.com/ChainSafe/gossamer/commit/5d6844748bc26e3ca9be2e8a62cd0276abe578e4)) +* **lib/trie:** record deleted Merkle values fixed ([#2873](https://github.com/ChainSafe/gossamer/issues/2873)) ([61f0216](https://github.com/ChainSafe/gossamer/commit/61f02161e0aadf988b1627857e6b90d2e1c138b2)) +* **peerset:** check for incoming slot error ([#2952](https://github.com/ChainSafe/gossamer/issues/2952)) ([a1602bc](https://github.com/ChainSafe/gossamer/commit/a1602bc21084919c299bd11218560125404b870b)) +* **rpc-tests:** Fix node port to execute tests on macOS ([#3223](https://github.com/ChainSafe/gossamer/issues/3223)) ([f758575](https://github.com/ChainSafe/gossamer/commit/f758575c4c5bb4312fef9bd40b330aa2c78e5a0c)) +* **rpc/modules:** use `westend-local` in `TestAuthorModule_SubmitExtrinsic_invalid` test ([#3051](https://github.com/ChainSafe/gossamer/issues/3051)) ([b6429b7](https://github.com/ChainSafe/gossamer/commit/b6429b75001bd4582ed3848840f4ae46dc6a7caa)) +* **runtime:** initialize TransactionState when creating runtime instance ([#3188](https://github.com/ChainSafe/gossamer/issues/3188)) ([29fe7a0](https://github.com/ChainSafe/gossamer/commit/29fe7a01db0a389f4d81c1740c190fd84f950b4b)) +* **scale:** Use *int for scale index ([#3274](https://github.com/ChainSafe/gossamer/issues/3274)) ([9b04d30](https://github.com/ChainSafe/gossamer/commit/9b04d307e148a4659ac330e0e1edd42e57ceb527)) +* **staging:** fixes the staging deployment issues caused by the new cli ([#3266](https://github.com/ChainSafe/gossamer/issues/3266)) ([1f4e786](https://github.com/ChainSafe/gossamer/commit/1f4e786883f6223c9db151a45c2bef04116fa251)) +* **state:** clarify node hashes vs merkle values ([#2915](https://github.com/ChainSafe/gossamer/issues/2915)) ([e4033e8](https://github.com/ChainSafe/gossamer/commit/e4033e8cefbe7c5176e956cb14cb5259353207fc)) +* **test/rpc:** use `westend-local` in `TestStateRPCAPI` ([#3049](https://github.com/ChainSafe/gossamer/issues/3049)) ([c57ade6](https://github.com/ChainSafe/gossamer/commit/c57ade66bd9ce3fded39e076ec1b7920068f1342)) +* **tests/polkadot_js:** Use `westend-local` to run polkadot js test suite ([#3052](https://github.com/ChainSafe/gossamer/issues/3052)) ([2d5ead1](https://github.com/ChainSafe/gossamer/commit/2d5ead18ed3aa8fd1e412b26755a165de2248c02)) +* **tests/rpc:** ensure new blocks are created before assert ([#3042](https://github.com/ChainSafe/gossamer/issues/3042)) ([a116d58](https://github.com/ChainSafe/gossamer/commit/a116d58bd1d19a6de71894486cd31816c0ec2550)) +* **tests/rpc:** flaky test `TestChainSubscriptionRPC/chain_subscribeNewHeads` ([#3092](https://github.com/ChainSafe/gossamer/issues/3092)) ([5b56238](https://github.com/ChainSafe/gossamer/commit/5b5623852e5c7397d19b3b60286185e6a990a909)) +* **tests/rpc:** place `GreaterOrEqual` arguments in the correct order at `chain_subscribeNewHeads` test ([#3137](https://github.com/ChainSafe/gossamer/issues/3137)) ([33bdf28](https://github.com/ChainSafe/gossamer/commit/33bdf28ca69dcee0e6fe23756b267446b5e6ce92)) +* **tests:** Export unimplemented runtime fuctions ([#3461](https://github.com/ChainSafe/gossamer/issues/3461)) ([3e4546c](https://github.com/ChainSafe/gossamer/commit/3e4546c407341f7a1e689a8a2651d646e92db0cc)) +* **trie:** do not create buffer for nil child ([#2928](https://github.com/ChainSafe/gossamer/issues/2928)) ([d70af4f](https://github.com/ChainSafe/gossamer/commit/d70af4ff5040a3d1299ce03c8f30331465bbd896)) +* **wasmer:** `ext_storage_exists_version_1` for empty values ([#2973](https://github.com/ChainSafe/gossamer/issues/2973)) ([059268e](https://github.com/ChainSafe/gossamer/commit/059268e29b6240fbdec1ccb7f353bb0c35efa849)) + + +### Features + +* **chain:** Add Westend network as command line `chain` option ([#3103](https://github.com/ChainSafe/gossamer/issues/3103)) ([d9cdd45](https://github.com/ChainSafe/gossamer/commit/d9cdd45d63b0985878dc964c4b93ef7d706b2606)) +* **chain:** remove unneeded spec files ([#3086](https://github.com/ChainSafe/gossamer/issues/3086)) ([c76387d](https://github.com/ChainSafe/gossamer/commit/c76387daa6d34bf080f47f584399efe8b784eebc)) +* **cli:** use a single flag for log level in the CLI ([#3303](https://github.com/ChainSafe/gossamer/issues/3303)) ([caf3ea4](https://github.com/ChainSafe/gossamer/commit/caf3ea4ac2d738cbb89884a224f967e74c5c1701)) +* **dot/network:** introduce libp2p resource manager + prometheus metrics ([#3333](https://github.com/ChainSafe/gossamer/issues/3333)) ([f166746](https://github.com/ChainSafe/gossamer/commit/f166746e22970cbe32c1cf01a019c11d89b4d4ef)) +* **dot/rpc:** export block trie state entries for a block hash ([#3607](https://github.com/ChainSafe/gossamer/issues/3607)) ([43828fe](https://github.com/ChainSafe/gossamer/commit/43828fe0c20b0ae4dc58f2a45d2cd00f1768569b)) +* **dot/rpc:** implement RPC method state_queryStorageAt ([#3191](https://github.com/ChainSafe/gossamer/issues/3191)) ([3bbdfe0](https://github.com/ChainSafe/gossamer/commit/3bbdfe076a49dcad0f060fc3e71ec9e7c54b2f96)) +* **dot/state:** create `Range` to traverse the blocktree and the blocks in the disk ([#2990](https://github.com/ChainSafe/gossamer/issues/2990)) ([4442eee](https://github.com/ChainSafe/gossamer/commit/4442eee9f219144ae687e681c02a02406f17a6d9)) +* **dot/state:** keep latest state trie in memory ([#3386](https://github.com/ChainSafe/gossamer/issues/3386)) ([421d087](https://github.com/ChainSafe/gossamer/commit/421d08721598ad27d890ebddf5f729bf9d62124f)) +* **dot/sync:** include block origin and skip extra validation on `initialSync` ([#3392](https://github.com/ChainSafe/gossamer/issues/3392)) ([8e1650e](https://github.com/ChainSafe/gossamer/commit/8e1650e0f16115ea2bf5f922207f5a40050fd122)) +* **dot/sync:** Remove the `EndBlockHash` from `BlockRequestMessage` ([#2977](https://github.com/ChainSafe/gossamer/issues/2977)) ([b25e0b4](https://github.com/ChainSafe/gossamer/commit/b25e0b47e04f91d5b2bc99c934f7eb777980cabe)) +* **internal/database:** replace `chaindb/badgerdb` with `pebbledb` ([#3434](https://github.com/ChainSafe/gossamer/issues/3434)) ([344461d](https://github.com/ChainSafe/gossamer/commit/344461dfca4d7cc341379cc778f4eeabd411e4cb)) +* introduces `SaturatingAdd` and `SaturatingSub` ([#3519](https://github.com/ChainSafe/gossamer/issues/3519)) ([daa9e25](https://github.com/ChainSafe/gossamer/commit/daa9e25e201e4a9459dad266bb9d979b9d250687)) +* **lib/allocator:** Refactor `FreeingBumpHeapAllocator` ([#3570](https://github.com/ChainSafe/gossamer/issues/3570)) ([39ca47f](https://github.com/ChainSafe/gossamer/commit/39ca47fc407253426feeb5694c40b63848b51da2)) +* **lib/babe:** Submit BABE equivocation report ([#2947](https://github.com/ChainSafe/gossamer/issues/2947)) ([55de62e](https://github.com/ChainSafe/gossamer/commit/55de62e2984a9e0a3db0a9a663f5133bb5928376)), closes [#2853](https://github.com/ChainSafe/gossamer/issues/2853) +* **lib/blocktree:** reduce the entries in the runtimes mapping ([#3151](https://github.com/ChainSafe/gossamer/issues/3151)) ([1a34972](https://github.com/ChainSafe/gossamer/commit/1a34972b4cdfd49174bac566b3b26061fc23113f)) +* **lib/grandpa:** include `t.Parallel()` to all `lib/grandpa` tests ([#2840](https://github.com/ChainSafe/gossamer/issues/2840)) ([5c93488](https://github.com/ChainSafe/gossamer/commit/5c9348852bea2aee20d724dcf7c7f863850f8882)) +* **lib/runtime/wasmer:** report grandpa equivocations ([#3007](https://github.com/ChainSafe/gossamer/issues/3007)) ([e63aeea](https://github.com/ChainSafe/gossamer/commit/e63aeea4423fe05efc94756160ddcf47382dbe90)) +* **lib/runtime:** `wazero` implementation of `runtime.Instance` ([#3279](https://github.com/ChainSafe/gossamer/issues/3279)) ([115d6f5](https://github.com/ChainSafe/gossamer/commit/115d6f53bd3b843aba03678909c20f111a8e6ddd)) +* **lib/runtime:** add extra required runtime imports for parachain validation ([#3254](https://github.com/ChainSafe/gossamer/issues/3254)) ([dc1a521](https://github.com/ChainSafe/gossamer/commit/dc1a521f7104cfd8a26fa843858dd8538e0d90c7)) +* **lib/runtime:** Update default `runtime.Instance` to `wazero` ([#3352](https://github.com/ChainSafe/gossamer/issues/3352)) ([308b10a](https://github.com/ChainSafe/gossamer/commit/308b10af3912a80a5e2c974b159092151366301e)) +* **pkg/scale:** `VaryingDataType` String method ([#2970](https://github.com/ChainSafe/gossamer/issues/2970)) ([841636e](https://github.com/ChainSafe/gossamer/commit/841636ed034d29bcfd06fe93b52d3f9074b042ab)) +* **pkg/scale:** Add `Marshaler` and `Unmarshaler` interfaces and functionality ([#3617](https://github.com/ChainSafe/gossamer/issues/3617)) ([4888ce4](https://github.com/ChainSafe/gossamer/commit/4888ce4cf10919a758f0f511256081bbd306f54c)) +* **pkg/scale:** Use `New()` receiver function for construction of custom `VaryingDataType` ([#3315](https://github.com/ChainSafe/gossamer/issues/3315)) ([9688f6c](https://github.com/ChainSafe/gossamer/commit/9688f6c258f6f4cc48d99969d6573aca46bb2563)) +* **runtime/wasmer:** create wrapper around wasmer.Memory ([#3160](https://github.com/ChainSafe/gossamer/issues/3160)) ([fc1055d](https://github.com/ChainSafe/gossamer/commit/fc1055dddce38cdcd61ec9afb593a10a30e2fde9)) +* **runtime/wasmer:** write wasmer using latest wasmer version ([#3168](https://github.com/ChainSafe/gossamer/issues/3168)) ([32f1aa8](https://github.com/ChainSafe/gossamer/commit/32f1aa8950d0bcbd86588981778cb92f415d000a)) +* **scale:** add `MustMarshal` function ([#2991](https://github.com/ChainSafe/gossamer/issues/2991)) ([32a80aa](https://github.com/ChainSafe/gossamer/commit/32a80aa9af7d0d6475ceeac27d85954da5818aed)) +* **sync:** Validate bad blocks ([#3220](https://github.com/ChainSafe/gossamer/issues/3220)) ([0d0354b](https://github.com/ChainSafe/gossamer/commit/0d0354bb49d9c6c847d8bc716c5978ac8b026930)) +* **telemetry:** Add scheduled and force changes telemetry metrics ([#3226](https://github.com/ChainSafe/gossamer/issues/3226)) ([c53b1cd](https://github.com/ChainSafe/gossamer/commit/c53b1cd425f691071316a6cf92ad1644af5e258b)) +* **trie:** Add trie v1 new headers support ([#3295](https://github.com/ChainSafe/gossamer/issues/3295)) ([c30f463](https://github.com/ChainSafe/gossamer/commit/c30f46379022c2341dd0f86dab117f9ca039a574)) +* **zombienet:** Add javascript tests to zombienet testing ([#3200](https://github.com/ChainSafe/gossamer/issues/3200)) ([aca9a5b](https://github.com/ChainSafe/gossamer/commit/aca9a5b58a9c81ba8324dd2c2bc71fdf2f83c2f1)) +* **zombienet:** add zombienet testing to github workflow ([#3192](https://github.com/ChainSafe/gossamer/issues/3192)) ([d788bd6](https://github.com/ChainSafe/gossamer/commit/d788bd6871d57035e43eda35681351806669edbe)) + + +### Reverts + +* **lib/runtime:** rollback wasmer update `PR[#3168](https://github.com/ChainSafe/gossamer/issues/3168)` ([#3264](https://github.com/ChainSafe/gossamer/issues/3264)) ([e7ff0cf](https://github.com/ChainSafe/gossamer/commit/e7ff0cfbf184f5b914a37eaf1e4e90252d0dbae2)) + # [0.7.0](https://github.com/ChainSafe/gossamer/compare/v0.6.0...v0.7.0) (2022-11-23) From 8cbe115b7b0da05db30d7ccc6513419798f96cdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:02:56 +0530 Subject: [PATCH 19/19] chore(deps): bump github.com/google/uuid from 1.4.0 to 1.5.0 (#3650) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8503708b3d..c96b84004b 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/fatih/color v1.16.0 github.com/go-playground/validator/v10 v10.16.0 github.com/google/go-cmp v0.6.0 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/gorilla/mux v1.8.1 github.com/gorilla/rpc v1.2.1 github.com/gorilla/websocket v1.5.1 diff --git a/go.sum b/go.sum index d1d9dd77d1..25beb3f6c9 100644 --- a/go.sum +++ b/go.sum @@ -286,8 +286,8 @@ github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f/go.mod h1:czg5+yv1E0Z github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=