Skip to content

Conversation

@PrisionMike
Copy link
Contributor

@PrisionMike PrisionMike commented Nov 12, 2025

Getting @overcat 's PR #5359 up to speed.

  • Squashes the chore: add Capability_Tron to its preceding commit.
  • Allows native transfer of TRX
  • Adds sign and TransferContract support

#5358 to be updated after merge

@trezor-bot trezor-bot bot added this to Firmware Nov 12, 2025
@github-project-automation github-project-automation bot moved this to 🔎 Needs review in Firmware Nov 12, 2025
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)
Translations

cs main(all)

model device_test click_test
T2T1 test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all)

de main(all)

model device_test click_test
T2T1 test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all)

es main(all)

model device_test click_test
T2T1 test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all)

fr main(all)

model device_test click_test
T2T1 test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all)

pt main(all)

model device_test click_test
T2T1 test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all)

Latest CI run: 19361334388

@PrisionMike PrisionMike added core Trezor Core firmware. Runs on Trezor Model T and Safe models. altcoin Any non-Bitcoin coins translations Put this label on a PR to run tests in all languages labels Nov 12, 2025
- Squashes the `chore: add Capability_Tron` to its preceding commit from #5359
- Allows native transfer of TRX
- Adds sign and TransferContract support

[no changelog]

Co-authored-by: PrisionMike <[email protected]>
*/
message TronAddress {
required string address = 1; // Tron address in base58_checked encoding
required string address = 1; // Tron address in Base32 encoding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the TronTransferContract, it uses base58 encoding, but here is it actually base32? Wouldn't it be better to keep them consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is incorrect. Will fix this. Thanks!

if trezor_account != msg.owner_address:
# If the owner address is not the same as the Trezor account, we need to confirm the owner address.
# This may occur in scenarios involving multi-signatures.
# The `confirm_output` has a `source_account` field, but it does not work in T3B1; perhaps we should unify them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if T3B1 supports it now; it might be worth double-checking.

# but they have defined the contract as a list for future expansion.
# https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/Tron.proto#L439-L440
contract = await call_any(messages.TronContractRequest(), *consts.contract_types)
raw_contract, total_send = await process_contract(contract, trezor_address) # type: ignore [Argument of type "MessageType" cannot be assigned to parameter "contract" of type "TronMessageType" in function "process_contract"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@overcat I think this is incorrect, right? The contract is not being initialized with any actual data the user is sending. The total_send and subsequent data would therefore be garbage, right? Or am I missing something in its intitialization.

Working on a fix meanwhile.

Copy link
Contributor

@overcat overcat Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @PrisionMike, I think it is not None; for the tx that sends TRX, it is a TronTransferContract object.

contract = await call_any(messages.TronContractRequest(), *consts.contract_types), this line of code will request the client to send data.

There are many test cases in sign_tx.json, and you can use them to test. cmd: trezorctl tron sign-tx [hex-string]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and Safe models. translations Put this label on a PR to run tests in all languages

Projects

Status: 🔎 Needs review

Development

Successfully merging this pull request may close these issues.

3 participants