diff --git a/api/api.proto b/api/api.proto index e1dc83a23..95871f5aa 100644 --- a/api/api.proto +++ b/api/api.proto @@ -42,7 +42,7 @@ service Wallet { }; rpc GetAccountBalance (AccountBalanceRequest) returns (AccountBalanceResponse) { - option (google.api.http) = { + option (google.api.http) = { post: "/wallet/getaccountbalance" body: "*" additional_bindings { @@ -480,6 +480,9 @@ service Wallet { rpc TriggerConstantContract (TriggerSmartContract) returns (TransactionExtention) { } + rpc EstimateEnergy (TriggerSmartContract) returns (EstimateEnergyMessage) { + } + rpc ClearContractABI (ClearABIContract) returns (TransactionExtention) { } @@ -1009,6 +1012,9 @@ service WalletSolidity { rpc TriggerConstantContract (TriggerSmartContract) returns (TransactionExtention) { } + rpc EstimateEnergy (TriggerSmartContract) returns (EstimateEnergyMessage) { + } + rpc GetTransactionInfoByBlockNum (NumberMessage) returns (TransactionInfoList) { } @@ -1310,6 +1316,12 @@ message TransactionExtention { int64 energy_used = 5; repeated TransactionInfo.Log logs = 6; repeated InternalTransaction internal_transactions = 7; + int64 energy_penalty = 8; +} + +message EstimateEnergyMessage { + Return result = 1; + int64 energy_required = 2; } message BlockExtention { diff --git a/core/Tron.proto b/core/Tron.proto index 6458049c7..e6aac408f 100644 --- a/core/Tron.proto +++ b/core/Tron.proto @@ -321,6 +321,7 @@ message ResourceReceipt { int64 net_usage = 5; int64 net_fee = 6; Transaction.Result.contractResult result = 7; + int64 energy_penalty_total = 8; } message MarketOrderDetail { @@ -580,7 +581,7 @@ enum ReasonCode { TOO_MANY_PEERS = 0x04; DUPLICATE_PEER = 0x05; INCOMPATIBLE_PROTOCOL = 0x06; - NULL_IDENTITY = 0x07; + RANDOM_ELIMINATION = 0x07; PEER_QUITING = 0x08; UNEXPECTED_IDENTITY = 0x09; LOCAL_IDENTITY = 0x0A; diff --git a/core/contract/smart_contract.proto b/core/contract/smart_contract.proto index 4e9a70aae..84598edd0 100644 --- a/core/contract/smart_contract.proto +++ b/core/contract/smart_contract.proto @@ -55,6 +55,13 @@ message SmartContract { int64 origin_energy_limit = 8; bytes code_hash = 9; bytes trx_hash = 10; + int32 version = 11; +} + +message ContractState { + int64 energy_usage = 1; + int64 energy_factor = 2; + int64 update_cycle = 3; } message CreateSmartContract { @@ -93,4 +100,5 @@ message UpdateEnergyLimitContract { message SmartContractDataWrapper { SmartContract smart_contract = 1; bytes runtimecode = 2; + ContractState contract_state = 3; }