feat(quote): shielded ZEC support for /mayachain/quote/swap

Summary

Two additions to /mayachain/quote/swap from integrator feedback (#🍫general):

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 — add shielded_memo_config to &quote-properties.
  • openapi/gen/* — make openapi regeneration.
  • x/mayachain/querier_quotes.go — populate res.ShieldedMemoConfig; override maxInMemoLen to 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_address set.
  • Manual: quote CACAO→ZEC — shielded_memo_config absent.

Merge request reports

Loading
Loading