-
-
Notifications
You must be signed in to change notification settings - Fork 721
[WIP] TRON: native TRX Transfer #6150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 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]>
aed83d2 to
19097c7
Compare
| */ | ||
| message TronAddress { | ||
| required string address = 1; // Tron address in base58_checked encoding | ||
| required string address = 1; // Tron address in Base32 encoding |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]




























































































































































Getting @overcat 's PR #5359 up to speed.
chore: add Capability_Tronto its preceding commit.#5358 to be updated after merge