polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.74k stars 1.54k forks source link

Support fellowshipTreasury #10323

Open xlc opened 6 months ago

xlc commented 6 months ago

On the polkadot collective chain, a fellowshipTreasury is introduced with https://github.com/polkadot-fellows/runtimes/pull/109

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

ryanleecode commented 6 months ago

Taking this one

ryanleecode commented 6 months ago

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 commented 6 months ago

Actually yeah, there is just no treasury pallet on collectives

TarikGul commented 6 months ago

Thanks for looking into this. Couple things:

xlc commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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