-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 DeliverMax (alias for Amount) in Payment transactions #4733
Merged
intelliot
merged 26 commits into
XRPLF:develop
from
Bronek:feature/partial-payment-fieldname
Oct 23, 2023
Merged
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a4adde5
Add DeliverMax to submit, sign, tx etc.
Bronek 7d79f89
Add DeliverMax to subscribe
Bronek c9f7907
Factor out MultivarJson for transaction streams
Bronek 775731b
Refactor transJson to remove repeated code
Bronek 2959308
Add unit test for MultivarJson
Bronek ef6cbc0
Add test for TransactionSign.cpp
Bronek 2ec189b
Add DeliverMax to transaction_entry tests
Bronek aa9f0a9
Add DeliverMax to subscribe tests
Bronek e35bf62
Allow both Amount and DeliverMax if identical
Bronek 03edc89
Add DeliverMax to tx tests
Bronek 9f4206a
Add DeliverMax to account_tx test
Bronek 432fd16
Change apiVersion to unsigned
Bronek 03713c1
Merge branch 'develop' into feature/partial-payment-fieldname
Bronek c99959e
Update API-CHANGELOG.md
Bronek d1a2c59
Merge branch 'develop' into feature/partial-payment-fieldname
Bronek 44771d1
Merge branch 'develop' into feature/partial-payment-fieldname
Bronek 48697e8
Minor fixes
Bronek ff41b90
Add MultivarJson::isMember and small fixes
Bronek 5b30a25
Fill MultiApiJson in NetworkOPsImp::transJson
Bronek 198e7cd
Merge branch 'develop' into feature/partial-payment-fieldname
Bronek bd53535
Minor test improvement
Bronek cf0798a
Add assert in MultivarJson::select
Bronek efbf39a
Minor improvement in unit tests
Bronek 70bd1b7
Minor cleanup in include guards
Bronek 5e7fa7c
Improve version loop and static asserts
Bronek f4bfe95
Merge branch 'develop' into feature/partial-payment-fieldname
intelliot 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
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 |
---|---|---|
|
@@ -135,6 +135,7 @@ test.csf > ripple.protocol | |
test.csf > test.jtx | ||
test.json > ripple.beast | ||
test.json > ripple.json | ||
test.json > ripple.rpc | ||
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. Adding lines to the ordering file is great, as long as it follows the existing rules (which this does). It would be a problem if the line was added to |
||
test.json > test.jtx | ||
test.jtx > ripple.app | ||
test.jtx > ripple.basics | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//------------------------------------------------------------------------------ | ||
/* | ||
This file is part of rippled: https://github.com/ripple/rippled | ||
Copyright (c) 2023 Ripple Labs Inc. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
//============================================================================== | ||
|
||
#ifndef RIPPLE_APP_MISC_DELIVERMAX_H_INCLUDED | ||
#define RIPPLE_APP_MISC_DELIVERMAX_H_INCLUDED | ||
|
||
#include <ripple/protocol/TxFormats.h> | ||
|
||
#include <functional> | ||
#include <memory> | ||
|
||
namespace Json { | ||
class Value; | ||
} | ||
|
||
namespace ripple { | ||
|
||
namespace RPC { | ||
|
||
/** | ||
Copy `Amount` field to `DeliverMax` field in transaction output JSON. | ||
This only applies to Payment transaction type, all others are ignored. | ||
|
||
When apiVersion > 1 will also remove `Amount` field, forcing users | ||
to access this value using new `DeliverMax` field only. | ||
@{ | ||
*/ | ||
|
||
void | ||
insertDeliverMax(Json::Value& tx_json, TxType txnType, unsigned int apiVersion); | ||
|
||
/** @} */ | ||
|
||
} // namespace RPC | ||
} // namespace ripple | ||
|
||
#endif |
Oops, something went wrong.
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.
JSON-RPC should have a hyphen, although I think the changes should apply to both WebSocket and JSON-RPC (and likely do, based on what I see in the code here). Frequently people use the term "RPC" to encompass both the JSON-RPC and WebSocket APIs, although I tend to avoid such usage because it can cause such confusion.
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.
Are we doing JSON-RPC over WebSocket? For HTTP JSON-RPC, maybe we should say "HTTP" 🤔
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 kind-of like to use both parts, because they are important to set the context
JSON-RPC