Skip to content

Commit

Permalink
Update proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsa committed Jul 25, 2017
1 parent 402624f commit 2c7a148
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 25 deletions.
15 changes: 1 addition & 14 deletions schema/commands.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";
package iroha.protocol;
import "primitive.proto";

message Amount {
uint64 integer_part = 1;
Expand Down Expand Up @@ -49,20 +50,6 @@ message RemoveSignatory {
}

message SetAccountPermissions {

message Permissions {
bool issue_assets = 1;
bool create_assets = 2;
bool create_accounts = 3;
bool create_domains = 4;
bool read_all_accounts = 5;
bool add_signatory = 6;
bool remove_signatory = 7;
bool set_permissions = 8;
bool set_quorum = 9;
bool can_transfer = 10;
}

string account_id = 1;
Permissions permissions = 2;
}
Expand Down
10 changes: 0 additions & 10 deletions schema/endpoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ service CommandService {
rpc Torii (Transaction) returns (ToriiResponse);
}

enum ResponseCode {
FAIL = 0; // default value
OK = 1;
}

message QueryResponse {
ResponseCode code = 1;
string message = 2;
}

service QueryService {
rpc Find (Query) returns (QueryResponse);
}
13 changes: 13 additions & 0 deletions schema/primitive.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
syntax = "proto3";
package iroha.protocol;

message Permissions {
bool issue_assets = 1;
bool create_assets = 2;
bool create_accounts = 3;
bool create_domains = 4;
bool read_all_accounts = 5;
bool add_signatory = 6;
bool remove_signatory = 7;
bool set_permissions = 8;
bool set_quorum = 9;
bool can_transfer = 10;
}

message Signature {
bytes pubkey = 1;
bytes signature = 2;
Expand Down
54 changes: 53 additions & 1 deletion schema/responses.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
syntax = "proto3";
package iroha.protocol;
import "block.proto";
import "primitive.proto";

// TODO: Proto client reponses go here
// *** WSV data structure *** //
message Asset {
string asset_id = 1;
string domain_id = 2;
uint32 precision = 3;
}

message Account {
string account_id = 1;
string domain_name = 2;
Permissions permissions = 3;
uint32 quorum = 4;
bytes master_key = 5;
}

message AccountAsset {
string asset_id = 1;
string account_id = 2;
uint64 balance = 3;
}

// *** Responses *** //
message AccountAssetsResponse {
repeated Asset assets = 1;
}

message AccountResponse {
Account account = 1;
}

message ErrorResponse {
string reason = 1;
}

message SignatoriesResponse {
repeated Signature signatories = 1;
}

message TransactionsResponse {
repeated Transaction transactions = 1;
}

message QueryResponse {
oneof response {
AccountAssetsResponse account_assets_response = 1;
AccountResponse account_response = 2;
ErrorResponse error_response = 3;
SignatoriesResponse signatories_response = 4;
TransactionsResponse transactions_response = 5;
}
}

0 comments on commit 2c7a148

Please sign in to comment.