Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PIE-1810] Add read-only blockchain factory method #1845

Merged
merged 3 commits into from
Aug 13, 2019

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Aug 13, 2019

PR description

This PR creates separate factory methods for mutable / immutable versions of DefaultBlockchain. For the read-only, immutable blockchain, we don't require a genesis block to be supplied as long as the blockchain storage is non-empty.

kvStore, new MainnetBlockHeaderFunctions());
}

private DefaultBlockchain createMutableBlockchain(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be DefaultBlockchain or can it simply be Blockchain? i.e. do the tests need methods on DefaultBlockchain or is the type needed for other calls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of the tests access protected methods, so just cast it here for simplicity.

@mbaxter mbaxter merged commit 57f1db4 into PegaSysEng:master Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants