From af822c4bb481cc79bf4c4b8f77d2ed10c9db2269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20=C5=BBuk?= Date: Tue, 24 Jan 2023 14:40:41 +0100 Subject: [PATCH] Add support for new proposeRich in democracy --- src/api/nodeRpcCall.js | 5 +++-- src/redux/sagas/wallet.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/nodeRpcCall.js b/src/api/nodeRpcCall.js index 09e4ca86..6f423cee 100644 --- a/src/api/nodeRpcCall.js +++ b/src/api/nodeRpcCall.js @@ -18,7 +18,7 @@ const crossReference = (blockchainData, centralizedData) => ( { ...item, centralizedData: centralizedData.find((cItem) => ( - parseInt(cItem.chainIndex) == parseInt(item.index.toHuman()) + parseInt(cItem.chainIndex) == parseInt(item.index) )), } )) @@ -448,7 +448,8 @@ const submitProposal = async (walletAddress, values, callback) => { const hash = await getProposalHash(values, legislationIndex); const notePreimageTx = api.tx.preimage.notePreimage(hash.extrinsicEncoded); const minDeposit = api.consts.democracy.minimumDeposit; - const proposeTx = api.tx.democracy.propose({ Legacy: hash.encodedHash }, minDeposit); + const proposeCall = parseInt(values.legislationTier) === 0 ? api.tx.democracy.proposeRichOrigin : api.tx.democracy.propose; + const proposeTx = proposeCall({ Legacy: hash.encodedHash }, minDeposit); notePreimageTx.signAndSend(walletAddress, { signer: injector.signer }, ({ status }) => { if (status.isInBlock) { // eslint-disable-next-line no-console diff --git a/src/redux/sagas/wallet.js b/src/redux/sagas/wallet.js index d5b255f8..20fafbf7 100644 --- a/src/redux/sagas/wallet.js +++ b/src/redux/sagas/wallet.js @@ -81,7 +81,7 @@ function* sendTransferLLMWorker(action) { yield put(blockchainActions.setError.success(status.error)); } - if (result === 'success') { + if (status.result === 'success') { yield put(walletActions.sendTransferLLM.success()); yield put(walletActions.getWallet.call()); } else {