client/core: monotonic OrderBook state updates#4
Conversation
|
Could go even further and sanity check lower |
| // May want to re-implement strict sequence checking. Might use these tests | ||
| // again. | ||
| // { | ||
| // label: "Unbook sell order with outdated sequence value", | ||
| // orderBook: makeOrderBook( |
There was a problem hiding this comment.
Hmm, I see relevant comment here from long time ago, but it doesn't quite answer why these were commented out in the first place ... Anyway, these tests work reasonably well with my changes - which is a good sign :)
30c855f to
866a8cb
Compare
| note: makeUnbookOrderNote(5, "ob", [32]byte{'d'}), | ||
| expected: nil, | ||
| wantErr: true, | ||
| note: makeUnbookOrderNote(5, "ob", [32]byte{'b'}), | ||
| expected: makeOrderBook( | ||
| 2, | ||
| "ob", | ||
| []*Order{ | ||
| makeOrder([32]byte{'b'}, msgjson.SellOrderNum, 10, 1, 2), | ||
| makeOrder([32]byte{'c'}, msgjson.SellOrderNum, 10, 2, 5), | ||
| }, | ||
| make([]*cachedOrderNote, 0), | ||
| true, | ||
| ), | ||
| wantErr: false, |
There was a problem hiding this comment.
And this "Unbook sell order with future sequence value" test seems to have worked because it was failing due to unknown id error, not the one the name claims to test, note, I changed order ID d->b (it fails like this on master)
There was a problem hiding this comment.
Fixed other similar issues (expectation mismatch) I found in these tests too.
2910c73 to
4318f03
Compare
|
I've been running this PR on mainnet, and occasionally I see notes from future: ... and so it goes until disconnect 1 min later (not sure if disconect is accidental, or if it's intentional once order book goes stale): then it reconnects and continues to work without obvious issues. Full log: notes-from-future.txt So, was relaxing constraint to allow future notifications the most practical way to address it at the time ? If it ain't part of design #1 + #2 + #4 will hopefully fix it (along with ghost orders and whatnot). |
ad9d264 to
e298e04
Compare
f9959eb to
a66bbae
Compare
e3c487c to
333e9f6
Compare
* client: Allow Firo to send to an EXX address. #4 EXX addresses are used for Firo and other privacy coins to send funds to Binance and other exchanges due to last US administration regulations. * imports: update go.mod for btcsuite/btcd/btcutil/base58 #5 * client: Add tests and tidy. - Add testnet tests - Add more Documentation * client/asset: re-implement using btc.PaymentScripter interface. * firo: Update Exx address related tests. - Also changed electrumx.sh to expose both TCP and SSL listening services on ports 50001 and 50002 respectively. * mm,libxc: Remove Firo from assetDisabled list. --------- Co-authored-by: dev-warrior777 <>
…ug fix
Batches the six easy/low-risk cleanup items from T18 into a single
commit, plus a related bug fix discovered during T18#10 research.
T18#6: DCR_ASSET_ID local constant -> shared DCRAssetID
- WalletsPage.tsx previously declared `const DCR_ASSET_ID = 42`
duplicating the existing `DCRAssetID` export in stores/types.ts.
Now imports from the shared location.
T18#13: dead createUpdater state in NewWalletForm
- Removed the `const [createUpdater] = useState(null)` line and its
associated `useNotifications({ createwallet })` handler. The
handler body had a `if (createUpdater) ...` null check on a
value that was always null, so the body never ran. Dead code
from an earlier refactor. Also removed the now-unused
WalletCreationNote and useNotifications imports.
T18#14: duplicate checkResponse helpers
- services/api.ts and hooks/useApi.ts both exported identical
`checkResponse` helpers. The canonical location is now
services/api.ts (where the related postJSON/getJSON/APIResponse
types live). Migrated 4 importers (DepositAddress,
WalletConfigForm, TokenApprovalForm, NewWalletForm) and deleted
the duplicate export from useApi.ts.
T18#4: returnPage typed as free-form string
- Added `type MMLogsReturnPage = 'mm' | 'mmarchives'` to
router/routes.ts. MMLogsPage now narrows the raw query-param
string via the union type, and MMArchivesPage assigns through a
typed local constant. Prevents typos from silently falling
through to the default 'mm' on either side of the producer/
consumer boundary.
T18#9: icon-only link a11y in SetVotesModal
- Added `aria-label={tspend.hash.slice(0, 8)... in block explorer}`
to the tspend explorer `<a>` (was a bare `ico-open` anchor with
no accessible text) and `aria-label={View proposal: ${name}}`
to the proposal `<Link>`. Both elements are icon-only so screen
readers had no fallback text before this change. Matches vanilla's
visual behavior; vanilla has the same a11y gap.
T18#10: proper TransactionNote type (+ B-L16 dispatch bug fix)
- BridgingPopup's handleTransactionNote previously cast the
incoming note to an ad-hoc `{ transaction?: { id, timestamp } }`
shape. Replaced with the existing `TransactionNote` type from
stores/types.ts.
- Discovered a REAL BUG during the type audit: the popup was
subscribing to a top-level `transaction` note type that does
not exist. Vanilla's dispatch flow wraps these inside
`walletnote` (CoreNote with type='walletnote' and
payload.route='transaction'); see wallets.ts L2767
`handleCustomWalletNote` + L2791 `case 'transaction'`. So my
handler never fired. Fixed by subscribing to `walletnote:`
instead and unwrapping the payload inline. The cosmetic
timestamp-refresh behavior that was silently broken now works.
Should prevent: