diff --git a/Cargo.lock b/Cargo.lock index facbb00506..a550d3da26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8558,10 +8558,10 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "sc-client-api", - "sp-authorship 3.0.0 (git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc)", + "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7)", "sp-runtime", "thiserror", ] @@ -8569,10 +8569,10 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "sc-client-api", - "sp-authorship 3.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7)", + "sp-authorship 3.0.0 (git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc)", "sp-runtime", "thiserror", ] @@ -8782,7 +8782,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "hash-db", "lazy_static", @@ -8801,7 +8801,7 @@ dependencies = [ [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "hash-db", "lazy_static", @@ -9747,7 +9747,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "async-trait", "parity-scale-codec", @@ -9759,7 +9759,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "async-trait", "parity-scale-codec", @@ -10029,7 +10029,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "lazy_static", "sp-core", @@ -10040,7 +10040,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.7#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "git+https://github.com/paritytech//substrate?rev=9c572625f6557dfdb19f47474369a0327d51dfbc#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "lazy_static", "sp-core", diff --git a/js/pint-types-bundle/index.ts b/js/pint-types-bundle/index.ts index eb9c061363..363f4b6fba 100644 --- a/js/pint-types-bundle/index.ts +++ b/js/pint-types-bundle/index.ts @@ -2,99 +2,14 @@ import { OverrideBundleDefinition, OverrideBundleType, } from "@polkadot/types/types"; +import PINTTypes from "./pint.json"; export const definitions = { types: [ { // on all versions minmax: [0, undefined], - types: { - Address: "MultiAddress", - LookupSource: "MultiAddress", - LookupSourceFor: "LookupSource", - Action: "Call", - AssetId: "u32", - AccountIdFor: "AccountId", - AccountBalance: { - available: "Balance", - reserved: "Balance", - }, - AssetAvailability: { - _enum: { - Liquid: "MultiLocation", - Saft: null, - }, - }, - AssetWithdrawal: { - asset: "AssetId", - state: "RedemptionState", - units: "Balance", - }, - Balance: "u128", - BalanceFor: "Balance", - CommitteeMember: { - account_id: "AccountId", - member_type: "MemberType", - }, - CurrencyId: "AssetId", - CurrencyIdOf: "CurrencyId", - FeedId: "u64", - FeedIdFor: "FeedId", - HashFor: "Hash", - IndexAssetData: { - units: "Balance", - availability: "AssetAvailability", - }, - MemberType: { - _enum: { - Council: null, - Constituent: null, - }, - }, - MemberVote: { - member: "CommitteeMember", - vote: "Vote", - }, - PendingRedemption: { - initiated: "BlockNumber", - assets: "Vec", - }, - ProposalNonce: "u32", - ProxyType: { - _enum: ["Any", "NonTransfer", "Governance", "Staking"], - }, - ProxyState: { - added: "Vec", - }, - RedemptionState: { - _enum: { - Initiated: null, - Unbonding: null, - Transferred: null, - }, - }, - SAFTRecord: { - nav: "Balance", - units: "Balance", - }, - StakingBondState: { - controller: "LookupSourceFor", - bonded: "Balance", - unbonded: "Balance", - unlocked_chunks: "u32", - }, - Vote: { - _enum: { - Aye: null, - Nay: null, - Abstain: null, - }, - }, - VoteAggregate: { - votes: "Vec", - end: "BlockNumber", - }, - }, + types: PINTTypes, }, ], } as OverrideBundleDefinition; diff --git a/js/pint-types-bundle/pint.json b/js/pint-types-bundle/pint.json new file mode 100644 index 0000000000..2b9546a881 --- /dev/null +++ b/js/pint-types-bundle/pint.json @@ -0,0 +1,152 @@ +{ + "Address": "MultiAddress", + "LookupSource": "MultiAddress", + "LookupSourceFor": "LookupSource", + "Action": "Call", + "AssetId": "u32", + "AccountIdFor": "AccountId", + "AccountBalance": { + "available": "Balance", + "reserved": "Balance" + }, + "AssetAvailability": { + "_enum": { + "Liquid": "MultiLocation", + "Saft": null + } + }, + "AssetWithdrawal": { + "asset": "AssetId", + "state": "RedemptionState", + "units": "Balance" + }, + "Balance": "u128", + "BalanceFor": "Balance", + "CommitteeMember": { + "account_id": "AccountId", + "member_type": "MemberType" + }, + "CurrencyId": "AssetId", + "CurrencyIdOf": "CurrencyId", + "HashFor": "Hash", + "IndexAssetData": { + "units": "Balance", + "availability": "AssetAvailability" + }, + "MemberType": { + "_enum": { + "Council": null, + "Constituent": null + } + }, + "MemberVote": { + "member": "CommitteeMember", + "vote": "Vote" + }, + "PendingRedemption": { + "initiated": "BlockNumber", + "assets": "Vec" + }, + "ProposalNonce": "u32", + "ProxyType": { + "_enum": ["Any", "NonTransfer", "Governance", "Staking"] + }, + "ProxyState": { + "added": "Vec" + }, + "RedemptionState": { + "_enum": { + "Initiated": null, + "Unbonding": null, + "Transferred": null + } + }, + "SAFTRecord": { + "nav": "Balance", + "units": "Balance" + }, + "StakingBondState": { + "controller": "LookupSourceFor", + "bonded": "Balance", + "unbonded": "Balance", + "unlocked_chunks": "u32" + }, + "Vote": { + "_enum": { + "Aye": null, + "Nay": null, + "Abstain": null + } + }, + "VoteAggregate": { + "votes": "Vec", + "end": "BlockNumber" + }, + "SpecIndex": "Vec", + "RequestIdentifier": "u64", + "DataVersion": "u64", + "FeedId": "u64", + "FeedIdFor": "FeedId", + "RoundId": "u32", + "Value": "u128", + "FeedConfig": { + "owner": "AccountId", + "pending_owner": "Option", + "submission_value_bounds": "(Value, Value)", + "submission_count_bounds": "(u32, u32)", + "payment": "Balance", + "timeout": "BlockNumber", + "decimals": "u8", + "description": "Vec", + "restart_delay": "RoundId", + "reporting_round": "RoundId", + "latest_round": "RoundId", + "first_valid_round": "Option", + "oracle_count": "u32", + "pruning_window": "RoundId", + "next_round_to_prune": "RoundId", + "debt": "Balance", + "max_debt": "Option" + }, + "FeedConfigOf": "FeedConfig", + "Round": { + "started_at": "BlockNumber", + "answer": "Option", + "updated_at": "Option", + "answered_in_round": "Option" + }, + "RoundOf": "Round", + "RoundDetails": { + "submissions": "Vec", + "submission_count_bounds": "(u32, u32)", + "payment": "Balance", + "timeout": "BlockNumber" + }, + "RoundDetailsOf": "RoundDetails", + "OracleMeta": { + "withdrawable": "Balance", + "admin": "AccountId", + "pending_admin": "Option" + }, + "OracleMetaOf": "OracleMeta", + "OracleStatus": { + "starting_round": "RoundId", + "ending_round": "Option", + "last_reported_round": "Option", + "last_started_round": "Option", + "latest_submission": "Option" + }, + "OracleStatusOf": "OracleStatus", + "Requester": { + "delay": "RoundId", + "last_started_round": "Option" + }, + "RoundData": { + "started_at": "BlockNumber", + "answer": "Value", + "updated_at": "BlockNumber", + "answered_in_round": "RoundId" + }, + "RoundDataOf": "RoundData", + "SubmissionBounds": "(u32, u32)" +} diff --git a/node/build.rs b/node/build.rs index 9774323c63..226c826cfd 100644 --- a/node/build.rs +++ b/node/build.rs @@ -1,9 +1,16 @@ // Copyright 2021 ChainSafe Systems // SPDX-License-Identifier: LGPL-3.0-only +use std::fs; + +const PINT_TYPES_SOURCE: &'static str = "../js/pint-types-bundle/pint.json"; +const PINT_TYPES_TARGET: &'static str = "../resources/types.json"; use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; fn main() { generate_cargo_keys(); rerun_if_git_head_changed(); + + // Generate PINT types + fs::copy(PINT_TYPES_SOURCE, PINT_TYPES_TARGET).expect("Generate PINT types failed"); }