Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Remove Blockchain dependency from GetBlockHeadersMessageHandler and GetBlocksMessageHandler #434

Closed
aboimpinto opened this issue Sep 23, 2018 · 0 comments

Comments

@aboimpinto
Copy link
Contributor

This dependency is because to process the BlockHeader the access to the repository is need and the methods that access the repository are in the Blockchain class.

Blockchain class should be the maestro of the synchronization and initializing it.

Smaler classes with more specific behavior should be responsible for the retrieve of the data like: BlockModel, TransactionModel
this objects should have the access to IRepository and not the blockchain that has a high-level responsibility.

@aboimpinto aboimpinto changed the title Remove Blockchain dependency from GetBlockHeadersMessageHandler Remove Blockchain dependency from GetBlockHeadersMessageHandler and GetBlocksMessageHandler Sep 23, 2018
aboimpinto added a commit to aboimpinto/neo-sharp that referenced this issue Sep 28, 2018
osmirnov pushed a commit that referenced this issue Sep 29, 2018
…r references (#449)

* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository
osmirnov pushed a commit that referenced this issue Sep 29, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.
shargon pushed a commit that referenced this issue Oct 1, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.
shargon pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fix: when retrieve from RedisDb the convertion from string to hash if fixed.

* Update ECPoint.cs

* Real Infinity
shargon pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* update NEO-privnet settings

* add the verification point.Length == 0

* Update ECPoint.cs
shargon pushed a commit that referenced this issue Oct 3, 2018
… was not correct and fix unit tests (#469)

* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs
gubanotorious pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* projects to be extract from code added to the solution

* Cryptography and one extension method extracted from core that going to be shared.

* Formating classes in Core\Cryptography

* extract Types and Cryptography from core

* Fix unit tests, loading the new types assembly for deserialization
osmirnov pushed a commit that referenced this issue Oct 4, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs

* Cleanup BlockHeerPersister and BlockPersister.
Code is cleaner and with less dependencies.
Remove if statetements, rename methods, remove event and inject BlockchainContext
osmirnov pushed a commit that referenced this issue Oct 5, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs

* Cleanup BlockHeerPersister and BlockPersister.
Code is cleaner and with less dependencies.
Remove if statetements, rename methods, remove event and inject BlockchainContext

* Add UtBlockHeaderPersister and remove the block header validation to another class making the persister code smaller and cleaner.

#480
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant