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

fix(ref-imp): make bitcoin logic make less calls to db #906

Merged
merged 7 commits into from
Oct 30, 2020

Conversation

isaacJChen
Copy link
Contributor

No description provided.

@@ -309,13 +309,13 @@ describe('BitcoinProcessor', () => {
describe('transactions', () => {
it('should get transactions since genesis capped by page size in blocks', async (done) => {
const verifyMock = spyOn(bitcoinProcessor, 'verifyBlock' as any).and.returnValue(Promise.resolve(true));
// return as many as page size
const transactions: TransactionModel[] = createTransactions(BitcoinProcessor['pageSizeInBlocks'], bitcoinProcessor['genesisBlockNumber'], true);
bitcoinProcessor['lastProcessedBlock'] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sanity: the test is getting transaction since genesis, so shouldn't lastProcessedBlock be undefined?

Copy link
Contributor Author

@isaacJChen isaacJChen Oct 30, 2020

Choose a reason for hiding this comment

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

This is simulating the caller trying to get transactions since genesis (genesis to genesis + 99), and bitcoin's last Processed block is genesis + 100

@isaacJChen isaacJChen merged commit 175b5f7 into master Oct 30, 2020
@thehenrytsai thehenrytsai deleted the ische/improveBitcoinLogic branch July 16, 2021 19:01
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