From f289df1ca0a4485b8bf10349b08460c0d346b7ea Mon Sep 17 00:00:00 2001 From: Onno Visser Date: Fri, 6 Oct 2023 16:07:36 +0200 Subject: [PATCH] Fix claim transaction (#713) --- src/components/crowdloan-user/User.tsx | 27 ++++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/components/crowdloan-user/User.tsx b/src/components/crowdloan-user/User.tsx index 1968b784..a5a702fc 100644 --- a/src/components/crowdloan-user/User.tsx +++ b/src/components/crowdloan-user/User.tsx @@ -33,25 +33,18 @@ export function User() { if (!['sr25519', 'ed25519', 'ecdsa'].includes(verification.crypto)) { throw new Error('Verification of signature failed with given account.') } - const signatureTypeMulti = api.createType('MultiSignature', { - [verification.crypto]: signature, - }) - - const proofType = api.createType('Proof', { - leafHash: api.createType('Hash', proof.proof.leafHash), - sortedHashes: api.createType('Vec', proof.proof.sortedHashes), - }) - - const amountType = api.createType('Balance', proof.contribution) - - const accountId = api.createType('AccountId', decodeAddress(address)) const submittable = api.tx.crowdloanClaim.claimReward( - accountId, - accountId, - signatureTypeMulti, - proofType, - amountType + address, + address, + { + [verification.crypto]: signature, + }, + { + leafHash: proof.proof.leafHash, + sortedHashes: proof.proof.sortedHashes, + }, + proof.contribution ) return cent.wrapSignAndSend(api, submittable, options)