Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/{capability, genutil} genesis types migrated to proto #6867

Merged
merged 13 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions proto/cosmos/capability/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";
package cosmos.capability;

import "gogoproto/gogo.proto";
import "cosmos/capability/capability.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types";

// GenesisOwners defines the capability owners with their corresponding index.
message GenesisOwners {
uint64 index = 1;
CapabilityOwners owners = 2[
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "index_owners",
(gogoproto.moretags) = "yaml:\"index_owners\""
];
}

// GenesisState represents the Capability module genesis state
message GenesisState {
// capability global index
uint64 index = 1;

// map from index to owners of the capability index
// index key is string to allow amino marshalling
repeated GenesisOwners owners = 2 [
(gogoproto.nullable) = false
];
}
15 changes: 15 additions & 0 deletions proto/cosmos/genutil/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package cosmos.genutil;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types";

// GenesisState defines the raw genesis transaction in JSON
message GenesisState {
repeated bytes gen_txs = 1 [
(gogoproto.casttype) = "encoding/json.RawMessage",
(gogoproto.jsontag) = "gentxs",
(gogoproto.moretags) = "yaml:\"gentxs\""
];
}
16 changes: 0 additions & 16 deletions x/capability/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ import (
// DefaultIndex is the default capability global index
const DefaultIndex uint64 = 1

// GenesisOwners defines the capability owners with their corresponding index.
type GenesisOwners struct {
Index uint64 `json:"index" yaml:"index"`
Owners CapabilityOwners `json:"index_owners" yaml:"index_owners"`
}

// GenesisState represents the Capability module genesis state
type GenesisState struct {
// capability global index
Index uint64 `json:"index" yaml:"index"`

// map from index to owners of the capability index
// index key is string to allow amino marshalling
Owners []GenesisOwners `json:"owners" yaml:"owners"`
}

// DefaultGenesis returns the default Capability genesis state
func DefaultGenesis() GenesisState {
return GenesisState{
Expand Down
Loading