Skip to content

Commit

Permalink
added a pallet for distributing vortex token
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj5031 committed Nov 8, 2023
1 parent 2d5a55d commit cb647ff
Show file tree
Hide file tree
Showing 19 changed files with 7,735 additions and 407 deletions.
925 changes: 526 additions & 399 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use sc_service::ChainType;
use seed_runtime::{
constants::{
ONE_ROOT, ONE_XRP, ROOT_ASSET_ID, ROOT_DECIMALS, ROOT_MINIMUM_BALANCE, ROOT_NAME,
ROOT_SYMBOL, XRP_ASSET_ID, XRP_DECIMALS, XRP_MINIMUM_BALANCE, XRP_NAME, XRP_SYMBOL,
ROOT_SYMBOL, VTX_ASSET_ID, VTX_DECIMALS, VTX_MINIMUM_BALANCE, VTX_NAME, VTX_SYMBOL,
XRP_ASSET_ID, XRP_DECIMALS, XRP_MINIMUM_BALANCE, XRP_NAME, XRP_SYMBOL,
},
keys::*,
AccountId, AssetsConfig, BabeConfig, Balance, BalancesConfig, EthBridgeConfig, GenesisConfig,
Expand Down Expand Up @@ -153,10 +154,12 @@ fn testnet_genesis(
ROOT_DECIMALS,
),
(XRP_ASSET_ID, XRP_NAME.as_bytes().to_vec(), XRP_SYMBOL.as_bytes().to_vec(), XRP_DECIMALS),
(VTX_ASSET_ID, VTX_NAME.as_bytes().to_vec(), VTX_SYMBOL.as_bytes().to_vec(), VTX_DECIMALS),
];
let assets = vec![
(ROOT_ASSET_ID, root_key, true, ROOT_MINIMUM_BALANCE),
(XRP_ASSET_ID, root_key, true, XRP_MINIMUM_BALANCE),
(VTX_ASSET_ID, root_key, true, VTX_MINIMUM_BALANCE),
];
let mut endowed_assets = Vec::with_capacity(accounts_to_fund.len());
let mut endowed_balances = Vec::with_capacity(accounts_to_fund.len());
Expand Down
5,000 changes: 5,000 additions & 0 deletions e2e/common/generated_users.txt

Large diffs are not rendered by default.

25 changes: 22 additions & 3 deletions e2e/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { JsonRpcProvider } from "@ethersproject/providers";
import { ApiPromise } from "@polkadot/api";
import { ApiPromise, Keyring } from "@polkadot/api";
import { SubmittableExtrinsic } from "@polkadot/api/types";
import { KeyringPair } from "@polkadot/keyring/types";
import { AnyJson } from "@polkadot/types/types";
import { BigNumber } from "ethers";
import { writeFileSync } from "fs";
import fs, { writeFileSync } from "fs";
import { CliPrettify } from "markdown-table-prettify";
import { join } from "path";
import path, { join } from "path";
import web3 from "web3";

export * from "./node";
Expand Down Expand Up @@ -644,3 +644,22 @@ export const executeForPreviousEvent = async (
currentInHistory++;
}
};

export const loadTestUsers = (userAmount?: number): KeyringPair[] => {
const content = fs.readFileSync(path.resolve(__dirname, "./generated_users.txt"), "utf-8");
const mnemonics = content
.replace(/\n{2,}/g, "\n")
.toString()
.split("\n");
const keyring = new Keyring({ type: "ethereum" });
const keypairs: KeyringPair[] = [];

for (let i = 0; i < mnemonics.length; i++) {
const mnemonic = mnemonics[i];
if (mnemonic !== "" && (userAmount === undefined || i < userAmount)) {
keypairs.push(keyring.addFromMnemonic(mnemonic, {}));
}
}
console.log(`loaded ${keypairs.length} users`);
return keypairs;
};
2 changes: 1 addition & 1 deletion e2e/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const config: HardhatUserConfig = {
apiKey: process.env.ETHERSCAN_API_KEY,
},
mocha: {
timeout: 120_000, // global tests timeout
timeout: 12_000_000, // global tests timeout
},
};

Expand Down
Loading

0 comments on commit cb647ff

Please sign in to comment.