Skip to content

Commit

Permalink
[1760]: Get rid of all the String() methods that just do yaml convers…
Browse files Browse the repository at this point in the history
…ion, and switch them to an auto-generated version.
  • Loading branch information
SpicyLemon committed May 7, 2024
1 parent 4da9f03 commit 7d40bf5
Show file tree
Hide file tree
Showing 18 changed files with 425 additions and 579 deletions.
1 change: 0 additions & 1 deletion proto/provenance/attribute/v1/attribute.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ option java_multiple_files = true;

// Params defines the set of params for the attribute module.
message Params {
option (gogoproto.goproto_stringer) = false;
// maximum length of data to allow in an attribute value
uint32 max_value_length = 1;
}
Expand Down
6 changes: 2 additions & 4 deletions proto/provenance/marker/v1/marker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ option java_multiple_files = true;

// Params defines the set of params for the account module.
message Params {
option (gogoproto.equal) = false;
option (gogoproto.goproto_stringer) = false;

option (gogoproto.equal) = true;
// Deprecated: Prefer to use `max_supply` instead. Maximum amount of supply to allow a marker to be created with
uint64 max_total_supply = 1 [(gogoproto.customtype) = "uint64", (gogoproto.nullable) = false, deprecated = true];
uint64 max_total_supply = 1 [deprecated = true];
// indicates if governance based controls of markers is allowed.
bool enable_governance = 2;
// a regular expression used to validate marker denom values from normal create requests (governance
Expand Down
3 changes: 1 addition & 2 deletions proto/provenance/metadata/v1/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ option java_multiple_files = true;

// Params defines the set of params for the metadata module.
message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = true;
}

// ScopeIdInfo contains various info regarding a scope id.
Expand Down
4 changes: 0 additions & 4 deletions proto/provenance/metadata/v1/scope.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ Indexes (special kvstore records for efficient cross reference/queries)

// Scope defines a root reference for a collection of records owned by one or more parties.
message Scope {
option (gogoproto.goproto_stringer) = false;

// Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos
bytes scope_id = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
// the scope specification that contains the specifications for data elements allowed within this scope
Expand All @@ -93,8 +91,6 @@ message Scope {
//
// NOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.
message Session {
option (gogoproto.goproto_stringer) = false;

bytes session_id = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
// unique id of the contract specification that was used to create this session.
bytes specification_id = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
Expand Down
10 changes: 0 additions & 10 deletions proto/provenance/metadata/v1/specification.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ option java_multiple_files = true;

// ScopeSpecification defines the required parties, resources, conditions, and consideration outputs for a contract
message ScopeSpecification {
option (gogoproto.goproto_stringer) = false;

// unique identifier for this specification on chain
bytes specification_id = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
// General information about this scope specification.
Expand All @@ -51,8 +49,6 @@ message ScopeSpecification {

// ContractSpecification defines the required parties, resources, conditions, and consideration outputs for a contract
message ContractSpecification {
option (gogoproto.goproto_stringer) = false;

// unique identifier for this specification on chain
bytes specification_id = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
// Description information for this contract specification
Expand All @@ -75,8 +71,6 @@ message ContractSpecification {

// RecordSpecification defines the specification for a Record including allowed/required inputs/outputs
message RecordSpecification {
option (gogoproto.goproto_stringer) = false;

// unique identifier for this specification on chain
bytes specification_id = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "MetadataAddress"];
// Name of Record that will be created when this specification is used
Expand All @@ -94,8 +88,6 @@ message RecordSpecification {
// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input
// parameter
message InputSpecification {
option (gogoproto.goproto_stringer) = false;

// name for this input
string name = 1;
// a type_name (typically a proto name or class_name)
Expand All @@ -111,8 +103,6 @@ message InputSpecification {

// Description holds general information that is handy to associate with a structure.
message Description {
option (gogoproto.goproto_stringer) = false;

// A Name for this thing.
string name = 1;
// A description of this thing.
Expand Down
109 changes: 55 additions & 54 deletions x/attribute/types/attribute.pb.go

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

8 changes: 0 additions & 8 deletions x/attribute/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package types
import (
"fmt"

"gopkg.in/yaml.v2"

paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)

Expand All @@ -19,12 +17,6 @@ var (
ParamStoreKeyMaxValueLength = []byte("MaxValueLength")
)

// String implements stringer interface
func (params Params) String() string {
out, _ := yaml.Marshal(params)
return string(out)
}

// ParamKeyTable for slashing module
// TODO: remove with the umber (v1.19.x) handlers.
func ParamKeyTable() paramtypes.KeyTable {
Expand Down
Loading

0 comments on commit 7d40bf5

Please sign in to comment.