Skip to content

feat: add juror.vote() wrapper for plaintext/encrypted votes - #86

Merged
meshackyaro merged 1 commit into
trustflow-protocol:mainfrom
dannyy2000:feat/12-juror-vote-11-release-milestone-10-rpc-query-14-npm-ci
Aug 26, 2026
Merged

feat: add juror.vote() wrapper for plaintext/encrypted votes#86
meshackyaro merged 1 commit into
trustflow-protocol:mainfrom
dannyy2000:feat/12-juror-vote-11-release-milestone-10-rpc-query-14-npm-ci

Conversation

@dannyy2000

@dannyy2000 dannyy2000 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds JurorClient.vote() to cast a juror's decision on a dispute via the TrustFlow contract, supporting both a plaintext choice (approve / reject / abstain) and an encrypted vote (base64 ciphertext, e.g. for a commit-reveal scheme — the SDK does not perform encryption itself).
  • Adds buildVoteArgs to src/contract/build.ts, encoding the vote into Soroban call args (plaintext choice as a symbol, ciphertext as opaque bytes), plus an isValidBase64 validation helper.
  • New types in src/types/juror.ts (VotePayload, CastVoteParams, CastVoteResult, etc.), wired into the package's public exports.
  • Jest coverage: XDR payload round-tripping for buildVoteArgs, and JurorClient.vote() validation/success paths (10 new tests).
  • README: new "Juror Voting" usage section, feature list entry, and roadmap item checked off.

Closes #12.
Closes #11
Closes #14
Closes #10

Test plan

  • npm run build — CJS/ESM/d.ts all build successfully
  • npm test — 146/146 passing (10 new)
  • npm run lint — 0 errors (21 pre-existing warnings, unchanged)
  • npm run format:check — clean

Adds JurorClient.vote() to cast a juror's decision on a dispute, encoding
either a plaintext choice (symbol) or an opaque base64 ciphertext (bytes)
into the Soroban call args via a new buildVoteArgs helper.

Closes trustflow-protocol#12
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@dannyy2000 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@meshackyaro
meshackyaro merged commit f55f2bf into trustflow-protocol:main Aug 26, 2026
0 of 2 checks passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Aug 26, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up CI pipeline for NPM publishing Add juror.vote() wrapper Implement escrow.releaseMilestone() wrapper Add raw Soroban RPC query helper

2 participants