Improve QT wallet.seed_work_generation test (#1732)
This commit is contained in:
parent
b78941aec1
commit
2aab2713c1
1 changed files with 7 additions and 10 deletions
|
|
@ -702,26 +702,23 @@ TEST (wallet, seed_work_generation)
|
||||||
QTest::mouseClick (wallet->accounts.import_wallet, Qt::LeftButton);
|
QTest::mouseClick (wallet->accounts.import_wallet, Qt::LeftButton);
|
||||||
ASSERT_EQ (wallet->import.window, wallet->main_stack->currentWidget ());
|
ASSERT_EQ (wallet->import.window, wallet->main_stack->currentWidget ());
|
||||||
nano::raw_key seed;
|
nano::raw_key seed;
|
||||||
seed.data.clear ();
|
nano::uint256_union prv;
|
||||||
|
nano::deterministic_key (seed.data, 0, prv);
|
||||||
|
nano::uint256_union pub (nano::pub_key (prv));
|
||||||
QTest::keyClicks (wallet->import.seed, seed.data.to_string ().c_str ());
|
QTest::keyClicks (wallet->import.seed, seed.data.to_string ().c_str ());
|
||||||
QTest::keyClicks (wallet->import.clear_line, "clear keys");
|
QTest::keyClicks (wallet->import.clear_line, "clear keys");
|
||||||
uint64_t work_start;
|
uint64_t work (0);
|
||||||
{
|
|
||||||
auto transaction (system.wallet (0)->wallets.tx_begin ());
|
|
||||||
system.wallet (0)->store.work_get (transaction, key1, work_start);
|
|
||||||
}
|
|
||||||
uint64_t work (work_start);
|
|
||||||
QTest::mouseClick (wallet->import.import_seed, Qt::LeftButton);
|
QTest::mouseClick (wallet->import.import_seed, Qt::LeftButton);
|
||||||
system.deadline_set (10s);
|
system.deadline_set (10s);
|
||||||
while (work == work_start)
|
while (work == 0)
|
||||||
{
|
{
|
||||||
auto ec = system.poll ();
|
auto ec = system.poll ();
|
||||||
auto transaction (system.wallet (0)->wallets.tx_begin ());
|
auto transaction (system.wallet (0)->wallets.tx_begin ());
|
||||||
system.wallet (0)->store.work_get (transaction, key1, work);
|
system.wallet (0)->store.work_get (transaction, pub, work);
|
||||||
ASSERT_NO_ERROR (ec);
|
ASSERT_NO_ERROR (ec);
|
||||||
}
|
}
|
||||||
auto transaction (system.nodes[0]->store.tx_begin ());
|
auto transaction (system.nodes[0]->store.tx_begin ());
|
||||||
ASSERT_FALSE (nano::work_validate (system.nodes[0]->ledger.latest_root (transaction, key1), work));
|
ASSERT_FALSE (nano::work_validate (system.nodes[0]->ledger.latest_root (transaction, pub), work));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST (wallet, backup_seed)
|
TEST (wallet, backup_seed)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue