Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test case for market_history plugin #1661

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft

Add a test case for market_history plugin #1661

wants to merge 6 commits into from

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Mar 18, 2019

Thanks to @jmjatlanta for working on #1277 and #1627. The test case is useful, IMHO it should be merged after fixed performance issues.

@abitmore abitmore added this to the Future Feature Release milestone Mar 18, 2019
op.issuer = committee_account;
op.new_feed_producers = { committee_account, alice.id, bob.id };
trx.operations.push_back( op );
sign( trx, private_key );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better performance (here and other code in this PR), no need to sign the transactions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signing removed. Test now takes ~23 secs to run on my machine.

Copy link
Member Author

@abitmore abitmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// a function to transmit a transaction
auto transmit_tx = [this, alice, bob, alice_private_key, bob_private_key](const simple_tx& tx) {
const auto seller_private_key = ( tx.from.id == alice.id ? alice_private_key : bob_private_key );
const auto buyer_private_key = ( tx.from.id == alice.id ? bob_private_key : alice_private_key );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables can be removed.

PUSH_TX( db, trx, ~0 );
generate_block();
trx.clear();
publish_feed( committee_account, asset_id_type(), 2, usd.id, 1, asset_id_type() );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After generated a block, the usd object would become unusable. The same for following code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants