-
Notifications
You must be signed in to change notification settings - Fork 648
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
base: develop
Are you sure you want to change the base?
Conversation
tests/tests/history_api_tests.cpp
Outdated
op.issuer = committee_account; | ||
op.new_feed_producers = { committee_account, alice.id, bob.id }; | ||
trx.operations.push_back( op ); | ||
sign( trx, private_key ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 ); |
There was a problem hiding this comment.
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() ); |
There was a problem hiding this comment.
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.
Thanks to @jmjatlanta for working on #1277 and #1627. The test case is useful, IMHO it should be merged after fixed performance issues.