Commit efb3392
authored
simnet: Add per-match address tests and README. (#3562)
* simnet: Expand trade tests and fix multi-asset harness issues.
Add four new simnet trade tests exercising per-match swap address
protocol: notakeraddr, nomakeraddr, notakerredeem, and missedcpaddr.
Enhance trade monitoring to verify per-match SwapAddr uniqueness and
CounterPartyAddr population. Add sendFilter to tConn and
withRequestFilter/withSendFilter helpers for cleaner filter lifecycle.
Fix polygon simnet FinalizeConfs (was 64, now 2 on simnet) so polygon
redeems confirm within the test timeout. Fix orderstatus test Badger
DB lock by disabling wallets after disconnect to prevent background
bond maintenance from reconnecting old wallets. Skip EVM balance
assertions in missedcpaddr test (same rationale as simpleTradeTest).
Clamp test order rates to the market minimum rate so markets like
zec_btc with high minimum rates don't reject orders. Bump ZEC simnet
maxFeeRate from 200 to 10000 to match the wallet's ZIP-317 fee rate.
Add new markets (LTC/DASH, DOGE/POLYGON, BCH/ETH, FIRO/BTC) to
enable running more test pairs in parallel without wallet conflicts.
Switch EVM harness connections from IPC to websocket endpoints in both
simnet trade tests and loadbot. Add build commit/dirty logging to the
run script. Add README for simnet-trade-tests.
Document per-match address design rationale in server/swap/swap.go
and client/core/trade.go.
* zec: Fix refund fee calculation for ZIP-317 compliance.
The refund was passing the per-action fee rate (5000 zats) as the
absolute fee, but a refund tx has 2 logical actions under ZIP-317,
requiring 10,000 zats. Calculate the proper fee using TxFeesZIP317
based on actual input/output sizes.
* btc: Retry block tx lookup in FindRedemption for multi-node setups.
In multi-node configurations (e.g. DASH), there can be a delay between
one node reporting a transaction in a block via gettransaction and that
block's full data being available from getblock on a different node.
Add a retry loop (up to 10 attempts with 1s delay) in
checkRedemptionBlockDetails to handle this race condition.
* multi: DRY up v1 token gas values and fix simnet.
Define tokenV1Gases once per chain (eth, polygon, base) from the
measured usdt mainnet values and reference it everywhere instead of
duplicating the same gas values across every token and network. Also
fix simnet v1 token gas estimates that were either empty or incorrectly
measured from ETH native swaps instead of token swaps.
* ui: Fix wallet unlock affecting all networks for same ticker.
openWallet was iterating over all networkAssets sharing the same
normalized ticker and unlocking every one. This meant unlocking ETH
on Ethereum would also unlock ETH on Base. The lock side already
operated on individual assets. Align unlock to match.
* ui: Show disabled state for individually disabled token wallets.
The per-network wallet row and actions modal only checked the parent
wallet's disabled state. A token wallet disabled independently (e.g.
polygon.eth via RPC) would appear enabled in the UI with no way to
re-enable it. Now both the status icon and the Enable action check
the token wallet's own disabled flag.1 parent 7fa27f9 commit efb3392
File tree
16 files changed
+1139
-402
lines changed- client
- asset
- btc
- polygon
- zec
- cmd/simnet-trade-tests
- core
- webserver/site/src/js
- dex
- networks
- base
- eth
- polygon
- testing
- dcrdex
- loadbot
- server/swap
16 files changed
+1139
-402
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
199 | 215 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
| |||
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
152 | | - | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2028 | 2028 | | |
2029 | 2029 | | |
2030 | 2030 | | |
2031 | | - | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
2032 | 2038 | | |
2033 | 2039 | | |
2034 | 2040 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
226 | 228 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| |||
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
93 | 155 | | |
94 | 156 | | |
95 | 157 | | |
| |||
107 | 169 | | |
108 | 170 | | |
109 | 171 | | |
110 | | - | |
111 | 172 | | |
112 | 173 | | |
113 | 174 | | |
114 | 175 | | |
115 | 176 | | |
116 | 177 | | |
117 | 178 | | |
| 179 | + | |
118 | 180 | | |
119 | 181 | | |
120 | 182 | | |
121 | 183 | | |
122 | 184 | | |
123 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
124 | 201 | | |
125 | 202 | | |
126 | 203 | | |
| |||
0 commit comments