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

Issue setting identity using only Riot datum #5996

Open
4 of 10 tasks
rockbmb opened this issue Oct 9, 2024 · 2 comments
Open
4 of 10 tasks

Issue setting identity using only Riot datum #5996

rockbmb opened this issue Oct 9, 2024 · 2 comments
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@rockbmb
Copy link

rockbmb commented Oct 9, 2024

  • I'm submitting a ...

    • Bug report
    • Feature request
    • Support request
    • Other
  • What is the current behavior and expected behavior?

Current behavior

It is not possible to use the polkadot.js API to set the Riot/Matrix field in the on-chain identity of an account.

Expected behavior

It should be possible to set an account's identity using only the Riot/Matrix field by passing an object with a riot field (since renamed to matrix) to api.tx.setIdentity, see the image below.

Screenshot 2024-10-10 at 00 35 28

Steps to reproduce:

  1. Go to https://polkadot.js.org/apps/
  2. Switch to the People chain in either Polkadot or Kusama
  3. Select "Fork locally"
  4. In the "Developer" dropdown menu in the upper ribbon, select "</> Javascript"
  5. Insert the following code
const riot = '@test:test_server.io';

# Chopsticks provided dev address, funded with DOT/KSM
const alice = '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'

const identity = {
  matrix: { raw: riot },
}

const setIdTx = api.tx.identity.setIdentity(identity)
await setIdTx.signAndSend(alice)

# Advance a block so extrinsic takes effect
await api.rpc('dev_newBlock', { count: 1 })

const identityInfoReply = await api.query.identity.identityOf(alice)
const registrationInfo = identityInfoReply.unwrap()[0]
const identityInfo = registrationInfo.info

console.log(identityInfo.riot)
  1. Execute the code, also accepting the prompt that appears to sign the transaction containing the setIdentity extrinsic
  2. The output of the above console.log will be undefined, when it should be '@test:test_server.io'

P.S. changing occurences of riot above to matrix is a compile-time error, but produces the expected behavior.

  • Please tell us about your environment:

    • Version: "@polkadot/types": "^14.0.1"

    • Environment:

      • Node.js
      • Browser
      • Other (limited support for other environments)
    • Language:

      • JavaScript
      • TypeScript (include tsc --version)
      • Other
@TarikGul
Copy link
Member

I haven't tried it with "Fork locally" or alice. But I just tried with a westend account, and it worked fine.

@TarikGul
Copy link
Member

It actually might be that there is no display name as that might be required.

@TarikGul TarikGul added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
Development

No branches or pull requests

2 participants