Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,21 @@ struct txn_test_gen_plugin_impl {
{
signed_transaction trx;
abi_serializer currency_serializer(currency_abi_def);


{
action act;
act.account = N(currency);
act.name = N(create);
act.authorization = vector<permission_level>{{newaccountC,config::active_name}};
act.data = currency_serializer.variant_to_binary("create", fc::json::from_string("{\"issuer\":\"currency\",\"maximum_supply\":\"1000000000.0000 CUR\", \"can_freeze\":0, \"can_recall\":0, \"can_whitelist\":0}}"));
trx.actions.push_back(act);
}
{
action act;
act.account = N(currency);
act.name = N(issue);
act.authorization = vector<permission_level>{{newaccountC,config::active_name}};
act.data = currency_serializer.variant_to_binary("issue", fc::json::from_string("{\"to\":\"currency\",\"quantity\":\"600.0000 CUR\"}"));
act.data = currency_serializer.variant_to_binary("issue", fc::json::from_string("{\"to\":\"currency\",\"quantity\":\"600.0000 CUR\",\"memo\":\"\"}"));
trx.actions.push_back(act);
}
{
Expand Down Expand Up @@ -243,13 +251,13 @@ struct txn_test_gen_plugin_impl {
fc::crypto::private_key a_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'a')));
fc::crypto::private_key b_priv_key = fc::crypto::private_key::regenerate(fc::sha256(std::string(64, 'b')));

static uint64_t nonce;
static uint64_t nonce = 0;

for(unsigned int i = 0; i < batch; ++i) {
{
signed_transaction trx;
trx.actions.push_back(act_a_to_b);
trx.actions.emplace_back(action({}, config::system_account_name, "nonce", fc::raw::pack(nonce)));
trx.context_free_actions.emplace_back(action({}, config::system_account_name, "nonce", fc::raw::pack(nonce++)));
trx.set_reference_block(cc.head_block_id());
trx.expiration = cc.head_block_time() + fc::seconds(30);
trx.sign(a_priv_key, chainid);
Expand All @@ -259,7 +267,7 @@ struct txn_test_gen_plugin_impl {
{
signed_transaction trx;
trx.actions.push_back(act_b_to_a);
trx.actions.emplace_back(action({}, config::system_account_name, "nonce", fc::raw::pack(nonce)));
trx.context_free_actions.emplace_back(action({}, config::system_account_name, "nonce", fc::raw::pack(nonce++)));
trx.set_reference_block(cc.head_block_id());
trx.expiration = cc.head_block_time() + fc::seconds(30);
trx.sign(b_priv_key, chainid);
Expand Down
3 changes: 2 additions & 1 deletion programs/nodeos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <eosio/chain_plugin/chain_plugin.hpp>
#include <eosio/http_plugin/http_plugin.hpp>
#include <eosio/net_plugin/net_plugin.hpp>
#include <eosio/txn_test_gen_plugin/txn_test_gen_plugin.hpp>

#include <fc/log/logger_config.hpp>
#include <fc/log/appender.hpp>
Expand Down Expand Up @@ -104,7 +105,7 @@ int main(int argc, char** argv)
bfs::path root = determine_root_directory();
app().set_default_data_dir(root / "var/lib/eosio/node_00");
app().set_default_config_dir(root / "etc/eosio/node_00");
if(!app().initialize<chain_plugin, http_plugin, net_plugin>(argc, argv))
if(!app().initialize<chain_plugin, http_plugin, net_plugin, txn_test_gen_plugin>(argc, argv))
return -1;
initialize_logging();
ilog("nodeos version ${ver}", ("ver", eosio::nodeos::config::itoh(static_cast<uint32_t>(app().version()))));
Expand Down