CityOfZion / neo-sharp

Neo-sharp is a new core and node implementation of NEO focused on modular design, best coding practices and testability.
MIT License
35 stars 24 forks source link

StackAccessor as example #553

Closed osmirnov closed 5 years ago

osmirnov commented 5 years ago

@shargon I've PRed this to discuss the design with you. I like how:

  1. RegisterStackTransition allows us not to check the context in every function.
  2. StackAccessor simplified casting of StackItems to primitive types.
  3. StackAccessor allows checking for null result not to use TryPop output parameter along with the boolean result.

What do you think we can use to enhance original Stack? I am not planning to leave StackAccessor but like its features and impact.

codecov[bot] commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (development@de34b01). Click here to learn what that means. The diff coverage is 0.73%.

Impacted file tree graph

@@              Coverage Diff               @@
##             development     #553   +/-   ##
==============================================
  Coverage               ?   44.35%           
==============================================
  Files                  ?      356           
  Lines                  ?    16070           
  Branches               ?        0           
==============================================
  Hits                   ?     7128           
  Misses                 ?     8942           
  Partials               ?        0
Impacted Files Coverage Δ
...Application/Controllers/PromptNetworkController.cs 0% <ø> (ø)
...Application/Controllers/PromptInvokesController.cs 0% <0%> (ø)
...p.Application/Controllers/PromptDebugController.cs 0% <0%> (ø)
src/NeoSharp.VM/StackItems/ArrayStackItemBase.cs 0% <0%> (ø)
src/NeoSharp.Core/VM/StackAccessor.cs 0% <0%> (ø)
src/NeoSharp.VM/ExecutionEngineBase.cs 73.33% <0%> (ø)
src/NeoSharp.Core/VM/StateReader.cs 0% <0%> (ø)
src/NeoSharp.Core/VM/InteropServiceExtensions.cs 0% <0%> (ø)
...pplication/Controllers/PromptContractController.cs 0% <0%> (ø)
src/NeoSharp.Core/VM/StateMachine.cs 0% <0%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update de34b01...ab6081c. Read the comment docs.