Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request grpc-ecosystem#56 from tronprotocol/feature/add_fr…
Browse files Browse the repository at this point in the history
…ee_operation_limit

Feature/add free operation limit
  • Loading branch information
nanfengpo authored May 26, 2018
2 parents 2135552 + e994951 commit 2998ca9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 8 deletions.
29 changes: 28 additions & 1 deletion api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ service Wallet {
};
}

rpc UpdateAsset (UpdateAssetContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/updateasset"
body: "*"
additional_bindings {
get: "/wallet/updateasset"
}
};
}

rpc ListNodes (EmptyMessage) returns (NodeList) {
option (google.api.http) = {
post: "/wallet/listnodes"
Expand All @@ -171,6 +181,15 @@ service Wallet {
}
};
}
rpc GetAccountNet (Account) returns (AccountNetMessage) {
option (google.api.http) = {
post: "/wallet/getaccountnet"
body: "*"
additional_bindings {
get: "/wallet/getaccountnet"
}
};
};
rpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract) {
option (google.api.http) = {
post: "/wallet/getassetissuebyname"
Expand Down Expand Up @@ -529,4 +548,12 @@ message TimePaginatedMessage {
TimeMessage timeMessage = 1;
int64 offset = 2;
int64 limit = 3;
}
}
message AccountNetMessage {
int64 freeNetUsed = 1;
int64 freeNetLimit = 2;
int64 NetUsed = 3;
int64 NetLimit = 4;
map<string, int64> assetNetUsed = 5;
map<string, int64> assetNetLimit = 6;
}
12 changes: 12 additions & 0 deletions core/Contract.proto
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ message AssetIssueContract {
int32 vote_score = 16;
bytes description = 20;
bytes url = 21;
int64 free_asset_net_limit = 22;
int64 public_free_asset_net_limit = 23;
int64 public_free_asset_net_usage = 24;
int64 public_latest_free_net_time = 25;
}

message ParticipateAssetIssueContract {
Expand Down Expand Up @@ -123,4 +127,12 @@ message UnfreezeAssetContract {

message WithdrawBalanceContract {
bytes owner_address = 1;
}

message UpdateAssetContract {
bytes owner_address = 1;
bytes description = 2;
bytes url = 3;
int64 new_limit = 4;
int64 new_public_limit = 5;
}
32 changes: 25 additions & 7 deletions core/Tron.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message Account {

bytes account_name = 1;
AccountType type = 2;
// the create adress
// the create address
bytes address = 3;
// the trx balance
int64 balance = 4;
Expand All @@ -51,16 +51,14 @@ message Account {
// the other asset owned by this account
map<string, int64> asset = 6;
// latest asset operation time
map<string, int64> latest_asset_operation_time = 18;
// the frozen balance
repeated Frozen frozen = 7;
// bandwidth, get from frozen
int64 bandwidth = 8;
int64 net_usage = 8;
// this account create time
int64 create_time = 9;
// this last opration time, including transfer, voting and so on.
// this last operation time, including transfer, voting and so on. //FIXME fix grammar
int64 latest_opration_time = 10;

// witness block producing allowance
int64 allowance = 11;
// last withdraw time
Expand All @@ -73,14 +71,20 @@ message Account {
repeated Frozen frozen_supply = 16;
// asset_issued_name
bytes asset_issued_name = 17;
map<string, int64> latest_asset_operation_time = 18;
int64 free_net_usage = 19;
map<string, int64> free_asset_net_usage = 20;
int64 latest_consume_time = 21;
int64 latest_consume_free_time = 22;
}

//FIXME authority?
message acuthrity {
AccountId account = 1;
bytes permission_name = 2;
}


//FIXME permission
message permision {
AccountId account = 1;
}
Expand All @@ -98,6 +102,7 @@ message Witness {
bool isJobs = 9;
}


// Vote Change
message Votes {
bytes address = 1;
Expand Down Expand Up @@ -145,6 +150,7 @@ message Transaction {
UnfreezeBalanceContract = 12;
WithdrawBalanceContract = 13;
UnfreezeAssetContract = 14;
UpdateAssetContract = 15;
CustomContract = 20;
}
ContractType type = 1;
Expand All @@ -168,7 +174,7 @@ message Transaction {
int64 ref_block_num = 3;
bytes ref_block_hash = 4;
int64 expiration = 8;
repeated acuthrity auths = 9;
repeated acuthrity auths = 9; //FIXME authority
// data not used
bytes data = 10;
//only support size = 1, repeated list here for extenstion
Expand All @@ -184,6 +190,10 @@ message Transaction {
repeated Result ret = 5;
}

message Transactions {
repeated Transaction transactions = 1;
}

message BlockHeader {
message raw {
int64 timestamp = 1;
Expand Down Expand Up @@ -289,7 +299,15 @@ message DisconnectMessage {
}

message HelloMessage {
message BlockId {
bytes hash = 1;
int64 number = 2;
}

Endpoint from = 1;
int32 version = 2;
int64 timestamp = 3;
BlockId genesisBlockId = 4;
BlockId solidBlockId = 5;
BlockId headBlockId = 6;
}

0 comments on commit 2998ca9

Please sign in to comment.