-
Notifications
You must be signed in to change notification settings - Fork 231
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
Split MetaDEx RPC commands and payload creation #51
Split MetaDEx RPC commands and payload creation #51
Conversation
Not to be pedantic, but for In a nutshell I think "new" is implied and we should maintain continuity (perhaps replace "sendnewtrade" with "sendtrade" when test tools are updated?) Also, should we pluralize here given the action could affect multiple trades? (eg
I'd go with providing the user the most capability - it seems relatively simple now you're separating this out. Cancel all should directly consume an ecosystem value (instead of trying to interpret from two property fields) - 1 for main eco, 2 for test eco, and whilst not explicitly stated in the spec, 0 for both.
Sure - how can I help here? FYI at the present time pending objects are used purely when balances change (to prevent sending or trading the same funds twice) - since cancellations don't affect balances until confirmation (parsing and processing) I hadn't seen much need for pending cancellations as yet. Though further down the track I'm sure it would be nice to reflect pending actions (trades, cancellations etc) within the respective UI elements, I think that will need to wait until we have inbound pending sorted too (which @CraigSellars has asked is top of the list for 0.0.11). |
Great input, and I agree, the
This is what I was wondering about, too. I think we should pluralize here. Regarding
I'm mostly unsure how to deal with: It would be awesome, if we find an alternative to the hack of deriving the ecosystem based on property identifiers, and I'm also not a huge fan of passing dummy arguments, so my questions basically:
Hehe, so this is what I was referring to, when I mentioned "it caused quite some trouble already" in the thread about transaction formats. Initially Because there is no explicit ecosystem field, it was required to derive the ecosystem based on the provided values, namely Depending on the outcome of #47 we may reject
|
"sendtrade" with action value is replaced by: - sendtrade: fromaddress propertyidforsale amountforsale propertyiddesired amountdesired - sendcanceltradesbyprice: fromaddress propertyidforsale amountforsale propertyiddesired amountdesired - sendcanceltradesbypair: fromaddress propertyidforsale propertyiddesired - sendcancelalltrades: fromaddress ecosystem Until the test tools are updated, the old command "trade_MP" is still available and it forwards the call.
CreatePayload_MetaDExTrade() is split into: - CreatePayload_MetaDExTrade() - CreatePayload_MetaDExCancelPrice() - CreatePayload_MetaDExCancelPair() - CreatePayload_MetaDExCancelEcosystem() This change has no functional effect, and does not change the transaction format, but solely wraps and seperate the seperate actions into different logic units. Related code is updated, including reference-payload-creation unit tests.
4761b8f
to
f21b6ff
Compare
Updated to The old command |
+1
Absolutely
Sure, we'd just have a handler function triggered by the "Send Cancel Request" button that branched out into separate functions based on the selected radio button. In terms of the UI in general - I don't want you to worry too much about that dude I'll adapt it to follow whatever structure we need to - I think the right thing to do is get the fundamentals right (which incidentally I think includes breaking out MetaDEx transactions away from an action byte and into independent transaction types)
I'm not sure here mate, why disable functionality via the UI that would be available via RPC? If we're going to allow cancelling trades in both ecosystems via |
I've been thinking about the pending transactions: ideally they are not added on the UI/RPC layer, but by the wallet (or in theory: when the unconfirmed transaction enters the system [which is currently not handled]). We're probably not yet there, but I imagine with the new
Yeah, you're right. If Do you agree this PR is good to go? If so, I'd like to get it in, and then update OmniJ, and finally remove |
I do :) Again I wanted to just note my support for splitting out the transactions in their entirety to make separate MetaDEx transactions for each action. Just because we used an action byte in DEx v1 in no way means we have to make the same mistake (imo) for the MetaDEx. I see this PR as tying in very closely with that topic. |
"sendtrade"
with action value is replaced by:"sendtrade"
:fromaddress
propertyidforsale
amountforsale
propertyiddesired
amountdesired
"sendcanceltradesbyprice"
:fromaddress
propertyidforsale
amountforsale
propertyiddesired
amountdesired
"sendcanceltradesbypair"
:fromaddress
propertyidforsale
propertyiddesired
"sendcancelalltrades"
:fromaddress
ecosystem
Until the test tools are updated, the old command
"trade_MP"
is still available and it forwards the commands. The commands are suffixed with_OMNI
.Suggestions for other names are very welcomed. :)
CreatePayload_MetaDExTrade()
is split into:CreatePayload_MetaDExTrade()
CreatePayload_MetaDExCancelPrice()
CreatePayload_MetaDExCancelPair()
CreatePayload_MetaDExCancelEcosystem()
This change has no functional effect, and does not change the transaction format, but solely wraps and seperates the actions into different logic units.
Related code is updated, including the reference-payload-creation unit tests.
A few notes to
CANCEL_EVERYTHING
:It's behavior is as follows: if
property for sale
andproperty desired
are within the same ecosystem, then all offers in that ecosystem are cancelled, and if they are in different ecosystems, or zero, then all offers of both ecosystems are cancelled.That's not new, but now much more relevant, because the updated RPC command, and the payload creation function, directly comsume an
ecosystem
value.It should be discussed, whether we want to support cancelling of any order, or restrict it to either one ecosystem (in UI and RPC interface).
I intend to continue the seperation, however, some feedback would be great, especially in regards to the pending transaction objects and UI, because I'm not sure, what other plans there are in that context.
This PR resolves #48.