Skip to content

feat: add TRON governance command domains - #972

Merged
gummy789j merged 2 commits into
tronprotocol:feat/ts-v4.12.0from
grayfoxd:feat/ts-v4.12.0
Aug 10, 2026
Merged

feat: add TRON governance command domains#972
gummy789j merged 2 commits into
tronprotocol:feat/ts-v4.12.0from
grayfoxd:feat/ts-v4.12.0

Conversation

@grayfoxd

@grayfoxd grayfoxd commented Aug 7, 2026

Copy link
Copy Markdown

No description provided.

@gummy789j
gummy789j merged commit d12bd1c into tronprotocol:feat/ts-v4.12.0 Aug 10, 2026
gummy789j added a commit that referenced this pull request Aug 10, 2026
Review of d12bd1c (proposal / witness / contract governance, another
contributor's work) against §1 and §2 of the v4.12.0 requirements,
validated live on Nile with a registered witness account.

Two defects made 6 of the 12 new commands unusable against a real node;
both were invisible to the existing tests because those mock the gateway
port, so they could only ever re-assert the adapter's own assumptions.

- getWitness called /wallet/getwitnessbyaddress, which does not exist on
  any node (POST 405 / GET 404 on mainnet and Nile). Every witness-status
  check therefore failed with rpc_error, breaking `witness create`,
  `witness update`, `witness set-brokerage` and — via assertWitness —
  `proposal create`, `proposal approve` and `proposal delete`. Read the
  witness list and filter locally instead: one request, no fan-out, and
  listwitnesses covers every witness rather than only the active 27.

- normalizeProposal rejected an array of parameters and fell back to {},
  but listproposals only ever sends an array. Every proposal reported
  zero parameter changes — the field that says what a proposal does — and
  `proposal create --wait` could not resolve the id of the proposal it
  had just created, since findCreatedProposal matches on that set.

Also gate the writes the Ledger TRON app cannot parse (WitnessCreate,
WitnessUpdate, UpdateBrokerage, ClearABI, UpdateEnergyLimit,
UpdateSetting): governanceTransactionMode already accepted
requireSoftware but no call site passed it, so a Ledger user reached the
device and spent RPCs before APDU 0x6a80. The proposal group stays
ungated — its contract types are on the app's allowlist. See adr/0003.

Tighten `witness create`'s activation check from "empty object" to a
present address, matching accountExists, and make the fixtures realistic.

Adds adapter-level coverage over a verbatim mainnet listproposals payload
and per-command Ledger assertions; both fail if the fixes are reverted.

Verified on Nile: witness update and set-brokerage confirmed on chain
(url change re-read from listwitnesses); proposal create -> id 20662
resolved -> show renders the change -> approve -> already_approved ->
--cancel -> not_approved -> delete -> canceled. Contract governance
reaches real endpoints (not_contract_deployer / contract_not_found).
create2 verified byte-exact against an independent implementation of
Java's formula.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants