Skip to content

Commit

Permalink
Fix claim transaction (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser authored Oct 6, 2023
1 parent bd3a81f commit f289df1
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/components/crowdloan-user/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hash>', 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)
Expand Down

0 comments on commit f289df1

Please sign in to comment.