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

Support fellowshipTreasury #10323

Open
xlc opened this issue Mar 2, 2024 · 7 comments
Open

Support fellowshipTreasury #10323

xlc opened this issue Mar 2, 2024 · 7 comments
Labels
Feature New functionality expanding SDK’s capabilities, adding tools or APIs for developers. P3 - Low Non-essential improvements or minor fixes. Can be scheduled flexibly as time permits.

Comments

@xlc
Copy link
Contributor

xlc commented Mar 2, 2024

On the polkadot collective chain, a fellowshipTreasury is introduced with polkadot-fellows/runtimes#109

We should be able to config pjs apps somehwere to enable the Treasury page for it.

@ryanleecode
Copy link

Taking this one

@ryanleecode
Copy link

I can confirm the FellowshipTreasury pallet does exist on collectives and can be queried

import { getScProvider, WellKnownChain } from "@polkadot-api/sc-provider"
import { getChain } from "@polkadot-api/node-polkadot-provider"
import { createClient } from "@polkadot-api/client"
import { polkadot_collectives } from "@substrate/connect-known-chains"

import Collectives from "./descriptors/collectives"
const scProvider = getScProvider()

const collectivesChain = getChain({
  provider: scProvider(WellKnownChain.polkadot).addParachain(polkadot_collectives),
  keyring: [],
})

const relayChain = createClient(collectivesChain)

const collectives = relayChain.getTypedApi(Collectives)

console.log("aaa", await collectives.query.FellowshipTreasury.Proposals.getEntries())

Result:

aaa []

In polkadot JS whats stopping the treasury page from being shown is the needs API dependency on tx.treasury.proposeSpend. and it is missing when i print out the derive object

image

@ryanleecode
Copy link

Actually yeah, there is just no treasury pallet on collectives

@TarikGul
Copy link
Member

Thanks for looking into this. Couple things:

  • tx.treasury.proposeSpend wont be under the derives. The derives are not generated at runtime based on the chain the api is connected to, they are static functions that contain more complex logic. Usually they connect a bunch of storage calls to simplify the aggregating or calculating of data.

  • An easy way to see if the api has a certain storage calls or to check if a pallet exists you can:

    1. Head to the developer tabs and go to javascript here.
    2. You can see what the api generated at runtime based on the chain you are connected too:
    console.log(Object.keys(api.tx)) // This will show all the available pallets for `tx`
    console.log(Object.keys(api.query)) // This will show all the available pallets for `query` (storage queries)
    console.log(Object.keys(api.tx.fellowshipTreasury)) // This will show that `proposeSend` exists for `fellowshipTreasury`
    
  • Looks like we can create a new page-fellowshipTreasury and a new apps-routing that says if api.query.fellowshipTreasury exists we that page should show up. Then we can set it in the governance tab.

@xlc
Copy link
Contributor Author

xlc commented Mar 14, 2024

I believe pjs apps supports to pallet name alias. For example, for the Council page, it works for council in Polkadot, and generalCouncil in Acala. So most likely just need to reuse whatever feature used there and have some configs.

@ryanleecode
Copy link

the fellowshipTreasury pallet is completely different from the current treasury pallet. the latter seems dated.

two questions

  1. can you add some proposals & approvals on westend
  2. how do i join the fellowship on westend for testing?

@xlc
Copy link
Contributor Author

xlc commented Mar 14, 2024

the pallet are the same one just with maybe different versions. the treasury page have to support all the versions of the treasury pallet.

for development and testing purpose, just use chopsticks to fork mainnet and you can then make Alice as a member and do whatever you want. let me know if you need some details instructions on how to do it

@TarikGul TarikGul moved this from Issues (Upstream) to P2 - Medium in Polkadot-js general project board Oct 30, 2024
@TarikGul TarikGul added P2 - Medium Important but not urgent. Enhances functionality and value, scheduled after higher priorities. Feature New functionality expanding SDK’s capabilities, adding tools or APIs for developers. P3 - Low Non-essential improvements or minor fixes. Can be scheduled flexibly as time permits. and removed P2 - Medium Important but not urgent. Enhances functionality and value, scheduled after higher priorities. labels Oct 30, 2024
@TarikGul TarikGul moved this from P2 - Medium to P3 - Low in Polkadot-js general project board Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality expanding SDK’s capabilities, adding tools or APIs for developers. P3 - Low Non-essential improvements or minor fixes. Can be scheduled flexibly as time permits.
Projects
Development

No branches or pull requests

3 participants