@xyo-network/chain-sdk 1.7.13 → 1.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/test/evm/stakingContractUtils.d.ts.map +1 -1
- package/dist/neutral/test/evm/stakingContractUtils.d.ts.map +1 -1
- package/dist/node/index-node.mjs +1 -2
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/test/evm/stakingContractUtils.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/e2e/spec/EvmChainService.spec.ts +1 -1
- package/src/test/evm/setup.ts +1 -1
- package/src/test/evm/stakingContractUtils.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAehF,eAAO,MAAM,eAAe,GAAU,aAAa,MAAM,EAAE,YAAY,MAAM,EAAE,iBAAiB,cAAc,KAAG,OAAO,CAAC,OAAO,CAW/H,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,UAAU,cAAc,EAAE,UAAU,cAAc,kBAWtI,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,aAAa,MAAM,EACnB,cAAc,OAAO,EACrB,UAAU,cAAc,EACxB,iBAAiB,eAAe,KAC/B,OAAO,CAAC,OAAO,CAcjB,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,yBAAyB,OAAO,EAAE,UAAU,cAAc,kBAMxJ,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,uBAAuB,cAAc,EAAE,KACtC,OAAO,CAAC,aAAa,CAyBvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAehF,eAAO,MAAM,eAAe,GAAU,aAAa,MAAM,EAAE,YAAY,MAAM,EAAE,iBAAiB,cAAc,KAAG,OAAO,CAAC,OAAO,CAW/H,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,UAAU,cAAc,EAAE,UAAU,cAAc,kBAWtI,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,aAAa,MAAM,EACnB,cAAc,OAAO,EACrB,UAAU,cAAc,EACxB,iBAAiB,eAAe,KAC/B,OAAO,CAAC,OAAO,CAcjB,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,yBAAyB,OAAO,EAAE,UAAU,cAAc,kBAMxJ,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,uBAAuB,cAAc,EAAE,KACtC,OAAO,CAAC,aAAa,CAyBvB,CAAA"}
|
package/dist/node/index-node.mjs
CHANGED
|
@@ -99,10 +99,9 @@ import { asAddress } from "@xylabs/hex";
|
|
|
99
99
|
import { Account } from "@xyo-network/account";
|
|
100
100
|
import { createChain } from "@xyo-network/chain-ethereum";
|
|
101
101
|
import { buildGenesisBlock } from "@xyo-network/chain-protocol";
|
|
102
|
-
import { XYO_ZERO_ADDRESS } from "@xyo-network/chain-utils";
|
|
103
102
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
104
103
|
import { BurnableErc20__factory as Erc20Factory } from "@xyo-network/typechain";
|
|
105
|
-
import { ChainStakeIntentSchema } from "@xyo-network/xl1-protocol";
|
|
104
|
+
import { ChainStakeIntentSchema, XYO_ZERO_ADDRESS } from "@xyo-network/xl1-protocol";
|
|
106
105
|
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
107
106
|
import { getAddress } from "ethers/address";
|
|
108
107
|
import { JsonRpcProvider as JsonRpcProvider2 } from "ethers/providers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index-node.ts","../../src/index-shared.ts","../../src/test/evm/runGanache.ts","../../src/test/evm/stakingContractUtils.ts"],"sourcesContent":["export * from './index-shared.ts'\nexport * from './test/index.ts'\n","export * from '@xyo-network/chain-ethereum'\nexport * from '@xyo-network/chain-modules'\nexport * from '@xyo-network/chain-orchestration'\nexport * from '@xyo-network/chain-protocol'\nexport * from '@xyo-network/chain-services'\nexport * from '@xyo-network/chain-utils'\nexport * from '@xyo-network/chain-validation'\nexport * from '@xyo-network/xl1-protocol'\n","import type { ChildProcess } from 'node:child_process'\nimport { spawn } from 'node:child_process'\n\nimport { delay } from '@xylabs/delay'\nimport { JsonRpcProvider } from 'ethers/providers'\n\nasync function isGanacheRunning(url: string) {\n try {\n const provider = new JsonRpcProvider(url)\n await provider.getBlockNumber() // Try to fetch the latest block number\n return true // If this succeeds, the server is running\n } catch {\n return false // If this fails, the server is not running\n }\n}\n\nexport async function startGanache(port: number, mnemonic: string) {\n console.log('Starting Ganache CLI...')\n\n // Start Ganache CLI\n const ganacheProcess = spawn(\n 'yarn',\n ['ganache', '--port', `${port}`, '--chain.chainId', '1337', '--mnemonic', mnemonic],\n { stdio: 'inherit' },\n )\n\n // Wait for Ganache to be ready\n while (!await isGanacheRunning(`http://127.0.0.1:${port}`)) {\n await delay(500)\n }\n\n return ganacheProcess\n}\n\nexport function stopGanache(process?: ChildProcess | undefined) {\n console.log('Stopping Ganache CLI...')\n if (process) {\n process.kill('SIGTERM')\n console.log('Ganache CLI stopped.')\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Address } from '@xylabs/hex'\nimport { asAddress } from '@xylabs/hex'\nimport { Account } from '@xyo-network/account'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { createChain } from '@xyo-network/chain-ethereum'\nimport { buildGenesisBlock } from '@xyo-network/chain-protocol'\nimport { XYO_ZERO_ADDRESS } from '@xyo-network/chain-utils'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { BurnableErc20__factory as Erc20Factory } from '@xyo-network/typechain'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport type { ChainStakeIntent, HydratedBlock } from '@xyo-network/xl1-protocol'\nimport { ChainStakeIntentSchema } from '@xyo-network/xl1-protocol'\nimport { buildTransaction } from '@xyo-network/xl1-protocol-sdk'\nimport { getAddress } from 'ethers/address'\nimport { JsonRpcProvider } from 'ethers/providers'\nimport { parseUnits } from 'ethers/utils'\nimport { Wallet } from 'ethers/wallet'\n\nconst gasConfig = () => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport const createTestErc20 = async (ganachePort: number, testPhrase: string, contractCreator: WalletInstance): Promise<Address> => {\n const provider = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWallet = new Wallet(contractCreator.privateKey, provider)\n const erc20 = new Erc20Factory(ethWallet)\n const totalSupply = parseUnits('1000000', 18)\n const erc20Contract = await (await erc20.deploy('Test Token', 'TST', totalSupply, gasConfig())).waitForDeployment()\n const erc20Address = await erc20Contract.getAddress()\n const erc20ContractPerson0 = Erc20Factory.connect(erc20Address, ethWallet)\n const balance = await erc20ContractPerson0.balanceOf(ethWallet.address)\n assertEx(balance === totalSupply, () => 'Balance does not match total supply')\n return assertEx(asAddress(erc20Address), () => 'Invalid ERC20 contract address')\n}\n\nexport const transferTestTokens = async (ganachePort: number, erc20Address: Address, account0: WalletInstance, account1: WalletInstance) => {\n const provider0 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson0 = new Wallet(account0.privateKey, provider0)\n const provider1 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson1 = new Wallet(account1.privateKey, provider1)\n const erc20ContractPerson0 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson0)\n const transferAmount = parseUnits('1000', 18)\n await (await erc20ContractPerson0.transfer(ethWalletPerson1.address, transferAmount, gasConfig())).wait()\n const erc20ContractPerson1 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson1)\n const balance = await erc20ContractPerson1.balanceOf(ethWalletPerson1.address)\n assertEx(balance === transferAmount, () => 'Balance does not match transfer amount')\n}\n\nexport const createTestChainContract = async (\n ganachePort: number,\n erc20Address: Address,\n account0: WalletInstance,\n initialProducer: AccountInstance,\n): Promise<Address> => {\n const provider0 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson0 = new Wallet(account0.privateKey, provider0)\n const [xyoChainContractAddress] = await createChain(\n ethWalletPerson0,\n erc20Address,\n initialProducer,\n XYO_ZERO_ADDRESS,\n 0n,\n XYO_ZERO_ADDRESS,\n 50_000n,\n gasConfig(),\n )\n return assertEx(asAddress(xyoChainContractAddress), () => 'Invalid staking contract address')\n}\n\nexport const approveTestStakeChainAddress = async (ganachePort: number, erc20Address: Address, xyoChainContractAddress: Address, account1: WalletInstance) => {\n const provider1 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson1 = new Wallet(account1.privateKey, provider1)\n const erc20ContractPerson1 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson1)\n\n const _approveResultTx = await (await erc20ContractPerson1.approve(getAddress(xyoChainContractAddress), parseUnits('100', 18), gasConfig())).wait()\n}\n\nexport const createTestGenesisBlock = async (\n blockProducerAccounts: WalletInstance[],\n): Promise<HydratedBlock> => {\n const randomChainId = (await Account.random()).address\n // Create staked intents for all the block producers declaring their intent to produce blocks\n const signedStakedBlockProducerIntents = await Promise.all(blockProducerAccounts.map(async (blockProducerAccount) => {\n const stakeIntent = new PayloadBuilder<ChainStakeIntent>({ schema: ChainStakeIntentSchema }).fields({\n from: blockProducerAccount.address,\n exp: Number.MAX_SAFE_INTEGER,\n nbf: 0,\n intent: 'producer',\n })\n .build()\n\n const signedStakedBlockProducerIntent = await buildTransaction(\n randomChainId,\n [stakeIntent],\n [],\n blockProducerAccount,\n 0,\n 1000,\n )\n return signedStakedBlockProducerIntent\n }))\n const intents = signedStakedBlockProducerIntents.map(intent => intent[0])\n const payloads = signedStakedBlockProducerIntents.flatMap(intent => intent[1]) as WithStorageMeta<ChainStakeIntent>[]\n return await buildGenesisBlock(randomChainId, signedStakedBlockProducerIntents, [...intents, ...payloads], blockProducerAccounts)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,qCAAc;AACd,oCAAc;AACd,0CAAc;AACd,qCAAc;AACd,q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;AAEF,WAAOa;EACT,CAAA,CAAA;AACA,QAAME,UAAUnB,iCAAiCG,IAAIY,CAAAA,WAAUA,OAAO,CAAA,CAAE;AACxE,QAAMK,WAAWpB,iCAAiCqB,QAAQN,CAAAA,WAAUA,OAAO,CAAA,CAAE;AAC7E,SAAO,MAAMO,kBAAkBzB,eAAeG,kCAAkC;OAAImB;OAAYC;KAAWxB,qBAAAA;AAC7G,GA3BsC;","names":["spawn","delay","JsonRpcProvider","isGanacheRunning","url","provider","JsonRpcProvider","getBlockNumber","startGanache","port","mnemonic","console","log","ganacheProcess","spawn","stdio","delay","stopGanache","process","kill","assertEx","asAddress","Account","createChain","buildGenesisBlock","XYO_ZERO_ADDRESS","PayloadBuilder","BurnableErc20__factory","Erc20Factory","ChainStakeIntentSchema","buildTransaction","getAddress","JsonRpcProvider","parseUnits","Wallet","gasConfig","gasLimit","gasPrice","parseUnits","createTestErc20","ganachePort","testPhrase","contractCreator","provider","JsonRpcProvider","ethWallet","Wallet","privateKey","erc20","Erc20Factory","totalSupply","erc20Contract","deploy","waitForDeployment","erc20Address","getAddress","erc20ContractPerson0","connect","balance","balanceOf","address","assertEx","asAddress","transferTestTokens","account0","account1","provider0","ethWalletPerson0","provider1","ethWalletPerson1","transferAmount","transfer","wait","erc20ContractPerson1","createTestChainContract","initialProducer","xyoChainContractAddress","createChain","XYO_ZERO_ADDRESS","approveTestStakeChainAddress","_approveResultTx","approve","createTestGenesisBlock","blockProducerAccounts","randomChainId","Account","random","signedStakedBlockProducerIntents","Promise","all","map","blockProducerAccount","stakeIntent","PayloadBuilder","schema","ChainStakeIntentSchema","fields","from","exp","Number","MAX_SAFE_INTEGER","nbf","intent","build","signedStakedBlockProducerIntent","buildTransaction","intents","payloads","flatMap","buildGenesisBlock"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index-node.ts","../../src/index-shared.ts","../../src/test/evm/runGanache.ts","../../src/test/evm/stakingContractUtils.ts"],"sourcesContent":["export * from './index-shared.ts'\nexport * from './test/index.ts'\n","export * from '@xyo-network/chain-ethereum'\nexport * from '@xyo-network/chain-modules'\nexport * from '@xyo-network/chain-orchestration'\nexport * from '@xyo-network/chain-protocol'\nexport * from '@xyo-network/chain-services'\nexport * from '@xyo-network/chain-utils'\nexport * from '@xyo-network/chain-validation'\nexport * from '@xyo-network/xl1-protocol'\n","import type { ChildProcess } from 'node:child_process'\nimport { spawn } from 'node:child_process'\n\nimport { delay } from '@xylabs/delay'\nimport { JsonRpcProvider } from 'ethers/providers'\n\nasync function isGanacheRunning(url: string) {\n try {\n const provider = new JsonRpcProvider(url)\n await provider.getBlockNumber() // Try to fetch the latest block number\n return true // If this succeeds, the server is running\n } catch {\n return false // If this fails, the server is not running\n }\n}\n\nexport async function startGanache(port: number, mnemonic: string) {\n console.log('Starting Ganache CLI...')\n\n // Start Ganache CLI\n const ganacheProcess = spawn(\n 'yarn',\n ['ganache', '--port', `${port}`, '--chain.chainId', '1337', '--mnemonic', mnemonic],\n { stdio: 'inherit' },\n )\n\n // Wait for Ganache to be ready\n while (!await isGanacheRunning(`http://127.0.0.1:${port}`)) {\n await delay(500)\n }\n\n return ganacheProcess\n}\n\nexport function stopGanache(process?: ChildProcess | undefined) {\n console.log('Stopping Ganache CLI...')\n if (process) {\n process.kill('SIGTERM')\n console.log('Ganache CLI stopped.')\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Address } from '@xylabs/hex'\nimport { asAddress } from '@xylabs/hex'\nimport { Account } from '@xyo-network/account'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport { createChain } from '@xyo-network/chain-ethereum'\nimport { buildGenesisBlock } from '@xyo-network/chain-protocol'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { BurnableErc20__factory as Erc20Factory } from '@xyo-network/typechain'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\nimport type { ChainStakeIntent, HydratedBlock } from '@xyo-network/xl1-protocol'\nimport { ChainStakeIntentSchema, XYO_ZERO_ADDRESS } from '@xyo-network/xl1-protocol'\nimport { buildTransaction } from '@xyo-network/xl1-protocol-sdk'\nimport { getAddress } from 'ethers/address'\nimport { JsonRpcProvider } from 'ethers/providers'\nimport { parseUnits } from 'ethers/utils'\nimport { Wallet } from 'ethers/wallet'\n\nconst gasConfig = () => {\n return {\n gasLimit: 2_000_000, // Set the gas limit\n gasPrice: parseUnits('100', 'gwei'),\n }\n}\n\nexport const createTestErc20 = async (ganachePort: number, testPhrase: string, contractCreator: WalletInstance): Promise<Address> => {\n const provider = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWallet = new Wallet(contractCreator.privateKey, provider)\n const erc20 = new Erc20Factory(ethWallet)\n const totalSupply = parseUnits('1000000', 18)\n const erc20Contract = await (await erc20.deploy('Test Token', 'TST', totalSupply, gasConfig())).waitForDeployment()\n const erc20Address = await erc20Contract.getAddress()\n const erc20ContractPerson0 = Erc20Factory.connect(erc20Address, ethWallet)\n const balance = await erc20ContractPerson0.balanceOf(ethWallet.address)\n assertEx(balance === totalSupply, () => 'Balance does not match total supply')\n return assertEx(asAddress(erc20Address), () => 'Invalid ERC20 contract address')\n}\n\nexport const transferTestTokens = async (ganachePort: number, erc20Address: Address, account0: WalletInstance, account1: WalletInstance) => {\n const provider0 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson0 = new Wallet(account0.privateKey, provider0)\n const provider1 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson1 = new Wallet(account1.privateKey, provider1)\n const erc20ContractPerson0 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson0)\n const transferAmount = parseUnits('1000', 18)\n await (await erc20ContractPerson0.transfer(ethWalletPerson1.address, transferAmount, gasConfig())).wait()\n const erc20ContractPerson1 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson1)\n const balance = await erc20ContractPerson1.balanceOf(ethWalletPerson1.address)\n assertEx(balance === transferAmount, () => 'Balance does not match transfer amount')\n}\n\nexport const createTestChainContract = async (\n ganachePort: number,\n erc20Address: Address,\n account0: WalletInstance,\n initialProducer: AccountInstance,\n): Promise<Address> => {\n const provider0 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson0 = new Wallet(account0.privateKey, provider0)\n const [xyoChainContractAddress] = await createChain(\n ethWalletPerson0,\n erc20Address,\n initialProducer,\n XYO_ZERO_ADDRESS,\n 0n,\n XYO_ZERO_ADDRESS,\n 50_000n,\n gasConfig(),\n )\n return assertEx(asAddress(xyoChainContractAddress), () => 'Invalid staking contract address')\n}\n\nexport const approveTestStakeChainAddress = async (ganachePort: number, erc20Address: Address, xyoChainContractAddress: Address, account1: WalletInstance) => {\n const provider1 = new JsonRpcProvider(`http://127.0.0.1:${ganachePort}`, 1337)\n const ethWalletPerson1 = new Wallet(account1.privateKey, provider1)\n const erc20ContractPerson1 = Erc20Factory.connect(getAddress(erc20Address), ethWalletPerson1)\n\n const _approveResultTx = await (await erc20ContractPerson1.approve(getAddress(xyoChainContractAddress), parseUnits('100', 18), gasConfig())).wait()\n}\n\nexport const createTestGenesisBlock = async (\n blockProducerAccounts: WalletInstance[],\n): Promise<HydratedBlock> => {\n const randomChainId = (await Account.random()).address\n // Create staked intents for all the block producers declaring their intent to produce blocks\n const signedStakedBlockProducerIntents = await Promise.all(blockProducerAccounts.map(async (blockProducerAccount) => {\n const stakeIntent = new PayloadBuilder<ChainStakeIntent>({ schema: ChainStakeIntentSchema }).fields({\n from: blockProducerAccount.address,\n exp: Number.MAX_SAFE_INTEGER,\n nbf: 0,\n intent: 'producer',\n })\n .build()\n\n const signedStakedBlockProducerIntent = await buildTransaction(\n randomChainId,\n [stakeIntent],\n [],\n blockProducerAccount,\n 0,\n 1000,\n )\n return signedStakedBlockProducerIntent\n }))\n const intents = signedStakedBlockProducerIntents.map(intent => intent[0])\n const payloads = signedStakedBlockProducerIntents.flatMap(intent => intent[1]) as WithStorageMeta<ChainStakeIntent>[]\n return await buildGenesisBlock(randomChainId, signedStakedBlockProducerIntents, [...intents, ...payloads], blockProducerAccounts)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,qCAAc;AACd,oCAAc;AACd,0CAAc;AACd,qCAAc;AACd,qCAAc;AACd,kCAAc;AACd,uCAAc;AACd,mCAAc;;;ADPd,+BAAc;;;AECd,SAASA,aAAa;AAEtB,SAASC,aAAa;AACtB,SAASC,uBAAuB;AAEhC,eAAeC,iBAAiBC,KAAW;AACzC,MAAI;AACF,UAAMC,WAAW,IAAIC,gBAAgBF,GAAAA;AACrC,UAAMC,SAASE,eAAc;AAC7B,WAAO;EACT,QAAQ;AACN,WAAO;EACT;AACF;AAReJ;AAUf,eAAsBK,aAAaC,MAAcC,UAAgB;AAC/DC,UAAQC,IAAI,yBAAA;AAGZ,QAAMC,iBAAiBC,MACrB,QACA;IAAC;IAAW;IAAU,GAAGL,IAAAA;IAAQ;IAAmB;IAAQ;IAAcC;KAC1E;IAAEK,OAAO;EAAU,CAAA;AAIrB,SAAO,CAAC,MAAMZ,iBAAiB,oBAAoBM,IAAAA,EAAM,GAAG;AAC1D,UAAMO,MAAM,GAAA;EACd;AAEA,SAAOH;AACT;AAhBsBL;AAkBf,SAASS,YAAYC,SAAkC;AAC5DP,UAAQC,IAAI,yBAAA;AACZ,MAAIM,SAAS;AACXA,YAAQC,KAAK,SAAA;AACbR,YAAQC,IAAI,sBAAA;EACd;AACF;AANgBK;;;AClChB,SAASG,gBAAgB;AAEzB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AAExB,SAASC,mBAAmB;AAC5B,SAASC,yBAAyB;AAClC,SAASC,sBAAsB;AAE/B,SAASC,0BAA0BC,oBAAoB;AAGvD,SAASC,wBAAwBC,wBAAwB;AACzD,SAASC,wBAAwB;AACjC,SAASC,kBAAkB;AAC3B,SAASC,mBAAA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C,eAAiC;MAAEC,QAAQC;IAAuB,CAAA,EAAGC,OAAO;MAClGC,MAAMN,qBAAqB/B;MAC3BsC,KAAKC,OAAOC;MACZC,KAAK;MACLC,QAAQ;IACV,CAAA,EACGC,MAAK;AAER,UAAMC,kCAAkC,MAAMC,iBAC5CrB,eACA;MAACQ;OACD,CAAA,GACAD,sBACA,GACA,GAAA;AAEF,WAAOa;EACT,CAAA,CAAA;AACA,QAAME,UAAUnB,iCAAiCG,IAAIY,CAAAA,WAAUA,OAAO,CAAA,CAAE;AACxE,QAAMK,WAAWpB,iCAAiCqB,QAAQN,CAAAA,WAAUA,OAAO,CAAA,CAAE;AAC7E,SAAO,MAAMO,kBAAkBzB,eAAeG,kCAAkC;OAAImB;OAAYC;KAAWxB,qBAAAA;AAC7G,GA3BsC;","names":["spawn","delay","JsonRpcProvider","isGanacheRunning","url","provider","JsonRpcProvider","getBlockNumber","startGanache","port","mnemonic","console","log","ganacheProcess","spawn","stdio","delay","stopGanache","process","kill","assertEx","asAddress","Account","createChain","buildGenesisBlock","PayloadBuilder","BurnableErc20__factory","Erc20Factory","ChainStakeIntentSchema","XYO_ZERO_ADDRESS","buildTransaction","getAddress","JsonRpcProvider","parseUnits","Wallet","gasConfig","gasLimit","gasPrice","parseUnits","createTestErc20","ganachePort","testPhrase","contractCreator","provider","JsonRpcProvider","ethWallet","Wallet","privateKey","erc20","Erc20Factory","totalSupply","erc20Contract","deploy","waitForDeployment","erc20Address","getAddress","erc20ContractPerson0","connect","balance","balanceOf","address","assertEx","asAddress","transferTestTokens","account0","account1","provider0","ethWalletPerson0","provider1","ethWalletPerson1","transferAmount","transfer","wait","erc20ContractPerson1","createTestChainContract","initialProducer","xyoChainContractAddress","createChain","XYO_ZERO_ADDRESS","approveTestStakeChainAddress","_approveResultTx","approve","createTestGenesisBlock","blockProducerAccounts","randomChainId","Account","random","signedStakedBlockProducerIntents","Promise","all","map","blockProducerAccount","stakeIntent","PayloadBuilder","schema","ChainStakeIntentSchema","fields","from","exp","Number","MAX_SAFE_INTEGER","nbf","intent","build","signedStakedBlockProducerIntent","buildTransaction","intents","payloads","flatMap","buildGenesisBlock"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"stakingContractUtils.d.ts","sourceRoot":"","sources":["../../../../src/test/evm/stakingContractUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAehF,eAAO,MAAM,eAAe,GAAU,aAAa,MAAM,EAAE,YAAY,MAAM,EAAE,iBAAiB,cAAc,KAAG,OAAO,CAAC,OAAO,CAW/H,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,UAAU,cAAc,EAAE,UAAU,cAAc,kBAWtI,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,aAAa,MAAM,EACnB,cAAc,OAAO,EACrB,UAAU,cAAc,EACxB,iBAAiB,eAAe,KAC/B,OAAO,CAAC,OAAO,CAcjB,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAU,aAAa,MAAM,EAAE,cAAc,OAAO,EAAE,yBAAyB,OAAO,EAAE,UAAU,cAAc,kBAMxJ,CAAA;AAED,eAAO,MAAM,sBAAsB,GACjC,uBAAuB,cAAc,EAAE,KACtC,OAAO,CAAC,aAAa,CAyBvB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/chain-sdk",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.15",
|
|
5
5
|
"description": "XYO Layer One SDK",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
"@xylabs/hex": "^4.13.23",
|
|
63
63
|
"@xyo-network/account": "^4.1.7",
|
|
64
64
|
"@xyo-network/account-model": "^4.1.7",
|
|
65
|
-
"@xyo-network/chain-ethereum": "^1.7.
|
|
66
|
-
"@xyo-network/chain-modules": "^1.7.
|
|
67
|
-
"@xyo-network/chain-orchestration": "^1.7.
|
|
68
|
-
"@xyo-network/chain-protocol": "^1.7.
|
|
69
|
-
"@xyo-network/chain-services": "^1.7.
|
|
70
|
-
"@xyo-network/chain-utils": "^1.7.
|
|
71
|
-
"@xyo-network/chain-validation": "^1.7.
|
|
65
|
+
"@xyo-network/chain-ethereum": "^1.7.15",
|
|
66
|
+
"@xyo-network/chain-modules": "^1.7.15",
|
|
67
|
+
"@xyo-network/chain-orchestration": "^1.7.15",
|
|
68
|
+
"@xyo-network/chain-protocol": "^1.7.15",
|
|
69
|
+
"@xyo-network/chain-services": "^1.7.15",
|
|
70
|
+
"@xyo-network/chain-utils": "^1.7.15",
|
|
71
|
+
"@xyo-network/chain-validation": "^1.7.15",
|
|
72
72
|
"@xyo-network/payload-builder": "^4.1.7",
|
|
73
73
|
"@xyo-network/typechain": "^3.5.4",
|
|
74
74
|
"@xyo-network/wallet-model": "^4.1.7",
|
|
75
75
|
"@xyo-network/xl1-protocol": "^1.7.19",
|
|
76
|
-
"@xyo-network/xl1-protocol-sdk": "^1.7.
|
|
76
|
+
"@xyo-network/xl1-protocol-sdk": "^1.7.15",
|
|
77
77
|
"ethers": "6.15.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@xyo-network/archivist-memory": "^4.1.7",
|
|
88
88
|
"@xyo-network/archivist-model": "^4.1.7",
|
|
89
89
|
"@xyo-network/boundwitness-builder": "^4.1.7",
|
|
90
|
-
"@xyo-network/chain-analyze": "^1.7.
|
|
90
|
+
"@xyo-network/chain-analyze": "^1.7.15",
|
|
91
91
|
"@xyo-network/payload-model": "^4.1.7",
|
|
92
92
|
"@xyo-network/wallet": "^4.1.7",
|
|
93
93
|
"eslint": "^9.31.0",
|
|
@@ -6,11 +6,11 @@ import { asAddress } from '@xylabs/hex'
|
|
|
6
6
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
7
7
|
import { createChain, toEthAddress } from '@xyo-network/chain-ethereum'
|
|
8
8
|
import { EvmChainService } from '@xyo-network/chain-services'
|
|
9
|
-
import { XYO_ZERO_ADDRESS } from '@xyo-network/chain-utils'
|
|
10
9
|
import type { BurnableErc20 } from '@xyo-network/typechain'
|
|
11
10
|
import { BurnableErc20__factory as Erc20Factory, StakedXyoChain__factory as StakedXyoChainFactory } from '@xyo-network/typechain'
|
|
12
11
|
import { HDWallet } from '@xyo-network/wallet'
|
|
13
12
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
13
|
+
import { XYO_ZERO_ADDRESS } from '@xyo-network/xl1-protocol'
|
|
14
14
|
import type { ContractRunner } from 'ethers/providers'
|
|
15
15
|
import { JsonRpcProvider } from 'ethers/providers'
|
|
16
16
|
import { parseUnits } from 'ethers/utils'
|
package/src/test/evm/setup.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import { asAddress } from '@xylabs/hex'
|
|
3
3
|
import { createChain, toEthAddress } from '@xyo-network/chain-ethereum'
|
|
4
4
|
import { EvmChainService } from '@xyo-network/chain-services'
|
|
5
|
-
import { XYO_ZERO_ADDRESS } from '@xyo-network/chain-utils'
|
|
6
5
|
import { BurnableErc20__factory as Erc20Factory, StakedXyoChain__factory as StakedXyoChainFactory } from '@xyo-network/typechain'
|
|
7
6
|
import { HDWallet } from '@xyo-network/wallet'
|
|
7
|
+
import { XYO_ZERO_ADDRESS } from '@xyo-network/xl1-protocol'
|
|
8
8
|
import type { ContractRunner } from 'ethers/providers'
|
|
9
9
|
import { JsonRpcProvider } from 'ethers/providers'
|
|
10
10
|
import { parseUnits } from 'ethers/utils'
|
|
@@ -5,13 +5,12 @@ import { Account } from '@xyo-network/account'
|
|
|
5
5
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
6
6
|
import { createChain } from '@xyo-network/chain-ethereum'
|
|
7
7
|
import { buildGenesisBlock } from '@xyo-network/chain-protocol'
|
|
8
|
-
import { XYO_ZERO_ADDRESS } from '@xyo-network/chain-utils'
|
|
9
8
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
10
9
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
11
10
|
import { BurnableErc20__factory as Erc20Factory } from '@xyo-network/typechain'
|
|
12
11
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
13
12
|
import type { ChainStakeIntent, HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
14
|
-
import { ChainStakeIntentSchema } from '@xyo-network/xl1-protocol'
|
|
13
|
+
import { ChainStakeIntentSchema, XYO_ZERO_ADDRESS } from '@xyo-network/xl1-protocol'
|
|
15
14
|
import { buildTransaction } from '@xyo-network/xl1-protocol-sdk'
|
|
16
15
|
import { getAddress } from 'ethers/address'
|
|
17
16
|
import { JsonRpcProvider } from 'ethers/providers'
|