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

Commit

Permalink
refactor the transaction structure
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohong committed Apr 24, 2018
1 parent d139597 commit 335f89d
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions core/Tron.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,35 @@ enum AccountType {
Contract = 2;
}

// AccountId, (name, address) use name, (null, address) use address, (name, null) use name,
message AccountId {
bytes name = 1;
bytes address = 2;
}

// Account
message Account {
message Vote {
bytes vote_address = 1;
int64 vote_count = 2;
}

bytes account_name = 1;
AccountType type = 2;
// the create adress
bytes address = 3;
int64 balance = 4;
repeated Vote votes = 5;
map<string, int64> asset = 6;
int64 create_time = 9;
int64 latest_opration_time = 10;
bytes code = 13;
}


message permision {
AccountId account = 1;

}

// Witness
Expand Down Expand Up @@ -65,6 +81,7 @@ message TXOutputs {
repeated TXOutput outputs = 1;
}


message Transaction {
enum TransactionType {
UtxoType = 0;
Expand All @@ -82,9 +99,13 @@ message Transaction {
DeployContract = 7;
WitnessUpdateContract = 8;
ParticipateAssetIssueContract = 9;
CustomContract = 20;
}
ContractType type = 1;
google.protobuf.Any parameter = 2;
bytes provider = 3;
bytes ContractName = 4;

}

message Result {
Expand All @@ -95,18 +116,18 @@ message Transaction {
int64 fee = 1;
code ret = 2;
}

message raw {
TransactionType type = 1;
int64 ref_block_num = 3;
bytes ref_block_hash = 4;
int64 expiration = 8;
// data not used
bytes data = 10;
repeated Contract contract = 11;
// scripts not used
bytes scripts = 12;
int64 timestamp = 14;
}

raw raw_data = 1;
repeated bytes signature = 2;
repeated Result ret = 5;
Expand Down

0 comments on commit 335f89d

Please sign in to comment.