Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAction.Render() & IAction.Unrender() #212

Merged
merged 16 commits into from Apr 29, 2019

Conversation

Projects
None yet
3 participants
@dahlia
Copy link
Member

commented Apr 20, 2019

This patch implements a minimum viable subset of the idea I had suggested in #31 (comment).

There are missing behaviors yet; Render() does not guarantee it's called after the action is confirmed in the network (we need to define what “confirmation” means here), etc, for instance. The currently guaranteed attributes are:

  • IAction.Render() and IAction.Unrender() take an equivalent IActionContext object with a clean state (which means its Random state is never consumed) to IAction.Execute() took.
  • If some blocks become “stale,” Unrender() methods of actions in these blocks are invoked in reverse order.
  • For each action, Render() is only once called unless it's stale so that its Unrender() is called.
  • For each action, the number of Unrender() calls is the same to or one less than the number of Render() calls.

@dahlia dahlia added the suggestion label Apr 20, 2019

@dahlia dahlia requested review from longfin and earlbread Apr 20, 2019

@dahlia dahlia self-assigned this Apr 20, 2019

Show resolved Hide resolved Libplanet/Blocks/Block.cs Outdated
Show resolved Hide resolved Libplanet/Tx/Transaction.cs Outdated
Show resolved Hide resolved Libplanet/Tx/Transaction.cs
Show resolved Hide resolved Libplanet/Blockchain/BlockChain.cs Outdated
Show resolved Hide resolved Libplanet.Tests/Blocks/BlockTest.cs Outdated
Show resolved Hide resolved Libplanet.Tests/Blocks/BlockTest.cs Outdated
Show resolved Hide resolved Libplanet.Tests/Common/Action/DumbAction.cs Outdated

@dahlia dahlia force-pushed the dahlia:action-render branch from 4fc6921 to 9db8f48 Apr 26, 2019

dahlia added a commit to dahlia/libplanet that referenced this pull request Apr 26, 2019

dahlia added a commit to dahlia/libplanet that referenced this pull request Apr 26, 2019

dahlia added a commit to dahlia/libplanet that referenced this pull request Apr 26, 2019

@dahlia

This comment has been minimized.

Copy link
Member Author

commented Apr 26, 2019

@earlbread @longfin I rebased this on the current master and addressed review feedback. Could you review this again?

@codecov

This comment has been minimized.

Copy link

commented Apr 26, 2019

Codecov Report

Merging #212 into master will increase coverage by 0.27%.
The diff coverage is 96.06%.

@@            Coverage Diff            @@
##           master    #212      +/-   ##
=========================================
+ Coverage   83.82%   84.1%   +0.27%     
=========================================
  Files          74      75       +1     
  Lines        3407    3492      +85     
=========================================
+ Hits         2856    2937      +81     
- Misses        551     555       +4
Impacted Files Coverage Δ
Libplanet/Net/Swarm.cs 80.58% <100%> (ø) ⬆️
Libplanet/Action/ActionEvaluation.cs 100% <100%> (ø)
Libplanet/Blockchain/BlockChain.cs 98.04% <100%> (+0.3%) ⬆️
Libplanet/Action/PolymorphicAction.cs 96.96% <50%> (-3.04%) ⬇️
Libplanet/Tx/Transaction.cs 93.56% <85%> (-1.28%) ⬇️
Libplanet/Blocks/Block.cs 98.15% <95.45%> (+0.2%) ⬆️

@dahlia dahlia added this to the 0.3.0 milestone Apr 26, 2019

@dahlia dahlia requested review from longfin and earlbread Apr 27, 2019

Show resolved Hide resolved CHANGES.md Outdated

@dahlia dahlia force-pushed the dahlia:action-render branch from 9db8f48 to d7412e4 Apr 27, 2019

@dahlia dahlia requested a review from earlbread Apr 27, 2019

@dahlia

This comment has been minimized.

Copy link
Member Author

commented Apr 29, 2019

@longfin Please review this again.

@dahlia dahlia merged commit b3a0ceb into planetarium:master Apr 29, 2019

5 checks passed

Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
changelog This contains self-describing changelog.
Details
codecov/patch 96.06% of diff hit (target 83.82%)
Details
codecov/project 84.1% (+0.27%) compared to 3116462
Details

@longfin longfin referenced this pull request Apr 29, 2019

Merged

Tune lock in BlockChain<T> #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.