From 44ac4ba4a0b9e6a7d8b8df5ce6ed5211762f6667 Mon Sep 17 00:00:00 2001 From: Mak Date: Thu, 18 May 2023 13:33:29 +0100 Subject: [PATCH 1/3] fix: #60, Check if preimage exists on chain before creating a proposal --- .eslintrc.js | 7 +- README.md | 9 +- package.json | 6 +- src/tip-opengov.ts | 93 ++++++--- src/types.ts | 2 +- yarn.lock | 489 +++++++++++++++++++++++++++++---------------- 6 files changed, 403 insertions(+), 203 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 83e4aaa..6c24b91 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,8 @@ const { getConfiguration } = require("opstooling-js-style/src/eslint/configuration"); -module.exports = getConfiguration({ typescript: { rootDir: __dirname } }); +const conf = getConfiguration({ typescript: { rootDir: __dirname } }); + +conf.overrides[0].rules["@typescript-eslint/no-misused-promises"] = "off"; +conf.overrides[0].rules["no-async-promise-executor"] = "off"; + +module.exports = conf; diff --git a/README.md b/README.md index 219f148..6761185 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,14 @@ There are semi-automatic integration tests that execute the tip functions agains | Local Kusama | `docker run --rm -p 9901:9901 parity/polkadot:v0.9.39 --chain=kusama-dev --tmp --alice --execution Native --ws-port 9901 --ws-external --force-kusama` | | Local Polkadot | `docker run --rm -p 9900:9900 parity/polkadot:v0.9.39 --chain=dev --tmp --alice --execution Native --ws-port 9900 --ws-external` | -Note that the node needs to have the OpenGov features - Kusama development chain can be used for that (`--chain=kusama-dev`). +Notes: +- the node needs to have the OpenGov features - Kusama development chain can be used for that (`--chain=kusama-dev`). +- on macos apple silicon chip, you might see error `docker: no matching manifest for linux/arm64/v8 in the manifest list entries.`, + in this case + - close docker desktop, + - open terminal in Rosetta. + - run `open /Applications/Docker.app` + - add `--platform linux/amd64` flag to docker run command after `--rm` With that, run the tests: diff --git a/package.json b/package.json index a7cd7a4..3a8a601 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "test": "NODE_OPTIONS='--experimental-vm-modules --es-module-specifier-resolution=node' jest" }, "dependencies": { - "@polkadot/api": "^10.3.2", - "@polkadot/util": "^11.0.1", - "@polkadot/util-crypto": "^11.0.1", + "@polkadot/api": "^10.7.1", + "@polkadot/util": "^12.2.1", + "@polkadot/util-crypto": "^12.2.1", "opstooling-integrations": "https://github.com/paritytech/opstooling-integrations#v2.0.0", "opstooling-js": "https://github.com/paritytech/opstooling-js#v0.0.14", "probot": "^12.2.8", diff --git a/src/tip-opengov.ts b/src/tip-opengov.ts index 41464ae..e935015 100644 --- a/src/tip-opengov.ts +++ b/src/tip-opengov.ts @@ -2,11 +2,13 @@ import "@polkadot/api-augment"; import "@polkadot/types-augment"; import { ApiPromise } from "@polkadot/api"; import { KeyringPair } from "@polkadot/keyring/types"; +import { ISubmittableResult } from "@polkadot/types/types"; import { blake2AsHex } from "@polkadot/util-crypto"; import assert from "assert"; +import { Probot } from "probot"; import { getChainConfig, getTipUrl } from "./chain-config"; -import { State, TipRequest, TipResult } from "./types"; +import { ContributorAccount, State, TipRequest, TipResult } from "./types"; import { formatReason, tipSizeToOpenGovTrack } from "./util"; export async function tipOpenGov(opts: { @@ -29,40 +31,75 @@ export async function tipOpenGov(opts: { if ("error" in track) { return { success: false, errorMessage: track.error }; } + const contributorAddress = contributor.account.address; const proposalTx = api.tx.utility.batch([ api.tx.system.remark(formatReason(tipRequest)), - api.tx.treasury.spend(track.value.toString(), contributor.account.address), + api.tx.treasury.spend(track.value.toString(), contributorAddress), ]); const encodedProposal = proposalTx.method.toHex(); const proposalHash = blake2AsHex(encodedProposal); + const encodedLength = Math.ceil((encodedProposal.length - 2) / 2); - const preimage_unsub = await api.tx.preimage - .notePreimage(encodedProposal) - .signAndSend(botTipAccount, { nonce: -1 }, (result) => { - if (result.status.isInBlock) { - bot.log(`Preimage Upload included at blockHash ${result.status.asInBlock.toString()}`); - } else if (result.status.isFinalized) { - bot.log(`Preimage Upload finalized at blockHash ${result.status.asFinalized.toString()}`); - preimage_unsub(); - } - }); + console.log(`encodedLength: ${encodedLength}`); - const referenda_unsub = await api.tx.referenda - .submit( - // TODO: There should be a way to set those types properly. - { Origins: track.track } as any, // eslint-disable-line - { Lookup: { hash: proposalHash, length: proposalTx.length - 1 } }, - { after: 10 } as any, // eslint-disable-line - ) - .signAndSend(botTipAccount, { nonce: -1 }, (result) => { - if (result.status.isInBlock) { - bot.log(`Tip referendum included at blockHash ${result.status.asInBlock.toString()}`); - } else if (result.status.isFinalized) { - bot.log(`Tip referendum finalized at blockHash ${result.status.asFinalized.toString()}`); - referenda_unsub(); - } - }); + return await new Promise(async (resolve, reject) => { + // create a preimage from opengov with the encodedProposal above + const preimageUnsubscribe = await api.tx.preimage + .notePreimage(encodedProposal) + .signAndSend(botTipAccount, { nonce: -1 }, async (result) => { + await signAndSendCallback(bot, contributor.account, "preimage", preimageUnsubscribe, result) + .then(async () => { + const readPreimage = await api.query.preimage.statusFor(proposalHash); - return { success: true, tipUrl: getTipUrl(contributor.account.network) }; + if (readPreimage.isEmpty) { + reject(new Error(`Preimage for ${proposalHash} was not found, check if the bot has enough funds.`)); + } + + const proposalUnsubscribe = await api.tx.referenda + .submit( + // TODO: There should be a way to set those types properly. + { Origins: track.track } as never, + { Lookup: { hash: proposalHash, length: proposalTx.length - 1 } }, + { after: 10 } as never, + ) + .signAndSend(botTipAccount, { nonce: -1 }, async (refResult) => { + await signAndSendCallback(bot, contributor.account, "referendum", proposalUnsubscribe, refResult) + .then(resolve) + .catch(reject); + }); + }) + .catch(reject); + }); + }); +} + +async function signAndSendCallback( + bot: Probot, + contributor: ContributorAccount, + type: "preimage" | "referendum", + unsubscribe: () => void, + result: ISubmittableResult, +): Promise { + return await new Promise((resolve, reject) => { + if (result.status.isInBlock) { + bot.log(`${type} for ${contributor.address} included at blockHash ${result.status.asInBlock.toString()}`); + } else if (result.status.isFinalized) { + bot.log(`Tip for ${contributor.address} ${type} finalized at blockHash ${result.status.asFinalized.toString()}`); + unsubscribe(); + resolve({ success: true, tipUrl: getTipUrl(contributor.network) }); + } else if ( + result.status.isDropped || + result.status.isInvalid || + result.status.isUsurped || + result.status.isRetracted || + result.status.isBroadcast + ) { + const msg = `Tip for ${contributor.address} ${type} status is 👎: ${result.status.type}`; + bot.log(msg, result.status); + reject({ success: false, errorMessage: msg }); + } else { + bot.log(`Tip for ${contributor.address} ${type} status: ${result.status.type}`, result.status); + } + }); } diff --git a/src/types.ts b/src/types.ts index b9a8fb8..ec36c03 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,4 +49,4 @@ export type TipRequest = { }; }; -export type TipResult = { success: true; tipUrl: string } | { success: false; errorMessage?: string | undefined }; +export type TipResult = { success: true; tipUrl: string } | { success: false; errorMessage?: string }; diff --git a/yarn.lock b/yarn.lock index 7f31474..a8ac57c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1478,6 +1478,13 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@noble/curves@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.0.0.tgz#e40be8c7daf088aaf291887cbc73f43464a92932" + integrity sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw== + dependencies: + "@noble/hashes" "1.3.0" + "@noble/hashes@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" @@ -1912,70 +1919,70 @@ "@octokit/webhooks-types" "5.6.0" aggregate-error "^3.1.0" -"@polkadot/api-augment@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-10.3.2.tgz#52d4588d715f55dff7c9b0cbabdc04943dd7a493" - integrity sha512-73bzQnjVmOHf/PIzSQru2jqlkVivtIvXoABkq87QIDxsZvUIQPXXIHnVb9C96yJuLE4St22w4y1qI9XSwau96g== - dependencies: - "@polkadot/api-base" "10.3.2" - "@polkadot/rpc-augment" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/types-augment" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/util" "^11.1.3" +"@polkadot/api-augment@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-10.7.1.tgz#14cbf067fe208287a4a37f13de4809802c05ad8f" + integrity sha512-VX4sUXV0bq0/pVFTzVUhSLvcGMZKuUTrajv6bZMPBbSjhIN0aWPX2d+/dsHEaNnqnROU0P/40i0oeFMfjv4tzg== + dependencies: + "@polkadot/api-base" "10.7.1" + "@polkadot/rpc-augment" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-augment" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/api-base@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-10.3.2.tgz#1b7854d34c733b43c7268fa3ef1cb55be42b458b" - integrity sha512-5UPVDmYrxLCfKmCKwaiKqK1s8x3nHbi5vulUDj31P9f///oWZGwjsXdp2hn4FGoEEi1pKuMUK+dRRMEMrj3gPA== +"@polkadot/api-base@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-10.7.1.tgz#445e6687f26f6223b58459bc20a5f57fb1f0835b" + integrity sha512-bgNjwd7I67kSxLzQGpwpGq3nZYb0PdnroAqNNmKVtNms0JGdRsX8j06nJ89XRXDq+bwOXaDslrC3VKgrCm36DA== dependencies: - "@polkadot/rpc-core" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/util" "^11.1.3" - rxjs "^7.8.0" + "@polkadot/rpc-core" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/util" "^12.2.1" + rxjs "^7.8.1" tslib "^2.5.0" -"@polkadot/api-derive@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-10.3.2.tgz#3d2fb8e8b0f6b824300cfda267e92bb4f6afc3df" - integrity sha512-vU6ymw/XykrPZseCgO2BgsX9niRfystXAVUltxO9m/aqZdmf3yeFl+77MwQd9zdLsPOmcoWpiEPRRKWQThqgSA== - dependencies: - "@polkadot/api" "10.3.2" - "@polkadot/api-augment" "10.3.2" - "@polkadot/api-base" "10.3.2" - "@polkadot/rpc-core" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/util" "^11.1.3" - "@polkadot/util-crypto" "^11.1.3" - rxjs "^7.8.0" +"@polkadot/api-derive@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-10.7.1.tgz#14f478894c5c53fe8e7d85d7a2a8e84de3eaf065" + integrity sha512-pyNRe8OrA6iNuYKGO/BlxGmKavzohwAAweVphuZnbWfVUKjuRZEgclHYRq/O+pKrPMm3eIbsHVvFlMnIU+rxFw== + dependencies: + "@polkadot/api" "10.7.1" + "@polkadot/api-augment" "10.7.1" + "@polkadot/api-base" "10.7.1" + "@polkadot/rpc-core" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/util" "^12.2.1" + "@polkadot/util-crypto" "^12.2.1" + rxjs "^7.8.1" tslib "^2.5.0" -"@polkadot/api@10.3.2", "@polkadot/api@^10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-10.3.2.tgz#59236ca7a8f5058a94ee48b8aa085f50ddd8a6d6" - integrity sha512-7lJI9bHHfiepbQvEdgqrt60jmFCw/6FvSqi9R2S9RbYdz/LD0PVF1GavpyU0tWDUfFg+jUGi2Qw4DLml455BiQ== - dependencies: - "@polkadot/api-augment" "10.3.2" - "@polkadot/api-base" "10.3.2" - "@polkadot/api-derive" "10.3.2" - "@polkadot/keyring" "^11.1.3" - "@polkadot/rpc-augment" "10.3.2" - "@polkadot/rpc-core" "10.3.2" - "@polkadot/rpc-provider" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/types-augment" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/types-create" "10.3.2" - "@polkadot/types-known" "10.3.2" - "@polkadot/util" "^11.1.3" - "@polkadot/util-crypto" "^11.1.3" - eventemitter3 "^5.0.0" - rxjs "^7.8.0" +"@polkadot/api@10.7.1", "@polkadot/api@^10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-10.7.1.tgz#a0735f18f3a06041b7bd1330e8bb50dc741230ee" + integrity sha512-6jVYCVlKvQC1HctlZdH3fg28yWb5Wv7IMJn055j66aE+D54z+P8VYdUx17rZsUCWjg6lMlVyzybM9aTm5TE8Sw== + dependencies: + "@polkadot/api-augment" "10.7.1" + "@polkadot/api-base" "10.7.1" + "@polkadot/api-derive" "10.7.1" + "@polkadot/keyring" "^12.2.1" + "@polkadot/rpc-augment" "10.7.1" + "@polkadot/rpc-core" "10.7.1" + "@polkadot/rpc-provider" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-augment" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/types-create" "10.7.1" + "@polkadot/types-known" "10.7.1" + "@polkadot/util" "^12.2.1" + "@polkadot/util-crypto" "^12.2.1" + eventemitter3 "^5.0.1" + rxjs "^7.8.1" tslib "^2.5.0" -"@polkadot/keyring@^11.0.1", "@polkadot/keyring@^11.1.3": +"@polkadot/keyring@^11.0.1": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-11.1.3.tgz#8718f14996ecdb389acffc6ecbe7deb8a2d74b5f" integrity sha512-bzGz1cWDYK7MWhp0630W6KOwTC/wsvKKHBvWxReMT7iQwFHeLn5AemUOveqIPxF+esd/UfdN5aFDHApjYcyZsg== @@ -1984,7 +1991,16 @@ "@polkadot/util-crypto" "11.1.3" tslib "^2.5.0" -"@polkadot/networks@11.1.3", "@polkadot/networks@^11.1.3": +"@polkadot/keyring@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-12.2.1.tgz#d131375c0436115d1f35139bd2bbbc069dd5b9fa" + integrity sha512-YqgpU+97OZgnSUL56DEMib937Dpb1bTTDPYHhBiN1yNCKod7UboWXIe4xPh+1Kzugum+dEyPpdV+fHH10rtDzw== + dependencies: + "@polkadot/util" "12.2.1" + "@polkadot/util-crypto" "12.2.1" + tslib "^2.5.0" + +"@polkadot/networks@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-11.1.3.tgz#e113c98269328267962c2047dccca4d2790cc8a5" integrity sha512-goLpX9SswAGGeh1jXB79wHEfWOF5rLIItMHYalujBmhQVxyAqbxP2tzQqPQXDLcnkWbgwkyYGLXaDD72GBqHZw== @@ -1993,112 +2009,121 @@ "@substrate/ss58-registry" "^1.39.0" tslib "^2.5.0" -"@polkadot/rpc-augment@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-10.3.2.tgz#486c152e222bf14c2489e1b3ff7ac98d90f6cd93" - integrity sha512-P8pUywOtVc5jSoMMhtZSYqyvLNaf2x/tsDaC0sct1yHg5KkXjTCnOgRTepjObgsQWWW5SjKudhhXr8Yfv2XbWQ== +"@polkadot/networks@12.2.1", "@polkadot/networks@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-12.2.1.tgz#ce3e2371e3bd02c9c1b233846b9fe1df4601f560" + integrity sha512-lYLvFv6iQ2UzkP66zJfsiTo2goeaNeKuwiaGoRoFrDwdwVeZK/+rCsz1uAyvbwmpZIaK8K+dTlSBVWlFoAkgcA== + dependencies: + "@polkadot/util" "12.2.1" + "@substrate/ss58-registry" "^1.40.0" + tslib "^2.5.0" + +"@polkadot/rpc-augment@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-10.7.1.tgz#527bfc03b76b197f6126045f67d59fb2d4ec92b6" + integrity sha512-D4msTT74PaiI3M8E8vhXdN9oNyXaKcTpTWzfJvP5m8fj0YrKS+zoZotePyiry5n/Pam2RzwYdiu/vktuDuvn9w== dependencies: - "@polkadot/rpc-core" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/util" "^11.1.3" + "@polkadot/rpc-core" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/rpc-core@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-10.3.2.tgz#07f0a483a3e092db1c2231eebe613faf4606cfbb" - integrity sha512-XUQ6QzcAG7NkhenOtV2zhJjrSsQntmJHfwt8Hp5JZdap/bTsRLGl66N4mrK0Lm5535OiDYFEGXxnLZM10IjtRA== +"@polkadot/rpc-core@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-10.7.1.tgz#d8be2eb85df86d10dc480e3321ec3106df4a1a40" + integrity sha512-XIK28zCVmEpSgnB1DomXNdfMYKUTP5h/bnb+oaWeNUxFxBQtmO1a9UNlZG6thsnma2jlNFVzB0ihR3xoTkka0A== dependencies: - "@polkadot/rpc-augment" "10.3.2" - "@polkadot/rpc-provider" "10.3.2" - "@polkadot/types" "10.3.2" - "@polkadot/util" "^11.1.3" - rxjs "^7.8.0" + "@polkadot/rpc-augment" "10.7.1" + "@polkadot/rpc-provider" "10.7.1" + "@polkadot/types" "10.7.1" + "@polkadot/util" "^12.2.1" + rxjs "^7.8.1" tslib "^2.5.0" -"@polkadot/rpc-provider@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-10.3.2.tgz#2b3347246f9be6f9f360a075eaf862c8fbccf530" - integrity sha512-torI91dgZXPYIjUSU1/YzTK9mK3H/36JZhJFrdrw63PR3Lh5/cdQ8TFJ5gJ2naVXZB/GIOH7GAhm38ByL17wig== - dependencies: - "@polkadot/keyring" "^11.1.3" - "@polkadot/types" "10.3.2" - "@polkadot/types-support" "10.3.2" - "@polkadot/util" "^11.1.3" - "@polkadot/util-crypto" "^11.1.3" - "@polkadot/x-fetch" "^11.1.3" - "@polkadot/x-global" "^11.1.3" - "@polkadot/x-ws" "^11.1.3" - eventemitter3 "^5.0.0" +"@polkadot/rpc-provider@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-10.7.1.tgz#50fa0b90a8e32d6fd04d0776a54a73406c60d104" + integrity sha512-FVaoqtPLb9uhDQb9bE2KSnDqzApsb/hpN57VcylbiUsSACBARGBWrHNAN5rQ8TFN2H6Uv8SqdxTsHeM74Ny2mw== + dependencies: + "@polkadot/keyring" "^12.2.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-support" "10.7.1" + "@polkadot/util" "^12.2.1" + "@polkadot/util-crypto" "^12.2.1" + "@polkadot/x-fetch" "^12.2.1" + "@polkadot/x-global" "^12.2.1" + "@polkadot/x-ws" "^12.2.1" + eventemitter3 "^5.0.1" mock-socket "^9.2.1" - nock "^13.3.0" + nock "^13.3.1" tslib "^2.5.0" optionalDependencies: - "@substrate/connect" "0.7.23" + "@substrate/connect" "0.7.26" -"@polkadot/types-augment@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-10.3.2.tgz#569c0e0758b65a1a993ae26b96cb8395087323e5" - integrity sha512-ECtf8zYak+lJ6eMrQKigUB0FlqoQXPm1bJ5EKCw1Lkgf45sSgAkaY8rHgon4fzbxwVc3JQR7KUiumvRBd1dvnQ== +"@polkadot/types-augment@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-10.7.1.tgz#6d46001c67647385ecfb44fa5944fd9e56a15a99" + integrity sha512-8Yr3iNA9ZU6S0CdR6njM0hx4EBgsm5lZJtytQ8rSxfe8zYOLnh8lz9QLF+iyI+KNFAFwPwfgQ5QwO6zRd8WT+Q== dependencies: - "@polkadot/types" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/util" "^11.1.3" + "@polkadot/types" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/types-codec@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-10.3.2.tgz#eae4fd2e83bdd8cbe78ac2842719b54e07b866ef" - integrity sha512-gsTyg11bcoAhCym8SlNcZ5bPrLUUq86HnWa3Yqq0+Sso+Skc0LO3FwBwbg+HS4EospMqoLnJEt+5CFBStr2M0A== +"@polkadot/types-codec@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-10.7.1.tgz#75854ef2bd7d0b9a4b21a529913afda55af8a64a" + integrity sha512-3VoR1JXFuwt3MQ+E7Vds0UsSRwytS9yo0GtgfP9Nmwt8neQE8JHEd/nAb4JrJFozr3bNRTj+A94wbYk/XB6VKA== dependencies: - "@polkadot/util" "^11.1.3" - "@polkadot/x-bigint" "^11.1.3" + "@polkadot/util" "^12.2.1" + "@polkadot/x-bigint" "^12.2.1" tslib "^2.5.0" -"@polkadot/types-create@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-10.3.2.tgz#8ed5582fc4a0517b19a32fb9bb258ad33e6dcb0d" - integrity sha512-y0kdN75iFtjZ8VJ8+bq2csVIb03FWHQzUohoH0VFrDOs1dAqMTWKBiBTpkEN+Dd9ZyBjsQphgJlMbIEd6Prx+w== +"@polkadot/types-create@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-10.7.1.tgz#84e4b021592f62c16bd9a38d60055752efafa8be" + integrity sha512-DJM7Rog2H7XNbGB18s1PY14yfgRNTIZVzHJxkdkXg5eXDWNmrVbwJFKP8gc469cpND+gooDAJeZ5gToiJEb4Hw== dependencies: - "@polkadot/types-codec" "10.3.2" - "@polkadot/util" "^11.1.3" + "@polkadot/types-codec" "10.7.1" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/types-known@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-10.3.2.tgz#b202e4b0d41e9ba2a0946f5e8e7a8497aefe4de5" - integrity sha512-eNiYCLbGYzjPt4maJuNubhxjebiFoyoAFxzADOXSqQS5dg93GdEa2ZvSNlffp9XYoTi0fqkV2vuDfdvb6tD3Iw== +"@polkadot/types-known@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-10.7.1.tgz#40d275d116458b93631c30192e9cb4d88aa363f3" + integrity sha512-4lff8uE6OcHsvhJYS6/feKnkDGnFd6jOSpi7d5WYDnxTpTbfvaS8UmZ1ZB9P3TjimrnnX+yV/pqFQV9TMA0bjA== dependencies: - "@polkadot/networks" "^11.1.3" - "@polkadot/types" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/types-create" "10.3.2" - "@polkadot/util" "^11.1.3" + "@polkadot/networks" "^12.2.1" + "@polkadot/types" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/types-create" "10.7.1" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/types-support@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-10.3.2.tgz#f2718d9facebbafbcff46434dc9faed2e7d6f556" - integrity sha512-gqYzfj5BfmFWU/f5TaK6MovF9vb4oiOecNKDMsFlH+i3cCUpIYeUDFhYRoPRnfVf4sjLNvgS2NYbl5t5+ymQIQ== +"@polkadot/types-support@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-10.7.1.tgz#f88baac9f9976e1ca86974292af38e533aab3447" + integrity sha512-E7bJfqI9ajCsidRjHiIHTil6av+M+LVfiO9viPjA4PhMp6RIuH6jZ9xUZ6S6hM25zqDwnxtGjx3CPARAx6dwLg== dependencies: - "@polkadot/util" "^11.1.3" + "@polkadot/util" "^12.2.1" tslib "^2.5.0" -"@polkadot/types@10.3.2": - version "10.3.2" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-10.3.2.tgz#b9f475524edba08948ddd72681054fbeaf38249c" - integrity sha512-dwCB2S8yGS2gdvAMlqTiKB+ysGoiZgqhyD+hxpE2JsDtjDHb5q6BCAyeKGnG7BcUHdnspYAt9g0EcjRDkTt5Tw== - dependencies: - "@polkadot/keyring" "^11.1.3" - "@polkadot/types-augment" "10.3.2" - "@polkadot/types-codec" "10.3.2" - "@polkadot/types-create" "10.3.2" - "@polkadot/util" "^11.1.3" - "@polkadot/util-crypto" "^11.1.3" - rxjs "^7.8.0" +"@polkadot/types@10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-10.7.1.tgz#5c2874a718200a21ed4604fe311b40c3e4dad1d4" + integrity sha512-Bb1DiYya0jLVYjyvOeJppJJikj6v1XXyHsj1OpvKK/ErnIGX0Esj8UyakmKxvDf2y0fn4VabCwXviuUIZhUTFg== + dependencies: + "@polkadot/keyring" "^12.2.1" + "@polkadot/types-augment" "10.7.1" + "@polkadot/types-codec" "10.7.1" + "@polkadot/types-create" "10.7.1" + "@polkadot/util" "^12.2.1" + "@polkadot/util-crypto" "^12.2.1" + rxjs "^7.8.1" tslib "^2.5.0" -"@polkadot/util-crypto@11.1.3", "@polkadot/util-crypto@^11.0.1", "@polkadot/util-crypto@^11.1.3": +"@polkadot/util-crypto@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-11.1.3.tgz#c3b166f8f8934a2139c8cfb31af50dae53a9d985" integrity sha512-hjH1y6jXQuceJ2NWx7+ei0sR4A7t844XwlNquPxZX3kQbQS+1t6tO4Eo3/95JhPsEaJOXduus02cYEF6gteEYQ== @@ -2114,7 +2139,23 @@ tslib "^2.5.0" tweetnacl "^1.0.3" -"@polkadot/util@11.1.3", "@polkadot/util@^11.0.1", "@polkadot/util@^11.1.3": +"@polkadot/util-crypto@12.2.1", "@polkadot/util-crypto@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-12.2.1.tgz#cbb0d1535e187af43ddcbac4248298b134f2f3ee" + integrity sha512-MFh7Sdm7/G9ot5eIBZGuQXTYP/EbOCh1+ODyygp9/TjWAmJZMq1J73Uqk4KmzkwpDBpNZO8TGjiYwL8lR6BnGg== + dependencies: + "@noble/curves" "1.0.0" + "@noble/hashes" "1.3.0" + "@polkadot/networks" "12.2.1" + "@polkadot/util" "12.2.1" + "@polkadot/wasm-crypto" "^7.2.1" + "@polkadot/wasm-util" "^7.2.1" + "@polkadot/x-bigint" "12.2.1" + "@polkadot/x-randomvalues" "12.2.1" + "@scure/base" "1.1.1" + tslib "^2.5.0" + +"@polkadot/util@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-11.1.3.tgz#dcdc4504f7c31e6104e7970903d8c1998f3858ef" integrity sha512-Gsqzv1/fSoypS5tnJkM+NJQeT7O4iYlSniubUJnaZVOKsIbueTS1bMQ1y3/h8ISxbKBtICW5cZ6zCej6Q/jC3w== @@ -2127,6 +2168,19 @@ bn.js "^5.2.1" tslib "^2.5.0" +"@polkadot/util@12.2.1", "@polkadot/util@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-12.2.1.tgz#d6c692324890802bc3b2f15b213b7430bb26e8c8" + integrity sha512-MQmPx9aCX4GTpDY/USUQywXRyaDbaibg4V1+c/CoRTsoDu+XHNM8G3lpabdNAYKZrtxg+3/1bTS0ojm6ANSQRw== + dependencies: + "@polkadot/x-bigint" "12.2.1" + "@polkadot/x-global" "12.2.1" + "@polkadot/x-textdecoder" "12.2.1" + "@polkadot/x-textencoder" "12.2.1" + "@types/bn.js" "^5.1.1" + bn.js "^5.2.1" + tslib "^2.5.0" + "@polkadot/wasm-bridge@7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.0.3.tgz#9691450830604dc4a361692a8a2a3df22fa53e96" @@ -2134,6 +2188,14 @@ dependencies: tslib "^2.5.0" +"@polkadot/wasm-bridge@7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.2.1.tgz#8464a96552207d2b49c6f32137b24132534b91ee" + integrity sha512-uV/LHREDBGBbHrrv7HTki+Klw0PYZzFomagFWII4lp6Toj/VCvRh5WMzooVC+g/XsBGosAwrvBhoModabyHx+A== + dependencies: + "@polkadot/wasm-util" "7.2.1" + tslib "^2.5.0" + "@polkadot/wasm-crypto-asmjs@7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.0.3.tgz#a1bc942029979b2696a1062066d774e99a5a6b4c" @@ -2141,6 +2203,13 @@ dependencies: tslib "^2.5.0" +"@polkadot/wasm-crypto-asmjs@7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.2.1.tgz#3e7a91e2905ab7354bc37b82f3e151a62bb024db" + integrity sha512-z/d21bmxyVfkzGsKef/FWswKX02x5lK97f4NPBZ9XBeiFkmzlXhdSnu58/+b1sKsRAGdW/Rn/rTNRDhW0GqCAg== + dependencies: + tslib "^2.5.0" + "@polkadot/wasm-crypto-init@7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.0.3.tgz#336af713edfcd6fdd0194fee2919781893fba577" @@ -2151,6 +2220,17 @@ "@polkadot/wasm-crypto-wasm" "7.0.3" tslib "^2.5.0" +"@polkadot/wasm-crypto-init@7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.2.1.tgz#9dbba41ed7d382575240f1483cf5a139ff2787bd" + integrity sha512-GcEXtwN9LcSf32V9zSaYjHImFw16hCyo2Xzg4GLLDPPeaAAfbFr2oQMgwyDbvBrBjLKHVHjsPZyGhXae831amw== + dependencies: + "@polkadot/wasm-bridge" "7.2.1" + "@polkadot/wasm-crypto-asmjs" "7.2.1" + "@polkadot/wasm-crypto-wasm" "7.2.1" + "@polkadot/wasm-util" "7.2.1" + tslib "^2.5.0" + "@polkadot/wasm-crypto-wasm@7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.0.3.tgz#016834b1eb2564d8a13b133ee77a4612ad873d41" @@ -2159,6 +2239,14 @@ "@polkadot/wasm-util" "7.0.3" tslib "^2.5.0" +"@polkadot/wasm-crypto-wasm@7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.2.1.tgz#d2486322c725f6e5d2cc2d6abcb77ecbbaedc738" + integrity sha512-DqyXE4rSD0CVlLIw88B58+HHNyrvm+JAnYyuEDYZwCvzUWOCNos/DDg9wi/K39VAIsCCKDmwKqkkfIofuOj/lA== + dependencies: + "@polkadot/wasm-util" "7.2.1" + tslib "^2.5.0" + "@polkadot/wasm-crypto@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.0.3.tgz#e07ddbeea0b45149d8e58be292ad423d646f1cb1" @@ -2171,6 +2259,18 @@ "@polkadot/wasm-util" "7.0.3" tslib "^2.5.0" +"@polkadot/wasm-crypto@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.2.1.tgz#db671dcb73f1646dc13478b5ffc3be18c64babe1" + integrity sha512-SA2+33S9TAwGhniKgztVN6pxUKpGfN4Tre/eUZGUfpgRkT92wIUT2GpGWQE+fCCqGQgADrNiBcwt6XwdPqMQ4Q== + dependencies: + "@polkadot/wasm-bridge" "7.2.1" + "@polkadot/wasm-crypto-asmjs" "7.2.1" + "@polkadot/wasm-crypto-init" "7.2.1" + "@polkadot/wasm-crypto-wasm" "7.2.1" + "@polkadot/wasm-util" "7.2.1" + tslib "^2.5.0" + "@polkadot/wasm-util@7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.0.3.tgz#eab59f9dac0f00ca736aff8b24925108b7b2f860" @@ -2178,7 +2278,14 @@ dependencies: tslib "^2.5.0" -"@polkadot/x-bigint@11.1.3", "@polkadot/x-bigint@^11.1.3": +"@polkadot/wasm-util@7.2.1", "@polkadot/wasm-util@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.2.1.tgz#fda233120ec02f77f0d14e4d3c7ad9ce06535fb8" + integrity sha512-FBSn/3aYJzhN0sYAYhHB8y9JL8mVgxLy4M1kUXYbyo+8GLRQEN5rns8Vcb8TAlIzBWgVTOOptYBvxo0oj0h7Og== + dependencies: + tslib "^2.5.0" + +"@polkadot/x-bigint@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-11.1.3.tgz#37b09a12a9ed6df704e047e261f1b8b2ac978497" integrity sha512-fRUUHfW9VFsXT7sLUUY7gSu8v+PvzNLRwvjnp+Ly8vFx9LTLuVGFCi+mpysuRTaPpqZZJlzBJ3fST7xTGh67Pg== @@ -2186,22 +2293,37 @@ "@polkadot/x-global" "11.1.3" tslib "^2.5.0" -"@polkadot/x-fetch@^11.1.3": - version "11.1.3" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-11.1.3.tgz#e39df53fc7fb6399d3883b45d03f6ef7f265a7f9" - integrity sha512-+Z0RxxsN7+l2ZmmDdHqOo0kgqvjXJ1bw8CwTVnq3t9nPgZKn2pC3Fq3xdj/sRWiLuf/UhgCxKfYfMmt5ek4kIg== +"@polkadot/x-bigint@12.2.1", "@polkadot/x-bigint@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-12.2.1.tgz#adb639628626d2a6d7853afff43da20b4db4369a" + integrity sha512-3cZLsV8kU1MFOTcyloeg61CF+qdBkbZxWZJkSjh4AGlPXy+2tKwwoBPExxfCWXK61+Lo/q3/U1+lln8DSBCI2A== dependencies: - "@polkadot/x-global" "11.1.3" + "@polkadot/x-global" "12.2.1" + tslib "^2.5.0" + +"@polkadot/x-fetch@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-12.2.1.tgz#65b447373a0155cae3e546b842ced356d8599c54" + integrity sha512-N2MIcn1g7LVZLZNDEkRkDD/LRY680PFqxziRoqb11SV52kRe6oVsdMIfaWH77UheniRR3br8YiQMUdvBVkak9Q== + dependencies: + "@polkadot/x-global" "12.2.1" node-fetch "^3.3.1" tslib "^2.5.0" -"@polkadot/x-global@11.1.3", "@polkadot/x-global@^11.1.3": +"@polkadot/x-global@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-11.1.3.tgz#4086694f52373fea63910b62da999bf0981d7d86" integrity sha512-R3aqtIjgzFHJ3TyX6wavhp+59oLbZiqczIHkaas/nJe21+SVARqFmIII6BwS7ty7+8Uu4fHliA9re+ZSUp+rwg== dependencies: tslib "^2.5.0" +"@polkadot/x-global@12.2.1", "@polkadot/x-global@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-12.2.1.tgz#42e798e9607a4d7667469d91225c030fb3e8c8b5" + integrity sha512-JNMziAZjvfzMrXASuBPCvSzEqlhsgw0x95SOBtqJWsxmbCMAiZbYAC51vI1B9Z9wiKuzPtSh9Sk7YHsUOGCrIQ== + dependencies: + tslib "^2.5.0" + "@polkadot/x-randomvalues@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-11.1.3.tgz#48dde21012aa4eef3bd00d46f545861727fb6618" @@ -2210,6 +2332,14 @@ "@polkadot/x-global" "11.1.3" tslib "^2.5.0" +"@polkadot/x-randomvalues@12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-12.2.1.tgz#00c3f097f987b9ff70dbd2720086ad3d0bc16cfb" + integrity sha512-NwSDLcLjgHa0C7Un54Yhg2/E3Y/PcVfW5QNB9TDyzDbkmod3ziaVhh0iWG0sOmm26K6Q3phY+0uYt0etq0Gu3w== + dependencies: + "@polkadot/x-global" "12.2.1" + tslib "^2.5.0" + "@polkadot/x-textdecoder@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-11.1.3.tgz#1d1e2aa86e47587393a6acb74a086ab97d62058d" @@ -2218,6 +2348,14 @@ "@polkadot/x-global" "11.1.3" tslib "^2.5.0" +"@polkadot/x-textdecoder@12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-12.2.1.tgz#a426a1d8a3b5717859b81a7341b16de4de3d78c0" + integrity sha512-5nQCIwyaGS0fXU2cbtMOSjFo0yTw1Z94m/UC+Gu5lm3ZU+kK4DpKFxhfLQORWAbvQkn12chRj3LI5Gm944hcrQ== + dependencies: + "@polkadot/x-global" "12.2.1" + tslib "^2.5.0" + "@polkadot/x-textencoder@11.1.3": version "11.1.3" resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-11.1.3.tgz#ba7621b636dcfa6ca4ab6176a6a52eef15904a72" @@ -2226,12 +2364,20 @@ "@polkadot/x-global" "11.1.3" tslib "^2.5.0" -"@polkadot/x-ws@^11.1.3": - version "11.1.3" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-11.1.3.tgz#5a759bcbbbdceeecca53bcc74170e52cd3ca774b" - integrity sha512-omNU2mIVX997HiHm2YxEdJdyCFnv+oTyKWZd0+FdS47rdfhVwD+H9/bS+rtQ9lIqfhODdGmw3fG//gq1KpYJcw== +"@polkadot/x-textencoder@12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-12.2.1.tgz#f606c9929668bb41a23ec25c9752252bb56b0c9b" + integrity sha512-Ou6OXypRsJloK5a7Kn7re3ImqcL26h22fVw1cNv4fsTgkRFUdJDgPux2TpCZ3N+cyrfGVv42xKYFbdKMQCczjg== dependencies: - "@polkadot/x-global" "11.1.3" + "@polkadot/x-global" "12.2.1" + tslib "^2.5.0" + +"@polkadot/x-ws@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-12.2.1.tgz#8774bc8cd38194354e48fc92438c4ebb52929fce" + integrity sha512-jPfNR/QFwPmXCk9hGEAyCo50xBNHm3s+XavmpHEKQSulnLn5des5X/pKn+g8ttaO9nqrXYnUFO6VEmILgUa/IQ== + dependencies: + "@polkadot/x-global" "12.2.1" tslib "^2.5.0" ws "^8.13.0" @@ -2388,20 +2534,25 @@ resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== -"@substrate/connect@0.7.23": - version "0.7.23" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.23.tgz#67c60f6498b5e61a654f5f64cebb7495bbafeaad" - integrity sha512-zlfI76HdUJszQWG7Dpwd0g7jjQv6LNZtE6Kd7OWv4OdpHJa1VpL2jGjg7YdLhwtx7qxqOuRiak1H+5KrsavzRQ== +"@substrate/connect@0.7.26": + version "0.7.26" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.26.tgz#a0ee5180c9cb2f29250d1219a32f7b7e7dea1196" + integrity sha512-uuGSiroGuKWj1+38n1kY5HReer5iL9bRwPCzuoLtqAOmI1fGI0hsSI2LlNQMAbfRgr7VRHXOk5MTuQf5ulsFRw== dependencies: "@substrate/connect-extension-protocol" "^1.0.1" eventemitter3 "^4.0.7" - smoldot "1.0.1" + smoldot "1.0.4" "@substrate/ss58-registry@^1.39.0": version "1.39.0" resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.39.0.tgz#eb916ff5fea7fa02e77745823fde21af979273d2" integrity sha512-qZYpuE6n+mwew+X71dOur/CbMXj6rNW27o63JeJwdQH/GvcSKm3JLNhd+bGzwUKg0D/zD30Qc6p4JykArzM+tA== +"@substrate/ss58-registry@^1.40.0": + version "1.40.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.40.0.tgz#2223409c496271df786c1ca8496898896595441e" + integrity sha512-QuU2nBql3J4KCnOWtWDw4n1K4JU0T79j54ZZvm/9nhsX6AIar13FyhsaBfs6QkJ2ixTQAnd7TocJIoJRWbqMZA== + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -4018,10 +4169,10 @@ eventemitter3@^4.0.7: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -eventemitter3@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.0.tgz#084eb7f5b5388df1451e63f4c2aafd71b217ccb3" - integrity sha512-riuVbElZZNXLeLEoprfNYoDSwTBRR44X3mnhdI1YcnENpWTCsTTVZ2zFuqQcpoyqPQIUXdiPEU0ECAq0KQRaHg== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== eventsource@^1.0.7: version "1.1.0" @@ -5766,10 +5917,10 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nock@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.0.tgz#b13069c1a03f1ad63120f994b04bfd2556925768" - integrity sha512-HHqYQ6mBeiMc+N038w8LkMpDCRquCHWeNmN3v6645P3NhN2+qXOBqvPqo7Rt1VyCMzKhJ733wZqw5B7cQVFNPg== +nock@^13.3.1: + version "13.3.1" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.1.tgz#f22d4d661f7a05ebd9368edae1b5dc0a62d758fc" + integrity sha512-vHnopocZuI93p2ccivFyGuUfzjq2fxNyNurp7816mlT5V5HF4SzXu8lvLrVzBbNqzs+ODooZ6OksuSUNM7Njkw== dependencies: debug "^4.1.0" json-stringify-safe "^5.0.1" @@ -6601,10 +6752,10 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== dependencies: tslib "^2.1.0" @@ -6757,10 +6908,10 @@ smee-client@^1.2.2: superagent "^5.0.2" validator "^10.11.0" -smoldot@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-1.0.1.tgz#1749b62ddf75667a05dca2a52d8681596accf932" - integrity sha512-48M9tLU+5q0XHFUCuGULraghfqQU/yARkdcYZzulFB38f2aw4ujTHzlbE+bhiJ8+h63uoXdAQO0WeCsWDTXGkA== +smoldot@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-1.0.4.tgz#e4c38cedad68d699a11b5b9ce72bb75c891bfd98" + integrity sha512-N3TazI1C4GGrseFH/piWyZCCCRJTRx2QhDfrUKRT4SzILlW5m8ayZ3QTKICcz1C/536T9cbHHJyP7afxI6Mi1A== dependencies: pako "^2.0.4" ws "^8.8.1" From 4315da8ad402923ab8e5ba1e1e3589cfaece9623 Mon Sep 17 00:00:00 2001 From: Mak Date: Thu, 18 May 2023 13:44:36 +0100 Subject: [PATCH 2/3] remove console.log --- src/tip-opengov.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tip-opengov.ts b/src/tip-opengov.ts index e935015..a100766 100644 --- a/src/tip-opengov.ts +++ b/src/tip-opengov.ts @@ -39,9 +39,6 @@ export async function tipOpenGov(opts: { ]); const encodedProposal = proposalTx.method.toHex(); const proposalHash = blake2AsHex(encodedProposal); - const encodedLength = Math.ceil((encodedProposal.length - 2) / 2); - - console.log(`encodedLength: ${encodedLength}`); return await new Promise(async (resolve, reject) => { // create a preimage from opengov with the encodedProposal above From 50aadc113d5f6e3d3817f6ad869a0c58cead9640 Mon Sep 17 00:00:00 2001 From: Mak Date: Fri, 19 May 2023 18:20:02 +0100 Subject: [PATCH 3/3] Fix length for Lookup --- src/tip-opengov.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tip-opengov.ts b/src/tip-opengov.ts index a100766..444b20e 100644 --- a/src/tip-opengov.ts +++ b/src/tip-opengov.ts @@ -39,6 +39,7 @@ export async function tipOpenGov(opts: { ]); const encodedProposal = proposalTx.method.toHex(); const proposalHash = blake2AsHex(encodedProposal); + const encodedLength = Math.ceil((encodedProposal.length - 2) / 2); return await new Promise(async (resolve, reject) => { // create a preimage from opengov with the encodedProposal above @@ -57,7 +58,7 @@ export async function tipOpenGov(opts: { .submit( // TODO: There should be a way to set those types properly. { Origins: track.track } as never, - { Lookup: { hash: proposalHash, length: proposalTx.length - 1 } }, + { Lookup: { hash: proposalHash, len: encodedLength } }, { after: 10 } as never, ) .signAndSend(botTipAccount, { nonce: -1 }, async (refResult) => {