Repository navigation
Conversation
conduitKeyToConduit is indexed with the conduit key exactly as it arrives. A conduit key is a bytes32, so the same value can be written in any hex case, and a key that differs only in case misses the lookup. The operator comes back undefined and the failure surfaces from ethers as unsupported addressable value (argument="target", value=null) which mentions neither the conduit nor the key. Five call sites read that map: the operator approvals are granted to at order creation, the offerer and fulfiller operators on fulfillOrder, and the same two on fulfillOrders. All five are affected, so an order carrying a re-cased key cannot be created or filled. Everywhere else the SDK compares hex it already lowercases both sides -- tokens in findBalanceAndApproval and getSummedTokenAndIdentifierAmounts, operators in getApprovalDedupKey, owners in balanceOf, the recipient in shouldUseBasicFulfill, currencies in areAllCurrenciesSame. The conduit key is the one hex comparison left keyed on the raw string. Lower case the map when it is built and lower case the key on the way in, behind a small helper so all five sites go through the same path. A key that already matches the configured case resolves exactly as before.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #980 +/- ##
==========================================
+ Coverage 98.27% 98.95% +0.67%
==========================================
Files 35 51 +16
Lines 14526 18629 +4103
Branches 660 988 +328
==========================================
+ Hits 14276 18435 +4159
+ Misses 245 187 -58
- Partials 5 7 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for this, and for counting the nine other places the SDK already lowercases before concluding the conduit key was the odd one out. That is what makes it read as a normalization gap rather than a caller mistake. Routing all five sites through one helper is the right shape, and adding the first conduit coverage the repo has had is a bonus. One thing to flag: as submitted this fails biome check, so the lint job went red once the workflow was approved. It is only the formatting of the allOffererOperators arrow, and biome check --write fixes it. Worth running npm run lint locally before pushing, since lint here is tsc plus Biome and is a required check. I have included the formatting fix in the stack. Reverting the source with your tests in place fails three of the four on the ethers "unsupported addressable value" error, with the matching-case control still passing, so the coverage is doing its job. This has landed in #985 with seven other contributions from the same day. Closing in favour of that one. |
Problem
conduitKeyToConduitis indexed with the conduit key exactly as it comes in. A conduit key is abytes32, so the same value can be written in any hex case, and a key differing only in case misses the lookup. The operator falls outundefined, and what the caller ends up seeing comes from ethers:Nothing there names the conduit, the key, or the config that needed changing.
Five places read that map — the operator approvals are granted to in
_formatOrder, the offerer and fulfiller operators infulfillOrder, and the same two infulfillOrders. All five are affected, so an order carrying a re-cased key can be neither created nor filled.This reads as a normalization gap rather than a caller mistake. Everywhere else the SDK compares hex it already lowercases both sides: tokens in
findBalanceAndApprovalandgetSummedTokenAndIdentifierAmounts, operators ingetApprovalDedupKey, owners inbalanceOf, the recipient inshouldUseBasicFulfill, currencies inareAllCurrenciesSame. Nine of them. The conduit key is the one left keyed on the raw string, and its two sides come from different places — the map is configured by the integrator, the key rides in on order data.Fix
Lowercase the map as it is built and lowercase the key on the way in, behind a small private helper so all five sites take the same path. A key already matching the configured case resolves exactly as before.
Test
There was no conduit coverage at all — the fixture deploys a
ConduitControllerbut no test ever creates a conduit — sotest/conduit.spec.tssets one up off the fixture's own Seaport, opens a channel, and drives creation plus both fulfillment paths.Three of the four cases stop at the ethers error above without this change. The fourth uses a matching-case key and behaves the same either way, which is what holds the existing path in place.