Skip to content
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

Add fee bump envelope to soroban operations #211

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

chowbao
Copy link
Contributor

@chowbao chowbao commented Dec 18, 2023

There is a missing TransactionEnvelope type that was added EnvelopeTypeEnvelopeTypeTxFeeBump
Added a function to decode the TransactionEnvelope correctly to return the contract_id and contract_code_hash

@chowbao chowbao requested a review from a team as a code owner December 18, 2023 23:00
Copy link
Contributor

@sydneynotthecity sydneynotthecity left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +1644 to +1647
case xdr.EnvelopeTypeEnvelopeTypeTx:
return transactionEnvelope.MustV1()
case xdr.EnvelopeTypeEnvelopeTypeTxFeeBump:
return transactionEnvelope.MustFeeBump().Tx.InnerTx.MustV1()
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting that we have to switch this ourselves. I'm kinda surprised there isn't an function in the xdr already to do this.

TIL there are more EnvelopeTypes! Do you think we need to handle other envelope types like EnvelopeTypeEnvelopeTypeContractId or EnvelopeTypeEnvelopeTypePoolRevokeOpId ?

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 I didn't see one. It might be because EnvelopeType is overloaded. Like depending on what struct it is used in only certain values are valid.
For example, EnvelopeTypeEnvelopeTypeOpId is used in HashIdPreimage but not in TransactionEnvelope. TransactionEnvelope only has TransactionV0Envelope, TransactionV1Envelope (which is actually named EnvelopeTypeEnvelopeTypeTx), and EnvelopeTypeEnvelopeTypeTxFeeBump

@chowbao chowbao merged commit bbce8f8 into master Dec 19, 2023
4 checks passed
@sydneynotthecity sydneynotthecity deleted the add-fee-bump-envelope branch December 19, 2023 16:13
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