Skip to content

Commit

Permalink
Updated IBC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
systemzax committed Jul 26, 2024
1 parent 0148913 commit b4cb8e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions unittests/svnn_ibc_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -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 )
Expand Down Expand Up @@ -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)
)
Expand Down
8 changes: 4 additions & 4 deletions unittests/test-contracts/savanna/common/savanna.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ namespace savanna {

//finalizer_policy_generation for this block
uint32_t active_finalizer_policy_generation;
std::optional<uint32_t> pending_finalizer_policy_generation;
std::optional<uint32_t> last_pending_finalizer_policy_generation;

//Allows the contract to obtain knowledge about them and to record them in its internal state.
std::optional<finalizer_policy_input> new_finalizer_policy;
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unittests/test-contracts/savanna/ibc/ibc.abi
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"type": "uint32"
},
{
"name": "pending_finalizer_policy_generation",
"name": "last_pending_finalizer_policy_generation",
"type": "uint32?"
},
{
Expand Down

0 comments on commit b4cb8e7

Please sign in to comment.