From b4cb8e7146fa535f04dc0494a8f90f7757cfe589 Mon Sep 17 00:00:00 2001 From: Guillaume Babin-Tremblay Date: Thu, 25 Jul 2024 19:06:34 -0600 Subject: [PATCH] Updated IBC tests --- unittests/svnn_ibc_tests.cpp | 6 +++--- unittests/test-contracts/savanna/common/savanna.hpp | 8 ++++---- unittests/test-contracts/savanna/ibc/ibc.abi | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unittests/svnn_ibc_tests.cpp b/unittests/svnn_ibc_tests.cpp index f318c4da73..3d8dba6e1b 100644 --- a/unittests/svnn_ibc_tests.cpp +++ b/unittests/svnn_ibc_tests.cpp @@ -494,7 +494,7 @@ BOOST_AUTO_TEST_SUITE(svnn_ibc) ("major_version", 1) ("minor_version", 0) ("active_finalizer_policy_generation", 1) - ("pending_finalizer_policy_generation", 2) + ("last_pending_finalizer_policy_generation", 2) ("witness_hash", block_11_result.level_2_commitments_digest) ("finality_mroot", block_11_result.finality_root) ) @@ -511,7 +511,7 @@ BOOST_AUTO_TEST_SUITE(svnn_ibc) ("major_version", 1) ("minor_version", 0) ("active_finalizer_policy_generation", 1) - ("pending_finalizer_policy_generation", 2) + ("last_pending_finalizer_policy_generation", 2) ("new_finalizer_policy", cluster.last_pending_finalizer_policy) ("witness_hash", block_10_result.level_3_commitments_digest) ("last_pending_finalizer_policy_start_num", block_10_result.last_pending_finalizer_policy_start_num ) @@ -560,7 +560,7 @@ BOOST_AUTO_TEST_SUITE(svnn_ibc) ("major_version", 1) ("minor_version", 0) ("active_finalizer_policy_generation", 1) - ("pending_finalizer_policy_generation", 2) + ("last_pending_finalizer_policy_generation", 2) ("witness_hash", block_11_result.level_2_commitments_digest) ("finality_mroot", block_11_result.finality_root) ) diff --git a/unittests/test-contracts/savanna/common/savanna.hpp b/unittests/test-contracts/savanna/common/savanna.hpp index adc2cbe981..11c1b9f35e 100644 --- a/unittests/test-contracts/savanna/common/savanna.hpp +++ b/unittests/test-contracts/savanna/common/savanna.hpp @@ -297,7 +297,7 @@ namespace savanna { //finalizer_policy_generation for this block uint32_t active_finalizer_policy_generation; - std::optional pending_finalizer_policy_generation; + std::optional last_pending_finalizer_policy_generation; //Allows the contract to obtain knowledge about them and to record them in its internal state. std::optional new_finalizer_policy; @@ -344,11 +344,11 @@ namespace savanna { //internal representation of finality data struct block_finality_data_internal : block_finality_data { checksum256 resolved_witness_hash; - uint32_t pending_finalizer_policy_generation = 0; + uint32_t last_pending_finalizer_policy_generation = 0; block_finality_data_internal(const block_finality_data& base) : block_finality_data(base){ resolved_witness_hash = base.resolve_witness(); - pending_finalizer_policy_generation = base.pending_finalizer_policy_generation.has_value() ? base.pending_finalizer_policy_generation.value() : active_finalizer_policy_generation; + last_pending_finalizer_policy_generation = base.last_pending_finalizer_policy_generation.has_value() ? base.last_pending_finalizer_policy_generation.value() : active_finalizer_policy_generation; } checksum256 finality_digest() const { @@ -357,7 +357,7 @@ namespace savanna { return hash; } - EOSLIB_SERIALIZE(block_finality_data_internal, (major_version)(minor_version)(active_finalizer_policy_generation)(pending_finalizer_policy_generation)(finality_mroot)(resolved_witness_hash)) + EOSLIB_SERIALIZE(block_finality_data_internal, (major_version)(minor_version)(active_finalizer_policy_generation)(last_pending_finalizer_policy_generation)(finality_mroot)(resolved_witness_hash)) }; //used in "heavy" proofs, where verification of finality digest is performed diff --git a/unittests/test-contracts/savanna/ibc/ibc.abi b/unittests/test-contracts/savanna/ibc/ibc.abi index 85e3545a5e..7a3349600d 100644 --- a/unittests/test-contracts/savanna/ibc/ibc.abi +++ b/unittests/test-contracts/savanna/ibc/ibc.abi @@ -101,7 +101,7 @@ "type": "uint32" }, { - "name": "pending_finalizer_policy_generation", + "name": "last_pending_finalizer_policy_generation", "type": "uint32?" }, {