Skip to content

Commit

Permalink
Merge branch 'main' into update-oct17
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-black authored Oct 17, 2023
2 parents 1484710 + f289df1 commit 6bd2108
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion functions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"lib": ["ES2020"],
"module": "commonjs",
"resolveJsonModule": true,
"sourceMap": false,
"esModuleInterop": true,
"sourceMap": false,
"forceConsistentCasingInFileNames": true,
"strict": false,
"skipLibCheck": true,
Expand Down
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 6bd2108

Please sign in to comment.