Skip to content

Commit

Permalink
Allow setting an identity on the ppl chain for simple multisigs (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut authored Mar 3, 2025
1 parent 76e264f commit 6ae179c
Show file tree
Hide file tree
Showing 46 changed files with 1,143 additions and 817 deletions.
2 changes: 1 addition & 1 deletion packages/ui/.papi/descriptors/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0-autogenerated.14219119828955582103",
"version": "0.1.0-autogenerated.2491962028661010856",
"name": "@polkadot-api/descriptors",
"files": [
"dist"
Expand Down
Binary file modified packages/ui/.papi/metadata/acala.scale
Binary file not shown.
Binary file modified packages/ui/.papi/metadata/hydration.scale
Binary file not shown.
Binary file removed packages/ui/.papi/metadata/khala.scale
Binary file not shown.
Binary file modified packages/ui/.papi/metadata/ksm.scale
Binary file not shown.
Binary file modified packages/ui/.papi/metadata/ksmPpl.scale
Binary file not shown.
Binary file modified packages/ui/.papi/metadata/wesAssetHub.scale
Binary file not shown.
57 changes: 35 additions & 22 deletions packages/ui/.papi/polkadot-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,88 @@
"entries": {
"dot": {
"chain": "polkadot",
"metadata": ".papi/metadata/dot.scale"
"metadata": ".papi/metadata/dot.scale",
"genesis": "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"
},
"ksm": {
"chain": "ksmcc3",
"metadata": ".papi/metadata/ksm.scale"
"metadata": ".papi/metadata/ksm.scale",
"genesis": "0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe"
},
"ksmAssetHub": {
"chain": "ksmcc3_asset_hub",
"metadata": ".papi/metadata/ksmAssetHub.scale"
"metadata": ".papi/metadata/ksmAssetHub.scale",
"genesis": "0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"
},
"ksmPpl": {
"chain": "ksmcc3_people",
"metadata": ".papi/metadata/ksmPpl.scale"
"metadata": ".papi/metadata/ksmPpl.scale",
"genesis": "0xc1af4cb4eb3918e5db15086c0cc5ec17fb334f728b7c65dd44bfe1e174ff8b3f"
},
"dotPpl": {
"chain": "polkadot_people",
"metadata": ".papi/metadata/dotPpl.scale"
"metadata": ".papi/metadata/dotPpl.scale",
"genesis": "0x67fa177a097bfa18f77ea95ab56e9bcdfeb0e5b8a40e46298bb93e16b6fc5008"
},
"bifrostDot": {
"wsUrl": "wss://eu.bifrost-polkadot-rpc.liebi.com/ws",
"metadata": ".papi/metadata/bifrostDot.scale"
"metadata": ".papi/metadata/bifrostDot.scale",
"genesis": "0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b"
},
"hydration": {
"wsUrl": "wss://rpc.helikon.io/hydradx",
"metadata": ".papi/metadata/hydration.scale"
},
"khala": {
"wsUrl": "wss://khala-api.phala.network/ws",
"metadata": ".papi/metadata/khala.scale"
"metadata": ".papi/metadata/hydration.scale",
"genesis": "0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d"
},
"phala": {
"wsUrl": "wss://phala-rpc.dwellir.com",
"metadata": ".papi/metadata/phala.scale"
"metadata": ".papi/metadata/phala.scale",
"genesis": "0x1bb969d85965e4bb5a651abbedf21a54b6b31a21f66b5401cc3f1e286268d736"
},
"paseo": {
"wsUrl": "wss://rpc.ibp.network/paseo",
"metadata": ".papi/metadata/paseo.scale"
"metadata": ".papi/metadata/paseo.scale",
"genesis": "0x77afd6190f1554ad45fd0d31aee62aacc33c6db0ea801129acb813f913e0764f"
},
"acala": {
"wsUrl": "wss://acala-rpc.dwellir.com",
"metadata": ".papi/metadata/acala.scale"
"metadata": ".papi/metadata/acala.scale",
"genesis": "0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c"
},
"pasPpl": {
"wsUrl": "wss://people-paseo.rpc.amforc.com",
"metadata": ".papi/metadata/pasPpl.scale"
"metadata": ".papi/metadata/pasPpl.scale",
"genesis": "0xe6c30d6e148f250b887105237bcaa5cb9f16dd203bf7b5b9d4f1da7387cb86ec"
},
"dotAssetHub": {
"chain": "polkadot_asset_hub",
"metadata": ".papi/metadata/dotAssetHub.scale"
"metadata": ".papi/metadata/dotAssetHub.scale",
"genesis": "0x68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f"
},
"polimec": {
"wsUrl": "wss://polimec.ibp.network",
"metadata": ".papi/metadata/polimec.scale"
"metadata": ".papi/metadata/polimec.scale",
"genesis": "0x7eb9354488318e7549c722669dcbdcdc526f1fef1420e7944667212f3601fdbd"
},
"coretimeDot": {
"wsUrl": "wss://polkadot-coretime-rpc.polkadot.io",
"metadata": ".papi/metadata/coretimeDot.scale"
"metadata": ".papi/metadata/coretimeDot.scale",
"genesis": "0xefb56e30d9b4a24099f88820987d0f45fb645992416535d87650d98e00f46fc4"
},
"westend": {
"chain": "westend2",
"metadata": ".papi/metadata/westend.scale"
"metadata": ".papi/metadata/westend.scale",
"genesis": "0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"
},
"wesPpl": {
"chain": "westend2_people",
"metadata": ".papi/metadata/wesPpl.scale"
"metadata": ".papi/metadata/wesPpl.scale",
"genesis": "0x1eb6fb0ba5187434de017a70cb84d4f47142df1d571d0ef9e7e1407f2b80b93c"
},
"wesAssetHub": {
"chain": "westend2_asset_hub",
"metadata": ".papi/metadata/wesAssetHub.scale"
"metadata": ".papi/metadata/wesAssetHub.scale",
"genesis": "0x67f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9"
}
}
}
}
19 changes: 0 additions & 19 deletions packages/ui/cypress/fixtures/setIdentity/setIdentityMultisigs.ts

This file was deleted.

41 changes: 0 additions & 41 deletions packages/ui/cypress/fixtures/setIdentity/setIdentitySignatories.ts

This file was deleted.

52 changes: 43 additions & 9 deletions packages/ui/cypress/fixtures/westendAccounts.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,58 @@
import { InjectedAccountWitMnemonic } from './testAccounts'

const signatory = {
address: '5CPG8FMciJBBE47YwSQHte23tTz91egixJw514g6BCt5nHPz',
publicKey: '0x0e270b0984354e0f6033dee93293dbeaea366220ca59e584ba7614d8bf393040',
name: 'hidden',
type: 'sr25519',
mnemonic: ''
} as InjectedAccountWitMnemonic

const leemo = {
address: '1HGnvAkk9nbfZ58CzUJhjcrLdEDMkr5qNkqqYkyD5BF5v6Y',
publicKey: '0x0c691601793de060491dab143dfae19f5f6413d4ce4c363637e5ceacb2836a4e',
name: 'hidden',
type: 'sr25519',
mnemonic: ''
} as InjectedAccountWitMnemonic

export const westendMemberAccount = {
// this is the member of a multisig and a multisig with Pure
// use in hidden-accounts
// used in hidden-accounts
hidden: {
account: {
address: '5CPG8FMciJBBE47YwSQHte23tTz91egixJw514g6BCt5nHPz',
publicKey: '0x0e270b0984354e0f6033dee93293dbeaea366220ca59e584ba7614d8bf393040',
name: 'hidden',
type: 'sr25519',
mnemonic: ''
} as InjectedAccountWitMnemonic,
account: signatory,
expectedSingleMultisig: {
westEndAddress: '5CvCLBVHufgqTDUVJL3xY6Pd7TVaYtaTGzvYRfGeaAPJLdDS',
westendAddress: '5CvCLBVHufgqTDUVJL3xY6Pd7TVaYtaTGzvYRfGeaAPJLdDS',
paseoAddress: '1rVUWkMmSxJtkV1Fy6xgFDmy5VEFC8bMVf2axG18FQpX7hE',
pubKey: '0x25bee0c82d1a5ea1ef4f75b4cb517286a78ed51ab934b1636ac4d8b018811b1b'
},
expectedPure: {
address: '5DqS9vsnXotmczKu87xb5KMUARCVF5JUUVveZz9R8UvXKExK',
pubKey: '0x4e596aec4922957174ba3f86860cca88fa4664006b511f11260cc34ca303d0dd'
}
},
// this one has no identity
// but it has a pending identity tx
noIdentity: {
account: signatory,
expectedSingleMultisig: {
westendAddress: '5GAvk9wqjHmXxCJB5UtwghLK4UqDzSD4sduSHwfoqhhYwoRS',
pubKey: '0xb5afca4314341bd1048c572e2e358fa00cb02387689a91f20688b9f49f3e64c6'
}
},
polkadotMultisigNoIdentity: {
account: leemo,
// CD event bounty
expectedPure: {
address: '13DxmMjYqto1AWsMUSkN8JYNHX6d2vBhuSmapB5iYnEiYaxX',
pubkey: '0x625b21fc3cfe39c52cf4d753fe8ad5f3b2ace458d9d11d266f080216e5e885e6'
}
},
// a random multisig on westend with a pending ppl chain tx
pendingIdentityTx: {
expectedSingleMultisig: {
westendAddress: '5DZWSw94BYkPVYF1RgMT261deXgPkeGYw9dQYmXsNSeRbxvs',
pubKey: '0x4233f17e78d624edb78296e918a631d3ceaa468167a9be7b16d612e446dd5c0d'
}
}
}
37 changes: 19 additions & 18 deletions packages/ui/cypress/tests/hidden-accounts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ describe('Hidden Accounts', () => {
})
goToHiddenAccountSettings()
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)

//hide random account
addHiddenAccount(randomAddress)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
settingsPage.hiddenAccountsContainer().should('be.visible')
settingsPage.hiddenAccountsContainer().within(() => {
accountDisplay.identicon().should('be.visible')
Expand All @@ -54,17 +54,17 @@ describe('Hidden Accounts', () => {
})

//hide the multisig account
addHiddenAccount(westendMemberAccount.hidden.expectedSingleMultisig.westEndAddress)
addHiddenAccount(westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
settingsPage.hiddenAccountsContainer().should('have.length', 2)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
// the multisig should be hidden
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems
.multiproxySelectorOptionDesktop()
.should('contain', westendMemberAccount.hidden.expectedPure.address.slice(0, 6))
})

it('hides all accounts sequentially and we switches to the available accounts if any', () => {
it('hides all accounts sequentially and it switches to the available accounts if any', () => {
cy.setupAndVisit({
url: landingPageNetworkAddress({
network: 'westend',
Expand All @@ -83,19 +83,19 @@ describe('Hidden Accounts', () => {
goToHiddenAccountSettings()
addHiddenAccount(westendMemberAccount.hidden.expectedPure.address)
// we should now have only the single multisig and have it selected
cy.url().should('include', westendMemberAccount.hidden.expectedSingleMultisig.westEndAddress)
cy.url().should('include', westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
topMenuItems.homeButton().click()
multisigPage.accountHeader().within(() => {
accountDisplay
.addressLabel()
.should(
'contain.text',
westendMemberAccount.hidden.expectedSingleMultisig.westEndAddress.slice(0, 6)
westendMemberAccount.hidden.expectedSingleMultisig.westendAddress.slice(0, 6)
)
})

topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage
.hiddenAccountsContainer()
Expand All @@ -108,8 +108,9 @@ describe('Hidden Accounts', () => {
settingsPage.hiddenAccountDeleteButton().should('be.visible')
})

// hide all accounts and expect an error
addHiddenAccount(westendMemberAccount.hidden.expectedSingleMultisig.westEndAddress)
// hide all other accounts and expect an error
addHiddenAccount(westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
addHiddenAccount(westendMemberAccount.noIdentity.expectedSingleMultisig.westendAddress)
topMenuItems.multiproxySelectorDesktop().should('not.exist')
topMenuItems.homeButton().click()
landingPage
Expand Down Expand Up @@ -187,9 +188,9 @@ describe('Hidden Accounts', () => {
hiddenAccountInfoModal.checkBoxMessage().should('not.be.checked')
hiddenAccountInfoModal.gotItButton().should('be.visible').click()
landingPage.transactionListLoader().should('not.exist')
cy.url().should('include', westendMemberAccount.hidden.expectedSingleMultisig.westEndAddress)
cy.url().should('include', westendMemberAccount.hidden.expectedSingleMultisig.westendAddress)
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage
.hiddenAccountsContainer()
Expand All @@ -204,7 +205,7 @@ describe('Hidden Accounts', () => {
settingsPage.hiddenAccountDeleteButton().should('be.visible').click()
settingsPage.hiddenAccountsContainer().should('not.exist')
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
topMenuItems.homeButton().click()

// hide it again but say to not view the message again
Expand All @@ -215,7 +216,7 @@ describe('Hidden Accounts', () => {
hiddenAccountInfoModal.gotItButton().should('be.visible').click()

topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
goToHiddenAccountSettings()
settingsPage.hiddenAccountsContainer().should('have.length', 1)

Expand All @@ -224,13 +225,13 @@ describe('Hidden Accounts', () => {

topMenuItems.homeButton().click()
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)

multisigPage.optionsMenuButton().click()
multisigPage.hideAccountMenuOption().should('exist').click()
hiddenAccountInfoModal.body().should('not.exist')
topMenuItems.multiproxySelectorDesktop().should('be.visible').click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 1)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
})

it('removes a watched account if hidding a watched account', () => {
Expand All @@ -245,7 +246,7 @@ describe('Hidden Accounts', () => {
})

topMenuItems.multiproxySelectorDesktop().click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 4)

// hide the watched account
multisigPage.optionsMenuButton().click()
Expand All @@ -254,7 +255,7 @@ describe('Hidden Accounts', () => {
hiddenAccountInfoModal.gotItButton().click()

topMenuItems.multiproxySelectorDesktop().click()
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 2)
topMenuItems.multiproxySelectorOptionDesktop().should('have.length', 3)
goToHiddenAccountSettings()
settingsPage.hiddenAccountsContainer().should('not.exist')
settingsPage.watchedAccountsAccordion().click()
Expand Down
Loading

0 comments on commit 6ae179c

Please sign in to comment.