fix(dex-api): best orders proper is_mine provided#1849
Conversation
829096b to
20fd7d3
Compare
36ba117 to
4181f46
Compare
|
@rozhkovdmitrii I agree with this comment #1015 (comment) that we should exclude orders if they belong to the node from |
Excuse me for having a contrary opinion. What I wanted to say is if we leave is_mine it doesn't hurt anything, though if we don't it does. |
|
Right now we go through all orders in best orders and check if they are |
Sure ) - extending is not reducing |
Dared to use an abridged version, if you allow me of course []$ adex-cli best-orders --number 100 MORTY sell
Getting best orders: Sell MORTY
┌───┬───────┬──────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────────────────────┬───────────────────┐
│ │ Price │ Uuid │ Base vol(min:max) │ Rel vol(min:max) │ Address │ Confirmation │
│ RICK │
│ * │ 0.50 │ 1fc0df20-9c21-461a-ad78-a4b37d4ab336 │ 0.00020:1.00 │ 0.000100:0.50 │ RPFGrvJWjSYN4qYvcXsECW1HoHbvQjowZM │ 111,true:555,true │
│ │ 1.00 │ 7cb4735b-0c1e-4c55-a58e-35699e26e194 │ 0.000100:0.65 │ 0.000100:0.65 │ R9gWj7fzSxZtJZCSDMQz5G5J7x4rg6UmiQ │ 1,false:1,false │
│ │ 1.00 │ 880fadcb-ec7e-40dc-9299-6957dd8ce467 │ 0.000100:1.99 │ 0.00010:2.00 │ RMaprYNUp8ErJ9ZAKcxMfpC4ioVycYCCCc │ 1,false:1,false │
│ │ 0.04 │ 9199a9f3-d0ca-4746-b99a-438bf85f9204 │ 0.0022:42.77 │ 0.000100:1.94 │ RJVrcGS1H8LKqdFxbreTcRzpGiWsHQZDpc │ 1,false:1,false │
│ * │ 0.90 │ 9664d472-0313-494c-9a03-f8cd5d4f7e5b │ 0.00011:1.00 │ 0.000100:0.90 │ RPFGrvJWjSYN4qYvcXsECW1HoHbvQjowZM │ 1,false:1,false │
│ │ 1.00 │ eeb888af-5392-4b1a-a4a1-28250d6c3c7e │ 0.000100:363783.58 │ 0.000100:363783.58 │ RB8yufv3YTfdzYnwz5paNnnDynGJG6WsqD │ 1,false:1,false │
│ ZOMBIE │
│ │ 1.00 │ b1d92c46-b782-4dea-9825-f009708627d7 │ 0.000100:2.00 │ 0.000100:2.00 │ Shielded │ 1,false:1,false │
└───┴───────┴──────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────────────────────┴───────────────────┘
[]$ adex-cli best-orders --number 100 MORTY sell --exclude-my
Getting best orders: Sell MORTY
┌──┬───────┬──────────────────────────────────────┬────────────────────┬────────────────────┬────────────────────────────────────┬─────────────────┐
│ │ Price │ Uuid │ Base vol(min:max) │ Rel vol(min:max) │ Address │ Confirmation │
│ RICK │
│ │ 1.00 │ 7cb4735b-0c1e-4c55-a58e-35699e26e194 │ 0.000100:0.65 │ 0.000100:0.65 │ R9gWj7fzSxZtJZCSDMQz5G5J7x4rg6UmiQ │ 1,false:1,false │
│ │ 1.00 │ 880fadcb-ec7e-40dc-9299-6957dd8ce467 │ 0.000100:1.99 │ 0.00010:2.00 │ RMaprYNUp8ErJ9ZAKcxMfpC4ioVycYCCCc │ 1,false:1,false │
│ │ 0.04 │ 9199a9f3-d0ca-4746-b99a-438bf85f9204 │ 0.0022:42.77 │ 0.000100:1.94 │ RJVrcGS1H8LKqdFxbreTcRzpGiWsHQZDpc │ 1,false:1,false │
│ │ 1.00 │ eeb888af-5392-4b1a-a4a1-28250d6c3c7e │ 0.000100:363783.58 │ 0.000100:363783.58 │ RB8yufv3YTfdzYnwz5paNnnDynGJG6WsqD │ 1,false:1,false │
│ ZOMBIE │
│ │ 1.00 │ b1d92c46-b782-4dea-9825-f009708627d7 │ 0.000100:2.00 │ 0.000100:2.00 │ Shielded │ 1,false:1,false │
└──┴───────┴──────────────────────────────────────┴────────────────────┴────────────────────┴────────────────────────────────────┴─────────────────┘ |
caglaryucekaya
left a comment
There was a problem hiding this comment.
LGTM! Can you also add a test case in best_orders_tests to check if the exclude_mine and is_mine are working as intended?
8bbba7f to
174ff34
Compare
174ff34 to
a8ebaaa
Compare
shamardy
left a comment
There was a problem hiding this comment.
Thanks a lot for the fix! I have a few comments.
…hanged to bool with serde(default)
…tion to prevent future errors
… orderbook context
shamardy
left a comment
There was a problem hiding this comment.
Last 2 minor comments :)
shamardy
left a comment
There was a problem hiding this comment.
One more last comment!
shamardy
left a comment
There was a problem hiding this comment.
Thanks a lot for your patience with the fixes! LGTM!
best_orders rpc returns is_mine: false for own orders.
Changes fix this bug and also introduce an optional
exclude_myrpc field that exclude orders marked asis_minefrom response