Skip to content

Commit

Permalink
Add contract nonces related fields (#257)
Browse files Browse the repository at this point in the history
* Add virtual addresses nonce related fields
* Update the definition of contract nonces from map to a list of ContractNonceInfo
* Add description for new fields
* Update VirtualAddress info to be with flat structure
* Address more comments
* Remove virtual addresses related changes
* Restore crypto_get_info.proto
* Move ContractNonceInfo to contract_call_local.proto
* Fix indentation of comments
* Add suggested comment
* Move ContractNonceInfo to a new contract_types.proto file

Signed-off-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech>
Signed-off-by: Miroslav Gatsanoga <miroslav.gatsanoga@limechain.tech>
Signed-off-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech>
Co-authored-by: Stoyan Panayotov <stoyan.panayotov@limechain.tech>
  • Loading branch information
MiroslavGatsanoga and stoqnkpL committed May 31, 2023
1 parent c890b32 commit c1de1a1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions services/contract_call_local.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option java_multiple_files = true;
import "basic_types.proto";
import "query_header.proto";
import "response_header.proto";
import "contract_types.proto";

import "google/protobuf/wrappers.proto";

Expand Down Expand Up @@ -162,6 +163,12 @@ message ContractFunctionResult {
* ContractCreateTransactionBody or a ContractCallTransactionBody.
*/
AccountID sender_id = 13;

/**
* A list of updated contract account nonces containing the new nonce value for each contract account.
* This is always empty in a ContractCallLocalResponse#ContractFunctionResult message, since no internal creations can happen in a static EVM call.
*/
repeated ContractNonceInfo contract_nonces = 14;
}

/**
Expand Down
47 changes: 47 additions & 0 deletions services/contract_types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
syntax = "proto3";

package proto;

/*-
* ‌
* Hedera Network Services Protobuf
* ​
* Copyright (C) 2018 - 2023 Hedera Hashgraph, LLC
* ​
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ‍
*/

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.contract">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "basic_types.proto";

import "google/protobuf/wrappers.proto";
/**
* Info about a contract account's nonce value.
* A nonce of a contract is only incremented when that contract creates another contract.
*/
message ContractNonceInfo {

/**
* Id of the contract
*/
ContractID contract_id = 1;

/**
* The current value of the contract account's nonce property
*/
int64 nonce = 2;
}

0 comments on commit c1de1a1

Please sign in to comment.