-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Splitting epoch concepts in to their own class. * Holding reference to ledger for is_epoch_link check. * Removing parameterization of epoch link/signer. * Encapsulating epoch_signer * Encapsulating epoch_link. * Encapsulating epoch data in its own class. * Moving epochs in to ledger constants. * Reworking epochs::signer function to use nano::epoch. * Allow there to be multiple epochs. * Removing unused parameter. * Eliminate extra account_info_get and confirmation_height_exists check for each change_latest call. * Encapsulating account_info::epoch * Formatting. * Fix compile error within #define. * Fixing epoch call sites in other targets. * Fixing some unused variable warnings. * Removing epoch_2 enum which isn't yet used. * Adding epoch hash specialization.
- Loading branch information
Showing
28 changed files
with
269 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include <nano/secure/common.hpp> | ||
#include <nano/secure/epoch.hpp> | ||
|
||
TEST (epochs, is_epoch_link) | ||
{ | ||
nano::epochs epochs; | ||
nano::keypair key1; | ||
nano::keypair key2; | ||
ASSERT_FALSE (epochs.is_epoch_link (42)); | ||
ASSERT_FALSE (epochs.is_epoch_link (43)); | ||
epochs.add (nano::epoch::epoch_1, key1.pub, 42); | ||
ASSERT_TRUE (epochs.is_epoch_link (42)); | ||
ASSERT_FALSE (epochs.is_epoch_link (43)); | ||
/*epochs.add (nano::epoch::epoch_2, key2.pub, 43); | ||
ASSERT_TRUE (epochs.is_epoch_link (43)); | ||
ASSERT_EQ (key1.pub, epochs.signer (nano::epoch::epoch_1)); | ||
ASSERT_EQ (key2.pub, epochs.signer (nano::epoch::epoch_2)); | ||
ASSERT_EQ (nano::uint256_union (42), epochs.link (nano::epoch::epoch_1)); | ||
ASSERT_EQ (nano::uint256_union (43), epochs.link (nano::epoch::epoch_2));*/ | ||
} |
Oops, something went wrong.