feat(quote): shielded ZEC support for /mayachain/quote/swap
Summary
Two additions to /mayachain/quote/swap from integrator feedback (#
1. shielded_memo_config.unified_address on ZEC-source quotes
When ZECShieldedMemoEnabled > 0, the response now surfaces the vault's unified_address and uivk (same ShieldedMemoConfig struct /mayachain/inbound_addresses already returns). Integrators no longer need a second RPC to build a shielded-memo output to the vault.
2. Relax memo cap for ZEC-source when shielded is enabled
common/chain.go:MaxMemoLength(fromAddress) returned 80 for ZEC unless fromAddress was itself shielded. That trips on the common integrator flow: quote requested with default (random transparent) from_address + a long shielded refund address → memo > 80 → error.
The 80-byte cap only applies to transparent-only Zcash txs. When shielded memo is enabled network-wide, the vault-bound output is shielded and the memo can carry 512 bytes. Fix is applied in the querier (which has ctx / mimir access); common/chain.go stays untouched.
Files
openapi/openapi.yaml— addshielded_memo_configto"e-properties.openapi/gen/*—make openapiregeneration.x/mayachain/querier_quotes.go— populateres.ShieldedMemoConfig; overridemaxInMemoLento 512 for ZEC-source when shielded enabled.test/regression/suites/api/quotes/swap-zec.yaml— assert absence on CACAO→ZEC, presence on ZEC→CACAO; flip the "memo too long" case to expect success with the new field populated.
Test plan
-
go vet ./x/mayachain/... - Regression:
test/regression/suites/api/quotes/swap-zec.yaml - Manual: quote ZEC→CACAO with shielded refund_addr — memo returned +
shielded_memo_config.unified_addressset. - Manual: quote CACAO→ZEC —
shielded_memo_configabsent.