Skip to content

Commit

Permalink
fix: add amino register and change proto for ucdao module
Browse files Browse the repository at this point in the history
  • Loading branch information
kioqq committed Aug 1, 2024
1 parent 31c96a3 commit 5460e94
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 265 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package haqq.dao.module.v1;
package haqq.ucdao.module.v1;

import "cosmos/app/v1alpha1/module.proto";

Expand All @@ -14,6 +14,6 @@ message Module {
// Defaults to 5000 if not explicitly set.
uint64 max_metadata_len = 1;

// authority defines the custom module authority. If not set, defaults to the dao module.
// authority defines the custom module authority. If not set, defaults to the ucdao module.
string authority = 2;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
syntax = "proto3";

package haqq.dao.v1;
package haqq.ucdao.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";
import "haqq/dao/v1/dao.proto";
import "haqq/ucdao/v1/ucdao.proto";

option go_package = "github.com/haqq-network/haqq/x/ucdao/types";

Expand All @@ -15,10 +15,10 @@ message GenesisState {
// params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// balances is an array containing the balances of all the dao members' accounts.
// balances is an array containing the balances of all the ucdao members' accounts.
repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// total_balance represents the total balance of the dao module. If it is left empty, then supply will be calculated based on the provided
// total_balance represents the total balance of the ucdao module. If it is left empty, then supply will be calculated based on the provided
// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount.
repeated cosmos.base.v1beta1.Coin total_balance = 3 [
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
Expand Down
20 changes: 10 additions & 10 deletions proto/haqq/dao/v1/query.proto → proto/haqq/ucdao/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package haqq.dao.v1;
package haqq.ucdao.v1;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
Expand All @@ -9,16 +9,16 @@ import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/query/v1/query.proto";
import "amino/amino.proto";
import "haqq/dao/v1/dao.proto";
import "haqq/ucdao/v1/ucdao.proto";

option go_package = "github.com/haqq-network/haqq/x/ucdao/types";

// Query defines the gRPC querier service for dao module
// Query defines the gRPC querier service for ucdao module
service Query {
// Balance queries the balance of a single coin for a single account.
rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/haqq/dao/v1/balances/{address}/by_denom";
option (google.api.http).get = "/haqq/ucdao/v1/balances/{address}/by_denom";
}

// AllBalances queries the balance of all coins for a single account.
Expand All @@ -27,7 +27,7 @@ service Query {
// gas if the pagination field is incorrectly set.
rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/haqq/dao/v1/balances/{address}";
option (google.api.http).get = "/haqq/ucdao/v1/balances/{address}";
}

// TotalBalance queries the total balance of all coins locked in the module.
Expand All @@ -36,13 +36,13 @@ service Query {
// gas if the pagination field is incorrectly set.
rpc TotalBalance(QueryTotalBalanceRequest) returns (QueryTotalBalanceResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/haqq/dao/v1/total_balance";
option (google.api.http).get = "/haqq/ucdao/v1/total_balance";
}

// Params queries the parameters of x/dao module.
// Params queries the parameters of x/ucdao module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/haqq/dao/v1/params";
option (google.api.http).get = "/haqq/ucdao/v1/params";
}
}

Expand Down Expand Up @@ -118,10 +118,10 @@ message QueryTotalBalanceResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryParamsRequest defines the request type for querying x/dao parameters.
// QueryParamsRequest defines the request type for querying x/ucdao parameters.
message QueryParamsRequest {}

// QueryParamsResponse defines the response type for querying x/dao parameters.
// QueryParamsResponse defines the response type for querying x/ucdao parameters.
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package haqq.dao.v1;
package haqq.ucdao.v1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package haqq.dao.v1;
package haqq.ucdao.v1;

import "gogoproto/gogo.proto";
import "amino/amino.proto";
Expand Down
2 changes: 2 additions & 0 deletions x/ucdao/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the dao module.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
legacy.RegisterAminoMsg(cdc, &MsgFund{}, "haqq/ucdao/MsgFund")
legacy.RegisterAminoMsg(cdc, &MsgTransferOwnership{}, "haqq/ucdao/MsgTransferOwnership")

cdc.RegisterConcrete(Params{}, "haqq/x/ucdao/Params", nil)
}
Expand All @@ -28,6 +29,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgFund{},
&MsgTransferOwnership{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
Expand Down
72 changes: 36 additions & 36 deletions x/ucdao/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5460e94

Please sign in to comment.