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

fix: make use of spendLocal in treasury #11243

Merged
merged 2 commits into from
Jan 31, 2025
Merged

fix: make use of spendLocal in treasury #11243

merged 2 commits into from
Jan 31, 2025

Conversation

ap211unitech
Copy link
Contributor

📝 Description

This PR aims to make use of spendLocal instead of proposeSpend as this has been deprecated.

@ap211unitech ap211unitech self-assigned this Jan 30, 2025
@ap211unitech ap211unitech linked an issue Jan 30, 2025 that may be closed by this pull request
@ap211unitech ap211unitech requested a review from TarikGul January 30, 2025 18:09
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

Nice work, so technically speaking this is great. But it doesn't take into account backwards compatibility for chains that use proposeSend. So there needs to be support for both depending on what is exposed at runtime.

@ap211unitech
Copy link
Contributor Author

Nice work, so technically speaking this is great. But it doesn't take into account backwards compatibility for chains that use proposeSend. So there needs to be support for both depending on what is exposed at runtime.

To fix this, We provide proposeSpend as option if spendLocal doesn't exists like this api.tx.treasury.spendLocal ?? api.tx.treasury.proposeSpend.

If spendLocal and proposeSpend both does not exists, then Submit Proposal button would be disabled.

@ap211unitech ap211unitech requested a review from TarikGul January 31, 2025 06:13
@TarikGul
Copy link
Member

Is the call in apps-routing correct as well? Will it work for proposeSend?

@ap211unitech
Copy link
Contributor Author

Is the call in apps-routing correct as well? Will it work for proposeSend?

Yes it is. In apps-routing, it need this only.

needsApi: [
        'query.treasury.proposals'
      ]

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

LGTM, nice job!

@TarikGul TarikGul merged commit 385a8d8 into master Jan 31, 2025
5 checks passed
@TarikGul TarikGul deleted the fix/treasury-spend branch January 31, 2025 13:10
@albertov19
Copy link
Contributor

Hey just a small comment. spendLocal will be deprecated in favour of treasury.spend in the near future.

I did not check, but just FYI as if we only support spendLocal the flow will be broken either way later

@TarikGul
Copy link
Member

Hey just a small comment. spendLocal will be deprecated in favour of treasury.spend in the near future.

I did not check, but just FYI as if we only support spendLocal the flow will be broken either way later

Thanks for the heads up - we'll put in a guard for now that disables the send button if proposeSend and or spendLocal doesn't exist.

We'll work on getting support for spend as well.

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.

Treasury Page Broken
3 participants