Commit f950443
committed
client/{asset,core}: purge dex.Asset from client/asset methods
dex.Asset was a vehicle to pass various asset specific info, but very
few fields were used or relevant. Instead of using this big struct to
as an input argument to numerous client/asset methods, change
the method signatures and structs to only include what is really
required for the Wallets to do their work.
This makes it much clearer what the dex.Asset configs were really
needed for, and much easier to confidently provide the needed data
to the wallet methods.
The msgjson.Asset.SwapSize and SwapSizeBase fields are now deprecated.
These data are fully specified by the asset version, and they are in no
way server configuration as implied by the dex.Asset and msgjson.Asset
struct docs. Neither the wallets nor Core should trust thest transaction
sizes for any purpose. The wallets know their own init tx sizes, and
as expected, their were no good reasons to give these externally
sourced values to the wallets.
The one and only problematic use the foreign SwapSize values was
related to order accelaration, where a core method used the value to
estimate how much funding is required for an existing partially-settled
trade. This was resolved with a new (and trivial) asset.Accelerator
method to compute the transaction fee from a remaining swap count
and worst case fee rate. Supporting this involved adding the InitTxSize
and InitTxSizeBase as fields of the wallet implementations, in the same
manner as the server node implementations.
This also adds the new client/asset.WalletInfo.SupportedVersions field
to support wallet backends that support multiple asset versions. Core
methods now check this slice against the version reported by the
server in the config response.
dex/msgjson: mark Asset.{SwapSize,SwapSizeBase} as deprecated/V0PURGE.1 parent ee9c630 commit f950443
24 files changed
Lines changed: 772 additions & 556 deletions
File tree
- client
- asset
- bch
- btc
- livetest
- dcr
- doge
- eth
- ltc
- zec
- core
- webserver
- dex/msgjson
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| 196 | + | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| 866 | + | |
866 | 867 | | |
867 | 868 | | |
868 | | - | |
| 869 | + | |
869 | 870 | | |
870 | 871 | | |
871 | 872 | | |
| |||
1298 | 1299 | | |
1299 | 1300 | | |
1300 | 1301 | | |
1301 | | - | |
| 1302 | + | |
| 1303 | + | |
1302 | 1304 | | |
1303 | 1305 | | |
1304 | 1306 | | |
| |||
1379 | 1381 | | |
1380 | 1382 | | |
1381 | 1383 | | |
| 1384 | + | |
1382 | 1385 | | |
1383 | 1386 | | |
1384 | | - | |
| 1387 | + | |
1385 | 1388 | | |
1386 | 1389 | | |
1387 | 1390 | | |
| |||
1602 | 1605 | | |
1603 | 1606 | | |
1604 | 1607 | | |
| 1608 | + | |
1605 | 1609 | | |
1606 | 1610 | | |
1607 | | - | |
| 1611 | + | |
1608 | 1612 | | |
1609 | 1613 | | |
1610 | 1614 | | |
| |||
2869 | 2873 | | |
2870 | 2874 | | |
2871 | 2875 | | |
| 2876 | + | |
2872 | 2877 | | |
2873 | 2878 | | |
2874 | | - | |
| 2879 | + | |
2875 | 2880 | | |
2876 | 2881 | | |
| 2882 | + | |
2877 | 2883 | | |
2878 | 2884 | | |
2879 | 2885 | | |
| |||
2913 | 2919 | | |
2914 | 2920 | | |
2915 | 2921 | | |
2916 | | - | |
2917 | | - | |
| 2922 | + | |
| 2923 | + | |
2918 | 2924 | | |
2919 | 2925 | | |
2920 | 2926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
525 | 527 | | |
526 | 528 | | |
527 | 529 | | |
| 530 | + | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
| |||
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
536 | | - | |
537 | 539 | | |
538 | | - | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
550 | | - | |
| 552 | + | |
551 | 553 | | |
552 | 554 | | |
553 | 555 | | |
| |||
0 commit comments