Closed RoyTimes closed 3 years ago
Yes, this is a bug. api.registry.chainSS58
will be set correctly after api.isReady
. But the keyring's ss58 doesn't seem to be set. I'm not sure if I should override the api.isReady
method and add keyring.setSS58Format(...)
to api.isReady
. I would like api.registry.chainSS58
and keyring.ss58
to be consistent. Feel free to submit pr.
I'm also getting TypeError: Cannot read property 'blockWeights' of undefined
from node_modules/@redspot/patract/contract.js:28:59)
on populateTransaction
. When I went into the source of it and tried to print out contract.api.const
at https://github.com/patractlabs/redspot/blob/8379e0ed8f1012f0f6acc58e34e4cb153f04c45d/packages/redspot-patract/src/contract.ts#L65 ... it's printing out {}
These are unknown territories of mine but I would guess these two issues are linked.
I'm afraid they may not be linked to each other. I wasn't able to reproduce the problem, and I think it's possible that it was caused by some modification you made.
The TypeError: Cannot read property 'blockWeights' of undefined
was triggered when I tried to run a script w/npx redspot run script/script.ts
. npx redspot test
works fine.
I'll look into it this week and try to figure out what's happening. Will update here if I can give instructions to reproduce or figure out how I caused the error myself.
ok, Note that to use the api, await api.isReady
first;
Fixed in version 0.10.2-6 https://github.com/patractlabs/redspot/commit/ab1cba018055a7815046aba3d1de8172d0a2cc57
I have been using https://github.com/patractlabs/patract to run a local blockchain node. While Patract is using ss58 prefix 26, I seems to get a ss58 prefix 42 address from
signer.address
To reproduce: seed phrase:
collect fiscal multiply word slice milk ahead donkey often filter cliff ancient
signer.address:5CLkFCxF1FcQ3oT9KmhpSx8YmZu3eJydG3d7CogxmcnxDvkF
which seems to be ass58Format 42
From
packages/redspot-core/src/provider/construction.ts
while the ss58Format is not set and I assume Polkadot.js set it to
42
by default. To queryconst system.ss58Prefix: u8
which will yield the correct prefix.I'm not sure if I'm understanding it right or just being an idiot. Please let me know. I can draft up a PR if this is indeed an issue.