test(privy): live-chain + real-server end-to-end tests#25
Merged
Conversation
Two opt-in tests, gated by env vars, not run in CI:
test/privy-live-chain.test.mjs (MNEMONIC=...):
- Constructs SentinelClient with both Mode A (mnemonic) and Mode B (raw-sign)
signers and queries getBalance() against mainnet RPC.
- Broadcasts a real self-MsgSend(1 udvpn) signed by Mode B's raw-sign
callback. Proves cosmos-sdk validators accept the signature shape the
adapter produces (low-S, r||s, makeSignBytes-derived digest).
- Verified mainnet TX 4A6BA72AA4AF6A05BE10E8037AF31A5B1D6378A520FB4C0F05BF9CDD6FF50C7E
at height 28097905 — 7/7 assertions pass.
test/privy-real-server.test.mjs (PRIVY_APP_ID, PRIVY_APP_SECRET):
- Hits Privy's real REST API: POST /v1/wallets {chain_type: cosmos}
creates a server-managed wallet, then POST /v1/wallets/{id}/raw_sign
backs the adapter's signRawSecp256k1 callback.
- Verifies the cosmjs SignDoc signature the adapter assembles from Privy's
response bytes verifies against the Privy-derived 33-byte compressed
pubkey using @cosmjs/crypto. 13/13 assertions pass.
Also: added npm scripts test:privy / test:privy:live / test:privy:server
and a "Run the live suites" section in docs/PRIVY-INTEGRATION.md.
Files NOT shipped in npm package (test/ not in package.json files allowlist).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two opt-in, env-gated tests that prove the Privy adapter works against (a) Sentinel mainnet and (b) Privy's actual production API. Neither runs in CI.
What this verifies that mocks couldn't
Together with the existing mocked suites, the adapter now has 52 assertions covering the full stack.
Files added
Distribution safety
Test plan