-
Notifications
You must be signed in to change notification settings - Fork 458
Implement genesis block creation and validation function in lisk-genesis - Closes #5277, #5386 #5421
Conversation
|
||
export type GenesisBlockHeaderWithoutId = Omit<GenesisBlockHeader, 'id'>; | ||
|
||
export interface GenesisBlock { |
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 this, you can use Block<GenesisBlockHeaderAsset>
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.
It's not possible, as we want genesis block to fixed type as an empty array. If used as Block we have to declare payload as an empty array of BaseTransaction
const transactionRoot = GB_TRANSACTION_ROOT; | ||
|
||
const accounts: ReadonlyArray<GenesisAccountState> = params.accounts | ||
.map(acc => new Account(acc)) |
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.
do you need to change this to instance here?
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.
Otherwise, we have to specify full account type and also duplicate code to convert the partial account to a full account attributes. Then we have to add another dependency of lisk-transactions
@shuse2 @ishantiw Interesting part of the code change to review will be https://github.com/LiskHQ/lisk-sdk/pull/5421/files#diff-a9077ad359351fde5b4b05d4551fce86 |
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.
LGTM, very minor comment but approved from my end
What was the problem?
This PR resolves ##5277, resolved #5386
How was it solved?
Created new functions for creating and validating genesis block
How was it tested?
Run all tests for
lisk-genesis