Skip to content

Commit

Permalink
chore: bump sdks (#1960)
Browse files Browse the repository at this point in the history
Signed-off-by: GopherJ <alex_cj96@foxmail.com>
  • Loading branch information
GopherJ committed Jan 3, 2024
1 parent 8330060 commit efa2146
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 1,183 deletions.
12 changes: 6 additions & 6 deletions scripts/helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"lint": "eslint . --ext .ts --fix"
},
"devDependencies": {
"@polkadot/types": "^8.3.2-2",
"@types/node": "^17.0.21",
"@types/shelljs": "^0.8.9",
"@typescript-eslint/eslint-plugin": "5.12.1",
Expand All @@ -24,11 +23,12 @@
},
"dependencies": {
"@caporal/core": "^2.0.2",
"@polkadot/api": "^8.3.2-2",
"@polkadot/keyring": "^9.1.1",
"@polkadot/rpc-core": "^8.3.2-2",
"@polkadot/util": "^9.1.1",
"@polkadot/util-crypto": "^9.1.1",
"@polkadot/api": "^10.11.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-core": "^10.11.2",
"@polkadot/types": "^10.11.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"axios": "^0.27.2",
"bignumber.js": "^9.0.2",
"dotenv": "^16.0.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/helper/src/commands/democracy/runtime-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export default function ({ createCommand }: CreateCommandParameters): Command {
const encoded = api.tx.parachainSystem.authorizeUpgrade(codeHash).method.toHex()
const encodedHash = blake2AsHex(encoded)

const external = api.tx.democracy.externalProposeMajority(encodedHash)
const external = api.tx.democracy.externalProposeMajority({ Legacy: encodedHash })

const tx = api.tx.utility.batchAll([
api.tx.democracy.notePreimage(encoded),
api.tx.preimage.notePreimage(encoded),
api.tx.generalCouncil.propose(await getCouncilThreshold(api), external, external.length)
])
if (dryRun) {
Expand Down
14 changes: 11 additions & 3 deletions scripts/helper/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,26 @@ export const createAddress = (id: string): string =>

export const sovereignRelayOf = (paraId: number): string =>
encodeAddress(
u8aConcat(stringToU8a('para'), bnToU8a(paraId, 32, true), EMPTY_U8A_32).subarray(0, 32)
u8aConcat(
stringToU8a('para'),
bnToU8a(paraId, { bitLength: 32, isLe: true }),
EMPTY_U8A_32
).subarray(0, 32)
)

export const sovereignParaOf = (paraId: number): string =>
encodeAddress(
u8aConcat(stringToU8a('sibl'), bnToU8a(paraId, 32, true), EMPTY_U8A_32).subarray(0, 32)
u8aConcat(
stringToU8a('sibl'),
bnToU8a(paraId, { bitLength: 32, isLe: true }),
EMPTY_U8A_32
).subarray(0, 32)
)

export const subAccountId = (address: string, index: number): string => {
const seedBytes = stringToU8a('modlpy/utilisuba')
const whoBytes = decodeAddress(address)
const indexBytes = bnToU8a(index, 16).reverse()
const indexBytes = bnToU8a(index, { bitLength: 16 }).reverse()
const combinedBytes = new Uint8Array(seedBytes.length + whoBytes.length + indexBytes.length)
combinedBytes.set(seedBytes)
combinedBytes.set(whoBytes, seedBytes.length)
Expand Down
Loading

0 comments on commit efa2146

Please sign in to comment.