Skip to content
Snippets Groups Projects
Select Git revision
  • 04a7be45c841ff8faaa24eae0daa5fcbd20bd05a
  • master default protected
  • upgradable-multisig
  • 308-add-a-runtime-api-to-simulate-max-net-tx-cost-for-the-end-user-fees-refund
  • 270-parametrage-de-la-gtest
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
  • runtime-401 protected
  • v0.4.0 protected
41 results

chain_spec.rs

Blame
  • blockchain.test.ts 3.78 KiB
    import app from '@/test'
    import { Keyring } from '@polkadot/api'
    import { web3Accounts, web3FromSource } from '@polkadot/extension-dapp'
    import { stringToHex } from '@polkadot/util'
    import { describe, expect, it } from 'vitest'
    
    const badBlockHash =
      '0x0000000000000000000000000000000000000000000000000000000000000000'
    
    describe('Test chain', async () => {
      it('should have block', async () => {
        const res = await app.polkadot.rpc.chain.getBlockHash(1)
        expect(res.toString()).not.toBe(badBlockHash)
      })
    
      it('should have identity ManUtopiK', async () => {
        const res = await app.polkadot.query.identity.identityIndexOf(
          '5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1'
        )
        expect(res.toJSON()).toBe(1)
      })
    
      it('should create block', async () => {
        // await app.polkadot.rpc.engine.createBlock(true, true)
    
        const finalized_block_hash = (
          await app.polkadot.rpc.chain.getFinalizedHead()
        ).toString()
        const lastBlock = await app.polkadot.rpc.chain.getBlock(
          finalized_block_hash
        )
        const lastBlockNumber = lastBlock.block.header.number.toNumber()
    
        expect(lastBlockNumber).toBe(2)
      })
    
      //   final json = await sdk.api.keyring
      //   .importAccount(keyring,
      //       keyType: keytype,
      //       key: generatedMnemonic,
      //       name: derivePath,
      //       password: password,
      //       derivePath: derivePath,
      //       cryptoType: CryptoType.sr25519)
      //   .catchError((e) {
      // importIsLoading = false;
      // notifyListeners();
      // });
      // if (json == null) return '';
      // // log.d(json);
      // try {
      // await sdk.api.keyring.addAccount(
      //   keyring,
      //   keyType: keytype,
      //   acc: json,
      //   password: password,
      // );
    
      const mnemonic =
        'pipe paddle ketchup filter life ice feel embody glide quantum ride usage'
    
      const test1 = '5FeggKqw2AbnGZF9Y9WPM2QTgzENS3Hit94Ewgmzdg5a3LNa' // , 'test1');
      const test2 = '5E4i8vcNjnrDp21Sbnp32WHm2gz8YP3GGFwmdpfg5bHd8Whb' // , 'test2');
      const test3 = '5FhTLzXLNBPmtXtDBFECmD7fvKmTtTQDtvBTfVr97tachA1p' // , 'test3');
      const test4 = '5DXJ4CusmCg8S1yF6JGVn4fxgk5oFx42WctXqHZ17mykgje5' // , 'test4');
      const test5 = '5Dq3giahrBfykJogPetZJ2jjSmhw49Fa7i6qKkseUvRJ2T3R' // , 'test5');
      const test6 = '5GxEp3do81j97kNaH4JyZgDXuPoKWoTuxXXWGyyNXeKeVLHb' // , 'test6');
      const test7 = '5FZ1sSvREbQLCtSSCvMUx7KCAnpJkB7q5mfz2oixiZq2ChET' // , 'test7');
      const test8 = '5CoKV9EEgwb2NmWamTXUAa6ycfNb2k1iNfVGvJAkg7dLq9RH' // , 'test8');