-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add RequiredFee field to Check/DeliverResult #357
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
86ade8c
Add RequiredFee field, import cycle
ethanfrey 5d7413e
Add up RequiredFees in batch - test once compiles
ethanfrey e6c50f7
Extract coins into own package
ethanfrey 5a04b52
Fix many references to x.Coin to coin.Coin
ethanfrey 8fb1966
Fix remaining references to x.Coin, etc
ethanfrey ab27913
make build passes
ethanfrey 85029a2
Fill all imports in tests
ethanfrey ef13c76
Merge pull request #358 from iov-one/extract-coin-package
ethanfrey 50cbb5d
Added unit test for batch fee combination
ethanfrey 25b3309
Batch handles combining product fees with missing product fees
ethanfrey 06fd274
Updated docstring for RequiredFee
ethanfrey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package weave | |
import ( | ||
"fmt" | ||
|
||
"github.com/iov-one/weave/coin" | ||
"github.com/iov-one/weave/errors" | ||
abci "github.com/tendermint/tendermint/abci/types" | ||
"github.com/tendermint/tendermint/libs/common" | ||
|
@@ -35,11 +36,19 @@ func CheckOrError(result CheckResult, err error, debug bool) abci.ResponseCheckT | |
// DeliverResult captures any non-error abci result | ||
// to make sure people use error for error cases | ||
type DeliverResult struct { | ||
Data []byte | ||
Log string | ||
Diff []abci.ValidatorUpdate | ||
Tags []common.KVPair | ||
GasUsed int64 // unused | ||
// Data is a machine-parseable return value, like id of created entity | ||
Data []byte | ||
// Log is human-readable informational string | ||
Log string | ||
// RequiredFee can set an custom fee that must be paid for this transaction to be allowed to run. | ||
// This is enforced in cash.DynamicFeeDecorator | ||
RequiredFee coin.Coin | ||
// Diff, if present, will apply to the Validator set in tendermint next block | ||
Diff []abci.ValidatorUpdate | ||
// Tags, if present, will be used by tendermint to index and search the transaction history | ||
Tags []common.KVPair | ||
// GasUsed is currently unused field until effects in tendermint are clear | ||
GasUsed int64 | ||
} | ||
|
||
// ToABCI converts our internal type into an abci response | ||
|
@@ -54,8 +63,13 @@ func (d DeliverResult) ToABCI() abci.ResponseDeliverTx { | |
// CheckResult captures any non-error abci result | ||
// to make sure people use error for error cases | ||
type CheckResult struct { | ||
// Data is a machine-parseable return value, like id of created entity | ||
Data []byte | ||
Log string | ||
// Log is human-readable informational string | ||
Log string | ||
// RequiredFee can set an custom fee that must be paid for this transaction to be allowed to run. | ||
// This is enforced in cash.DynamicFeeDecorator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is similar to the discussion on https://github.com/iov-one/weave/pull/357/files#diff-dc931a8b7120348333d7b68dce1ca6ffR44 |
||
RequiredFee coin.Coin | ||
// GasAllocated is the maximum units of work we allow this tx to perform | ||
GasAllocated int64 | ||
// GasPayment is the total fees for this tx (or other source of payment) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think changing the phrasing from
this is enforced
tothis might be enforced by for example
might explain better. Although today this field is added specifically for the use by thecash.DynamicFeeDecorator
, anyone should be able to use it. Otherwise it sounds like this is a hard dependency. 💅I love the comments though. They explain a lot! 🏅