2

Context: I need to put some data on vesting pallet. There is no such things as setVestedStorage, so I need to use system.setStorage (api.tx.system.storage for the complete form) from the polkadotjs API

The problem is that I can't find ANY documentation on this function, the only thing i know is it's interface: setStorage(Vec<Bytes, Bytes>), and that the first bytes parameter are the "old bytes", and the second the "new bytes" (according to the only appearance of setStorage in substrate github repo), but that's all.

How do I get the old bytes ? How do I get the new bytes ? Especially as I use the function in a js script. How am I supposed to call this function ? Do I have to call it multiple times if I have an enormous amount of data (200k entries), or can I call it a single time ?

1 Answer 1

2

Not sure, which docs this is referring to. But this would be the extrinsic that is called https://github.com/paritytech/substrate/blob/ee3eb8f2448cc1bb978c5d1564febd351c128bb0/frame/system/src/lib.rs#L442.

So it’s rather a Key and a Value to set in storage. In your case you would need to set the key and the value accordingly to the vesting storage-map (https://github.com/paritytech/substrate/blob/ee3eb8f2448cc1bb978c5d1564febd351c128bb0/frame/vesting/src/lib.rs#L194).

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.