moonbeam-foundation / cli-ts-signer

Typescript based cli signer for both Substrate and Ethereum Transactions
GNU General Public License v3.0
1 stars 1 forks source link

fix: unable to call no-param extrinsic #29

Open hahaschool opened 2 years ago

hahaschool commented 2 years ago

Hi guys,

I'm a collator on Moonbeam network (also an orbiter on MOVR) and have some needs to sign no-param extrinsics like moonbeamOrbiters.orbiterRegister() offline. But I found this offline sign always convert an empty param list to a one-item array so I made some modifications to make it work.

Before the fix, I will get:

./moonbeam-signer-macos createAndSendTx "moonbeam" wss://wss.api.moonbeam.network "<our_orbiter_address>" "moonbeamOrbiters.orbiterRegister" ""

Error: Extrinsic moonbeamOrbiters.orbiterRegister expects 0 arguments, got 1.
    at assert (/snapshot/dist/index.js)
    at extrinsicFn (/snapshot/dist/index.js)
    at Object.decorated [as orbiterRegister] (/snapshot/dist/index.js)
    at createAndSendTx (/snapshot/dist/index.js)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Object.handler (/snapshot/dist/index.js)

After fix, it could work.

Feel free to contact if there's any issue. Many Thanks!

Adam

crystalin commented 2 years ago

You need to use the new version, you can then pass the empty params:

npm run cli -- createAndSendTx  --network moonbase --ws wss://wss.api.moonbeam.network --address "<your_address>" --tx moonbeamOrbiters.orbiterRegister --params []
hahaschool commented 2 years ago

You need to use the new version, you can then pass the empty params:

npm run cli -- createAndSendTx  --network moonbase --ws wss://wss.api.moonbeam.network --address "<your_address>" --tx moonbeamOrbiters.orbiterRegister --params []

Thanks for the info!