Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Merge Feature/6930 implement poa module to development #8789

Merged
merged 20 commits into from
Aug 1, 2023

Conversation

ishantiw
Copy link
Contributor

@ishantiw ishantiw commented Jul 31, 2023

What was the problem?

This PR resolves #6930

How was it solved?

How was it tested?

Phanco and others added 15 commits July 31, 2023 17:34
* Bootstrap PoA files and folders

* Update method names on module.ts

* Replace .keep to index.ts for folders

* Add bootstrap test file

* Rename internal method to PoAInternalMethod
* Bootstrap PoA files and folders

* Update method names on module.ts

* Replace .keep to index.ts for folders

* Add bootstrap test file

* Create events and register of the said event

* Update enum name
* 🌱 Initialize stores

* ♻️  Update names and register stores

* 💅 Rename snapshotStoreSchema->snapshotSchema
* Define genesis PoA store schema & relevant types

* `length' replaced with `minLength` & `maxLength`

* Add missing $id
* Implement Register Authority Commands

* Renaming Commands

* Remove extra files

* Added Unit Test for RegisterAuthority

* Put types back to PoA

* Update code according to PR review and comments

* Update chainID in test case to match with actual format

* Update param names to be grammar-correct

* Update AUTHORITY_REGISTRATION_FEE comments and test unit imports

* Update $id for updateAuthority Schema

* Change name of updateAuthoritySchema
* 🌱 Implement afterTransactionsExecute and _shuffleValidatorsList

* ✅ Add unit tests for afterTransactionsExecute and shuffleValidatorList

* ♻️ Use constants and simplify shuffleValidatorList

* ✅ Adjust expectation setValidatorsParams to expect secondSnapshot threshold

* 💅🏻 Rename snapshot keys

* ♻️ Add missing logic and improve logic for afterTransactionsExecute

* 💅🏻 Assert type on the arguments for readability

* ♻️Naming issues and refine loop in test
* Implement Register Authority Commands

* Renaming Commands

* Remove extra files

* Added Unit Test for RegisterAuthority

* Put types back to PoA

* Update code according to PR review and comments

* Update chainID in test case to match with actual format

* Update param names to be grammar-correct

* Update AUTHORITY_REGISTRATION_FEE comments and test unit imports

* Update $id for updateAuthority Schema

* Implement Update Authority and Test Cases

* Change name of updateAuthoritySchema

* Update updateAuthoritySchema naming

* Update update authority coding according to PR comments

* Edited Buffer bits and test cases captions

* Update cosmetic change on update_authority files

* Add comments and better error message to UpdateAuthorityCommand

* Minor changes to error message captions

* Update error message caption
* Implement Register Authority Commands

* Renaming Commands

* Remove extra files

* Added Unit Test for RegisterAuthority

* Put types back to PoA

* Update code according to PR review and comments

* Update chainID in test case to match with actual format

* Update param names to be grammar-correct

* Update AUTHORITY_REGISTRATION_FEE comments and test unit imports

* Update $id for updateAuthority Schema

* Implement Update Authority and Test Cases

* Change name of updateAuthoritySchema

* Implement UpdateGeneratorKey and Test Cases

* Update updateAuthoritySchema naming

* Update update authority coding according to PR comments

* Edited Buffer bits and test cases captions

* Update cosmetic change on update_authority files

* Update UpdateGeneratorKeyCommand to use senderAddress

* Add comments and better error message to UpdateAuthorityCommand

* Minor changes to error message captions

* Update error message caption

---------

Co-authored-by: !shan <[email protected]>
* Add PoA constants, schemas and types

* Implement proof of authority genesis initialization

* Update error messages in poa module initGenesis

* Export types and fix snapshotstore type

* Implement tests for poa genesis initialization

* Remove unused validators from test

* Update snapshot storage

* Implement finalizeGenesisState

* Update lint no-console place holder

---------

Co-authored-by: Mitsuaki Uchimoto <[email protected]>
* Implement PoA module endpoints

* Add getRegistrationFee endpoint

---------

Co-authored-by: Mitsuaki Uchimoto <[email protected]>
* ♻️  Resolve dependencies and add configurable constant

* ♻️  Use authorityRegistrationFee in endpoint and fix test
Expose Commands on PoA
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #8789 (bea5fa6) into development (fc4e20e) will increase coverage by 0.18%.
The diff coverage is 94.30%.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #8789      +/-   ##
===============================================
+ Coverage        83.39%   83.57%   +0.18%     
===============================================
  Files              593      610      +17     
  Lines            22289    22675     +386     
  Branches          3286     3317      +31     
===============================================
+ Hits             18587    18951     +364     
- Misses            3702     3724      +22     
Files Changed Coverage Δ
framework/src/modules/poa/internal_method.ts 0.00% <0.00%> (ø)
...k/src/modules/poa/commands/update_generator_key.ts 86.95% <86.95%> (ø)
...ework/src/modules/poa/commands/update_authority.ts 90.47% <90.47%> (ø)
...ork/src/modules/poa/commands/register_authority.ts 92.10% <92.10%> (ø)
framework/src/modules/poa/utils.ts 92.30% <92.30%> (ø)
framework/src/modules/poa/endpoint.ts 93.61% <93.61%> (ø)
framework/src/modules/poa/module.ts 96.89% <96.89%> (ø)
framework/src/index.ts 100.00% <100.00%> (ø)
framework/src/modules/poa/constants.ts 100.00% <100.00%> (ø)
...amework/src/modules/poa/events/authority_update.ts 100.00% <100.00%> (ø)
... and 8 more

Phanco and others added 4 commits July 31, 2023 17:35
* Add PoA example

* Update PoA Genesis

* Update README and remove uncessary genesis json

* Update application.ts to accept PoS and PoA

* Add Reward Module to PoA

* Renaming poa to sidechain

* Revert application.ts

* Move setValidatorsParams to under registerValidatorKeys

* Register module inside the PoA

* Add RewardModule and revert module.ts (Changes in separate PR)

* Add sign scripts for updateAuthority.ts

* Update yarn.lock
* Update getAllValidators Endpoint

* Update test cases for poa_getAllValidators

* Sort response by name on getAllValidators function

* Update PoA test cases

* Update code per PR comments

---------

Co-authored-by: Khalid Hameed <[email protected]>
@ishantiw ishantiw force-pushed the feature/6930-implement-poa-module branch from 372bae0 to 058cebd Compare July 31, 2023 17:54
@ishantiw ishantiw requested a review from shuse2 July 31, 2023 17:57
@ishantiw ishantiw merged commit dedbc5d into development Aug 1, 2023
12 checks passed
@shuse2 shuse2 deleted the feature/6930-implement-poa-module branch September 28, 2023 20:57
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.

Introduce PoA module
5 participants