Skip to content

Commit

Permalink
Merge pull request #170 from decentrio/feat/new-proto
Browse files Browse the repository at this point in the history
feat: add proto for new asset module
  • Loading branch information
catShaark authored Jul 11, 2024
2 parents 4fee34b + 8e34260 commit 75fbc76
Show file tree
Hide file tree
Showing 9 changed files with 1,530 additions and 578 deletions.
11 changes: 9 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: cosmos
repository: cosmos-proto
commit: 04467658e59e44bbb22fe568206e1f70
digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466
- remote: buf.build
owner: cosmos
repository: gogo-proto
commit: 34d970b699f84aa382f3c29773a60836
commit: 88ef6483f90f478fb938c37dde52ece3
digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 5ae7f88519b04fe1965da0f8a375a088
commit: f0e53af8f2fc4556b94f482688b57223
digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95
1 change: 1 addition & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: v1
name: buf.build/realiotech/realio-network
deps:
- buf.build/cosmos/cosmos-proto
- buf.build/cosmos/gogo-proto
- buf.build/googleapis/googleapis
breaking:
Expand Down
6 changes: 5 additions & 1 deletion proto/realionetwork/asset/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ import "gogoproto/gogo.proto";
option go_package = "github.com/realiotech/realio-network/x/asset/types";

// Params defines the parameters for the module.
message Params { option (gogoproto.goproto_stringer) = false; }
message Params {
option (gogoproto.goproto_stringer) = false;
// privileges refers to the privileges that is enabled for our privilege system.
repeated string privileges = 1;
}
16 changes: 11 additions & 5 deletions proto/realionetwork/asset/v1/token.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ syntax = "proto3";
package realionetwork.asset.v1;

import "gogoproto/gogo.proto";
import "realionetwork/asset/v1/tokenauthorization.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/realiotech/realio-network/x/asset/types";

// Token represents an asset in the module
message Token {
option (gogoproto.equal) = false;

string name = 1;
string symbol = 2;
string total = 3;
bool authorizationRequired = 4;
string manager = 5;
repeated TokenAuthorization authorized = 6;
string decimal = 3;
string description = 4;
}

message TokenManagement {
string manager = 1[(cosmos_proto.scalar) = "cosmos.AddressString"];
bool add_new_privilege = 2;
repeated string excluded_privileges = 3;
}
13 changes: 0 additions & 13 deletions proto/realionetwork/asset/v1/tokenauthorization.proto

This file was deleted.

85 changes: 51 additions & 34 deletions proto/realionetwork/asset/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,78 @@ package realionetwork.asset.v1;
option go_package = "github.com/realiotech/realio-network/x/asset/types";

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/bank/v1beta1/genesis.proto";
import "google/protobuf/any.proto";

// Msg defines the Msg service.
service Msg {

rpc CreateToken(MsgCreateToken) returns (MsgCreateTokenResponse);
rpc UpdateToken(MsgUpdateToken) returns (MsgUpdateTokenResponse);
rpc AuthorizeAddress(MsgAuthorizeAddress)
returns (MsgAuthorizeAddressResponse);
rpc UnAuthorizeAddress(MsgUnAuthorizeAddress)
returns (MsgUnAuthorizeAddressResponse);
rpc TransferToken(MsgTransferToken) returns (MsgTransferTokenResponse);
// this line is used by starport scaffolding # proto/tx/rpc
rpc AllocateToken(MsgAllocateToken) returns (MsgAllocateTokenResponse);
rpc AssignPrivilege(MsgAssignPrivilege) returns (MsgAssignPrivilegeResponse);
rpc UnassignPrivilege(MsgUnassignPrivilege)
returns (MsgUnassignPrivilegeResponse);
rpc DisablePrivilege(MsgDisablePrivilege)
returns (MsgDisablePrivilegeResponse);
rpc ExecutePrivilege(MsgExecutePrivilege)
returns (MsgExecutePrivilegeResponse);
}

message MsgCreateToken {
string manager = 1;
string name = 2;
string symbol = 3;
string total = 4;
bool authorizationRequired = 6;
string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string manager = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string name = 3;
string symbol = 4;
string decimal = 5;
repeated string excluded_privileges = 6;
bool add_new_privilege = 7;
}

message MsgCreateTokenResponse {}

message MsgUpdateToken {
string manager = 1;
string symbol = 2;
bool authorizationRequired = 3;
message MsgAllocateToken {
string manager = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
repeated cosmos.bank.v1beta1.Balance balances = 3
[ (gogoproto.nullable) = false ];
repeated google.protobuf.Any vesting_balance = 4;
}

message MsgUpdateTokenResponse {}
message MsgAllocateTokenResponse {}

message MsgAuthorizeAddress {
string manager = 1;
string symbol = 2;
string address = 3;
message MsgAssignPrivilege {
string manager = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
repeated string assigned_to = 3
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string privilege = 4;
}

message MsgAuthorizeAddressResponse {}
message MsgAssignPrivilegeResponse {}

message MsgUnAuthorizeAddress {
string manager = 1;
string symbol = 2;
string address = 3;
message MsgUnassignPrivilege {
string manager = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
repeated string unassigned_from = 3
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string privilege = 4;
}

message MsgUnAuthorizeAddressResponse {}
message MsgUnassignPrivilegeResponse {}

message MsgTransferToken {
string symbol = 1;
string from = 2;
string to = 3;
string amount = 4;
message MsgDisablePrivilege {
string manager = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
string disabled_privilege = 3;
}

message MsgTransferTokenResponse {}
message MsgDisablePrivilegeResponse {}

// this line is used by starport scaffolding # proto/tx/message
message MsgExecutePrivilege {
string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
google.protobuf.Any privilege_msg = 3;
}

message MsgExecutePrivilegeResponse {}
73 changes: 65 additions & 8 deletions x/asset/types/params.pb.go

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

Loading

0 comments on commit 75fbc76

Please sign in to comment.