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

Impossible to sign attestation when `isPreclaimed` is true. #10041

Open d73fb279 opened 10 months ago

d73fb279 commented 10 months ago

page-claims determines that a preclaimed address needs to sign an attestation:

https://github.com/polkadot-js/apps/blob/ec23c9bd9eb06253b6acf169dd8ffd5b479096eb/packages/page-claims/src/index.tsx#L299-L308

However the statementKind parameter it is passing to AttestDisplay is undefined, because in

https://github.com/polkadot-js/apps/blob/ec23c9bd9eb06253b6acf169dd8ffd5b479096eb/packages/page-claims/src/index.tsx#L179-L181

it guarded the use of api.query.claims.signing with !isPreclaimed. This causes the statementSentence in Attest.tsx to be undefined as well:

https://github.com/polkadot-js/apps/blob/ec23c9bd9eb06253b6acf169dd8ffd5b479096eb/packages/page-claims/src/Attest.tsx#L57-L60

because of

https://github.com/polkadot-js/apps/blob/ec23c9bd9eb06253b6acf169dd8ffd5b479096eb/packages/page-claims/src/util.ts#L118-L120

resulting in the error message:

https://github.com/polkadot-js/apps/blob/ec23c9bd9eb06253b6acf169dd8ffd5b479096eb/packages/page-claims/src/Attest.tsx#L77-L80

The expected behaviour is to show the statement sentence which requires the statement kind to be looked up or otherwise determined.

jacogr commented 10 months ago

This is sadly a no-touch situation - it has been literally years and I would assume that all claims have been made by now. It is not something that I can test (anymore) since we originally had test cases with the original development for the scenarios.

So in this case, even if there are issues, we know (it sorta) worked and making any changes (without proper tests) is just a complete no-go area. Even worse this was done by members that have since moved on to greener pastures, so the supposed logic is even more hazy as time went on.

So (sadly) I'm filing this in the "wontfix" bucket - even if there are issues found.