diff --git a/go.mod b/go.mod index 56ed2d4fc..9be97f1d6 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/athanorlabs/go-dleq v0.1.0 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.2 github.com/cosmos/cosmos-sdk v0.47.3 github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/v7 v7.1.0 @@ -48,7 +47,6 @@ require ( golang.org/x/crypto v0.15.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/sync v0.5.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb google.golang.org/grpc v1.59.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -92,6 +90,7 @@ require ( github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.0 // indirect @@ -286,6 +285,7 @@ require ( google.golang.org/api v0.143.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/pkg/relayer/proxy/relay_verifier.go b/pkg/relayer/proxy/relay_verifier.go index f33c59454..ce48e055e 100644 --- a/pkg/relayer/proxy/relay_verifier.go +++ b/pkg/relayer/proxy/relay_verifier.go @@ -6,6 +6,7 @@ import ( sdkerrors "cosmossdk.io/errors" ring_secp256k1 "github.com/athanorlabs/go-dleq/secp256k1" ring "github.com/noot/ring-go" + "github.com/pokt-network/poktroll/x/service/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) diff --git a/x/service/client/cli/tx_add_service.go b/x/service/client/cli/tx_add_service.go index 559a31eae..af8e4861e 100644 --- a/x/service/client/cli/tx_add_service.go +++ b/x/service/client/cli/tx_add_service.go @@ -22,7 +22,7 @@ gateways and suppliers to use. The service id MUST be unique - or the command will fail, however the name you use to describe it does not have to be unique. Example: -$ poktrolld tx service add-service "srv1" "service_one" --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE) --home=$(POKTROLLD_HOME)`, +$ poktrolld tx service add-service "svc1" "service_one" --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE) --home=$(POKTROLLD_HOME)`, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { serviceIdStr := args[0] diff --git a/x/service/client/cli/tx_add_service_test.go b/x/service/client/cli/tx_add_service_test.go index 38cdf9983..b74d56b79 100644 --- a/x/service/client/cli/tx_add_service_test.go +++ b/x/service/client/cli/tx_add_service_test.go @@ -52,14 +52,14 @@ func TestCLI_AddService(t *testing.T) { // Prepare two valid services svc1 := sharedtypes.Service{ - Id: "srv1", + Id: "svc1", Name: "service name", } svc2 := sharedtypes.Service{ - Id: "srv2", + Id: "svc2", Name: "service name 2", } - // Add srv2 to the network + // Add svc2 to the network args := []string{ svc2.Id, svc2.Name, @@ -89,7 +89,7 @@ func TestCLI_AddService(t *testing.T) { { desc: "invalid - missing service name", supplierAddress: account.Address.String(), - service: sharedtypes.Service{Id: "srv1"}, // Name intentionally omitted + service: sharedtypes.Service{Id: "svc1"}, // Name intentionally omitted err: types.ErrServiceMissingName, }, { diff --git a/x/service/keeper/service_test.go b/x/service/keeper/service_test.go index b9e6db544..2e7d3e763 100644 --- a/x/service/keeper/service_test.go +++ b/x/service/keeper/service_test.go @@ -24,11 +24,11 @@ func init() { cmd.InitSDKConfig() } -func createNservices(keeper *keeper.Keeper, ctx sdk.Context, n int) []sharedtypes.Service { +func createNServices(keeper *keeper.Keeper, ctx sdk.Context, n int) []sharedtypes.Service { services := make([]sharedtypes.Service, n) for i := range services { - services[i].Id = fmt.Sprintf("srvId%d", i) - services[i].Name = fmt.Sprintf("srvName%d", i) + services[i].Id = fmt.Sprintf("svcId%d", i) + services[i].Name = fmt.Sprintf("svcName%d", i) keeper.SetService(ctx, services[i]) } @@ -42,14 +42,14 @@ func TestServiceModuleAddress(t *testing.T) { func TestServiceGet(t *testing.T) { keeper, ctx := keepertest.ServiceKeeper(t) - services := createNservices(keeper, ctx, 10) - for _, item := range services { + services := createNServices(keeper, ctx, 10) + for _, service := range services { service, found := keeper.GetService(ctx, - item.Id, + service.Id, ) require.True(t, found) require.Equal(t, - nullify.Fill(&item), + nullify.Fill(&service), nullify.Fill(&service), ) } @@ -57,7 +57,7 @@ func TestServiceGet(t *testing.T) { func TestServiceRemove(t *testing.T) { keeper, ctx := keepertest.ServiceKeeper(t) - services := createNservices(keeper, ctx, 10) + services := createNServices(keeper, ctx, 10) for _, service := range services { keeper.RemoveService(ctx, service.Id, @@ -71,7 +71,7 @@ func TestServiceRemove(t *testing.T) { func TestServiceGetAll(t *testing.T) { keeper, ctx := keepertest.ServiceKeeper(t) - services := createNservices(keeper, ctx, 10) + services := createNServices(keeper, ctx, 10) require.ElementsMatch(t, nullify.Fill(services), nullify.Fill(keeper.GetAllServices(ctx)), diff --git a/x/service/simulation/add_service.go b/x/service/simulation/add_service.go index dd6d8717c..8462edcd2 100644 --- a/x/service/simulation/add_service.go +++ b/x/service/simulation/add_service.go @@ -25,8 +25,8 @@ func SimulateMsgAddService( msg := &types.MsgAddService{ Address: simAccount.Address.String(), Service: sharedtypes.Service{ - Id: fmt.Sprintf("srvId%d", rndNum), - Name: fmt.Sprintf("servName%d", rndNum), + Id: fmt.Sprintf("svcId%d", rndNum), + Name: fmt.Sprintf("svcName%d", rndNum), }, } diff --git a/x/service/types/genesis_test.go b/x/service/types/genesis_test.go index c28b70996..1dba82ad3 100644 --- a/x/service/types/genesis_test.go +++ b/x/service/types/genesis_test.go @@ -11,13 +11,13 @@ import ( func TestGenesisState_Validate(t *testing.T) { svc1 := &sharedtypes.Service{ - Id: "srvId1", - Name: "srvName1", + Id: "svcId1", + Name: "svcName1", } svc2 := &sharedtypes.Service{ - Id: "srvId2", - Name: "srvName2", + Id: "svcId2", + Name: "svcName2", } tests := []struct { diff --git a/x/service/types/message_add_service_test.go b/x/service/types/message_add_service_test.go index be94b9d03..dfcc674e0 100644 --- a/x/service/types/message_add_service_test.go +++ b/x/service/types/message_add_service_test.go @@ -33,14 +33,14 @@ func TestMsgAddService_ValidateBasic(t *testing.T) { desc: "valid service supplier address - no service name", msg: MsgAddService{ Address: sample.AccAddress(), - Service: sharedtypes.Service{Id: "srv1"}, // Name intentionally omitted + Service: sharedtypes.Service{Id: "svc1"}, // Name intentionally omitted }, expectedErr: ErrServiceMissingName, }, { desc: "valid service supplier address and service", msg: MsgAddService{ Address: sample.AccAddress(), - Service: sharedtypes.Service{Id: "srv1", Name: "service name"}, + Service: sharedtypes.Service{Id: "svc1", Name: "service name"}, }, expectedErr: nil, }, diff --git a/x/shared/helpers/service_test.go b/x/shared/helpers/service_test.go index d74b77afa..e3dcf57d6 100644 --- a/x/shared/helpers/service_test.go +++ b/x/shared/helpers/service_test.go @@ -28,7 +28,7 @@ func TestIsValidService(t *testing.T) { { desc: "Valid ID and empty Name", - serviceId: "Srv", + serviceId: "svc", serviceName: "", // Valid because the service name can be empty expectedIsValid: true,