Skip to content

Commit

Permalink
merging v25
Browse files Browse the repository at this point in the history
  • Loading branch information
coranos committed May 26, 2023
1 parent 3c980e8 commit 00ed5ac
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions nano/core_test/processor_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ TEST (processor_service, bad_send_signature)
nano::logger_mt logger;
auto store = nano::make_store (logger, nano::unique_path (), nano::dev::constants);
ASSERT_FALSE (store->init_error ());
nano::stat stats;
nano::stats stats;
nano::ledger ledger (*store, stats, nano::dev::constants);
auto transaction (store->tx_begin_write ());
store->initialize (transaction, ledger.cache, ledger.constants);
nano::work_pool pool{ nano::dev::network_params.network, std::numeric_limits<unsigned>::max () };
nano::account_info info1;
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis_key.pub, info1));
auto info1 = ledger.account_info (transaction, nano::dev::genesis_key.pub);
ASSERT_TRUE (info1);
nano::keypair key2;
nano::block_builder builder;
auto send = builder
.send ()
.previous (info1.head)
.previous (info1->head)
.destination (nano::dev::genesis_key.pub)
.balance (50)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*pool.generate (info1.head))
.work (*pool.generate (info1->head))
.build ();
send->signature.bytes[32] ^= 0x1;
ASSERT_EQ (nano::process_result::bad_signature, ledger.process (transaction, *send).code);
Expand All @@ -38,26 +38,26 @@ TEST (processor_service, bad_receive_signature)
nano::logger_mt logger;
auto store = nano::make_store (logger, nano::unique_path (), nano::dev::constants);
ASSERT_FALSE (store->init_error ());
nano::stat stats;
nano::stats stats;
nano::ledger ledger (*store, stats, nano::dev::constants);
auto transaction (store->tx_begin_write ());
store->initialize (transaction, ledger.cache, ledger.constants);
nano::work_pool pool{ nano::dev::network_params.network, std::numeric_limits<unsigned>::max () };
nano::account_info info1;
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis_key.pub, info1));
auto info1 = ledger.account_info (transaction, nano::dev::genesis_key.pub);
ASSERT_TRUE (info1);
nano::block_builder builder;
auto send = builder
.send ()
.previous (info1.head)
.previous (info1->head)
.destination (nano::dev::genesis_key.pub)
.balance (50)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*pool.generate (info1.head))
.work (*pool.generate (info1->head))
.build ();
nano::block_hash hash1 (send->hash ());
ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, *send).code);
nano::account_info info2;
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis_key.pub, info2));
auto info2 = ledger.account_info (transaction, nano::dev::genesis_key.pub);
ASSERT_TRUE (info2);
auto receive = builder
.receive ()
.previous (hash1)
Expand Down

0 comments on commit 00ed5ac

Please sign in to comment.