Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

feat(meta): Add meta-consensus-rpc module. #64

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Commits on Aug 24, 2022

  1. Configuration menu
    Copy the full SHA
    dbc6f28 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9f6206b View commit details
    Browse the repository at this point in the history
  3. Update get_block_hash() test

    surangap committed Aug 24, 2022
    Configuration menu
    Copy the full SHA
    7df137b View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2022

  1. Updated test.

    surangap committed Aug 25, 2022
    Configuration menu
    Copy the full SHA
    b07dff9 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2022

  1. Configuration menu
    Copy the full SHA
    ea94efc View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. Configuration menu
    Copy the full SHA
    1246cca View commit details
    Browse the repository at this point in the history
  2. Add block_import test.

    surangap committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    877dd19 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2022

  1. Update block_import test.

    surangap committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    6d183a2 View commit details
    Browse the repository at this point in the history
  2. Update get_block() rpc.

    surangap committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    d76c90a View commit details
    Browse the repository at this point in the history
  3. Add DNCTx, DMCTx structs.

    surangap committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    efc7f42 View commit details
    Browse the repository at this point in the history
  4. Add mint_block() RPC.

    surangap committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    6cd3069 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e8edea8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7b7edb5 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2022

  1. Add block_mint test.

    surangap committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    76bea7a View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2022

  1. Add connect_block() RPC.

    surangap committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    99111ad View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7c9e652 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2022

  1. Configuration menu
    Copy the full SHA
    a0f7c75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26c72fd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f717df7 View commit details
    Browse the repository at this point in the history
  4. Remove unused imports.

    surangap committed Sep 11, 2022
    Configuration menu
    Copy the full SHA
    6b72af9 View commit details
    Browse the repository at this point in the history
  5. Fix rustfmt

    surangap committed Sep 11, 2022
    Configuration menu
    Copy the full SHA
    3d28aab View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2022

  1. chore(ts-tests): add e2e contracts (#66)

    #### What this PR does / why we need it:
    
    Develop and test on a simple smart contract functionality on
    substrate-based blockchain.
    
    #### Which issue(s) does this PR fixes?:
    <!--
    (Optional) Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    -->
    Fixes #
    
    #### Additional comments?:
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    canonbrother and dependabot[bot] committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    26fc599 View commit details
    Browse the repository at this point in the history
  2. bump(deps): update dependency @birthdayresearch/contented to v1.6.1 (#81

    )
    
    [![Mend
    Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Change | Age | Adoption | Passing | Confidence |
    |---|---|---|---|---|---|
    | @&#8203;birthdayresearch/contented | [`1.6.0` ->
    `1.6.1`](https://renovatebot.com/diffs/npm/@birthdayresearch%2fcontented/1.6.0/1.6.1)
    |
    [![age](https://badges.renovateapi.com/packages/npm/@birthdayresearch%2fcontented/1.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![adoption](https://badges.renovateapi.com/packages/npm/@birthdayresearch%2fcontented/1.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![passing](https://badges.renovateapi.com/packages/npm/@birthdayresearch%2fcontented/1.6.1/compatibility-slim/1.6.0)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![confidence](https://badges.renovateapi.com/packages/npm/@birthdayresearch%2fcontented/1.6.1/confidence-slim/1.6.0)](https://docs.renovatebot.com/merge-confidence/)
    |
    
    ---
    
    ### Configuration
    
    📅 **Schedule**: Branch creation - At any time (no schedule defined),
    Automerge - At any time (no schedule defined).
    
    🚦 **Automerge**: Disabled by config. Please merge this manually once you
    are satisfied.
    
    ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
    rebase/retry checkbox.
    
    🔕 **Ignore**: Close this PR and you won't be reminded about this update
    again.
    
    ---
    
    - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
    this checkbox.
    
    ---
    
    This PR has been generated by [Mend
    Renovate](https://www.mend.io/free-developer-tools/renovate/). View
    repository job log
    [here](https://app.renovatebot.com/dashboard#github/DeFiCh/metachain).
    
    <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMyIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4zIn0=-->
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    c3f1303 View commit details
    Browse the repository at this point in the history
  3. refactor(workflows): cleanup and generalize workflows, also add pnpm …

    …workflows (#71)
    
    #### What this PR does / why we need it:
    
    As per the title.
    
    - Add a general `release.yml` pipeline for releasing NPM packages.
    - Add `environment: Release Docker` for `release-docker.yml` for
    deployment gates
    - Add new workflow for pnpm:
      - `Build (pnpm)`
      - `Lint (pnpm prettier)`
      - `Lint (pnpm eslint)`
    - `Test (pnpm)` is temporary failing since there isn't any test coverage
    to upload.
      - `Test (pnpm e2e)` deprecated and removeing soon.
    - Migrate old workflow for cargo to new name:
      - `Build (cargo)`
      - `Test (cargo)`
      - `Lint (cargo fmt)`
      - `Lint (cargo clippy)`
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    a21094a View commit details
    Browse the repository at this point in the history
  4. bump(deps): update dependency turbo to ^1.4.6 (#82)

    [![Mend
    Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Change | Age | Adoption | Passing | Confidence |
    |---|---|---|---|---|---|
    | [turbo](https://turborepo.org)
    ([source](https://togithub.com/vercel/turborepo)) | [`^1.4.5` ->
    `^1.4.6`](https://renovatebot.com/diffs/npm/turbo/1.4.5/1.4.6) |
    [![age](https://badges.renovateapi.com/packages/npm/turbo/1.4.6/age-slim)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![adoption](https://badges.renovateapi.com/packages/npm/turbo/1.4.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![passing](https://badges.renovateapi.com/packages/npm/turbo/1.4.6/compatibility-slim/1.4.5)](https://docs.renovatebot.com/merge-confidence/)
    |
    [![confidence](https://badges.renovateapi.com/packages/npm/turbo/1.4.6/confidence-slim/1.4.5)](https://docs.renovatebot.com/merge-confidence/)
    |
    
    ---
    
    ### Release Notes
    
    <details>
    <summary>vercel/turborepo</summary>
    
    ###
    [`v1.4.6`](https://togithub.com/vercel/turborepo/releases/tag/v1.4.6)
    
    [Compare
    Source](https://togithub.com/vercel/turborepo/compare/v1.4.5...v1.4.6)
    
    #### What's Changed
    
    ##### Internal
    
    - fix(deps): update dependency ora to v4.1.1 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1854](https://togithub.com/vercel/turborepo/pull/1854)
    - Don't special case version command by
    [@&#8203;gsoltis](https://togithub.com/gsoltis) in
    [https://github.com/vercel/turborepo/pull/1870](https://togithub.com/vercel/turborepo/pull/1870)
    - fix(deps): update dependency react-hot-toast to v2.3.0 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1875](https://togithub.com/vercel/turborepo/pull/1875)
    - chore(deps): update jamesives/github-pages-deploy-action action to
    v4.4.0 by [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1851](https://togithub.com/vercel/turborepo/pull/1851)
    - chore(deps): update dependency typescript to v4.8.2 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1849](https://togithub.com/vercel/turborepo/pull/1849)
    - chore(deps): update dependency esbuild to ^0.15.0 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1848](https://togithub.com/vercel/turborepo/pull/1848)
    - Enable pnpm@6 testing. by
    [@&#8203;7flash](https://togithub.com/7flash) in
    [https://github.com/vercel/turborepo/pull/1837](https://togithub.com/vercel/turborepo/pull/1837)
    - fix(deps): update dependency eslint-plugin-react to v7.31.7 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1834](https://togithub.com/vercel/turborepo/pull/1834)
    - chore(deps): update dependency
    [@&#8203;types/react](https://togithub.com/types/react) to v17.0.49 by
    [@&#8203;renovate](https://togithub.com/renovate) in
    [https://github.com/vercel/turborepo/pull/1833](https://togithub.com/vercel/turborepo/pull/1833)
    - Replace some 2 letter variables for readability by
    [@&#8203;mehulkar](https://togithub.com/mehulkar) in
    [https://github.com/vercel/turborepo/pull/1845](https://togithub.com/vercel/turborepo/pull/1845)
    
    ##### Documentation
    
    - Remove unused packages from docs site by
    [@&#8203;mehulkar](https://togithub.com/mehulkar) in
    [https://github.com/vercel/turborepo/pull/1828](https://togithub.com/vercel/turborepo/pull/1828)
    - Consolidated 'workspace' and 'package' terminology by
    [@&#8203;mattpocock](https://togithub.com/mattpocock) in
    [https://github.com/vercel/turborepo/pull/1817](https://togithub.com/vercel/turborepo/pull/1817)
    - Rewrote docs homepage by
    [@&#8203;mattpocock](https://togithub.com/mattpocock) in
    [https://github.com/vercel/turborepo/pull/1756](https://togithub.com/vercel/turborepo/pull/1756)
    - Update existing-monorepo.mdx by
    [@&#8203;shemayas](https://togithub.com/shemayas) in
    [https://github.com/vercel/turborepo/pull/1858](https://togithub.com/vercel/turborepo/pull/1858)
    - Update Docs by [@&#8203;PhentomPT](https://togithub.com/PhentomPT) in
    [https://github.com/vercel/turborepo/pull/1794](https://togithub.com/vercel/turborepo/pull/1794)
    - Fix broken links on "Add to existing Monorepo" by
    [@&#8203;pakaponk](https://togithub.com/pakaponk) in
    [https://github.com/vercel/turborepo/pull/1836](https://togithub.com/vercel/turborepo/pull/1836)
    
    ##### Examples
    
    - Removed parallel flag from basic example by
    [@&#8203;mattpocock](https://togithub.com/mattpocock) in
    [https://github.com/vercel/turborepo/pull/1787](https://togithub.com/vercel/turborepo/pull/1787)
    - Renamed storybook components by
    [@&#8203;samuelhorn](https://togithub.com/samuelhorn) in
    [https://github.com/vercel/turborepo/pull/1841](https://togithub.com/vercel/turborepo/pull/1841)
    
    ##### Packages
    
    - fix(eslint): exclude variables in rule by
    [@&#8203;tknickman](https://togithub.com/tknickman) in
    [https://github.com/vercel/turborepo/pull/1865](https://togithub.com/vercel/turborepo/pull/1865)
    
    #### New Contributors
    
    - [@&#8203;shemayas](https://togithub.com/shemayas) made their first
    contribution in
    [https://github.com/vercel/turborepo/pull/1858](https://togithub.com/vercel/turborepo/pull/1858)
    - [@&#8203;7flash](https://togithub.com/7flash) made their first
    contribution in
    [https://github.com/vercel/turborepo/pull/1837](https://togithub.com/vercel/turborepo/pull/1837)
    - [@&#8203;PhentomPT](https://togithub.com/PhentomPT) made their first
    contribution in
    [https://github.com/vercel/turborepo/pull/1794](https://togithub.com/vercel/turborepo/pull/1794)
    
    **Full Changelog**:
    vercel/turborepo@v1.4.5...v1.4.6
    
    </details>
    
    ---
    
    ### Configuration
    
    📅 **Schedule**: Branch creation - At any time (no schedule defined),
    Automerge - At any time (no schedule defined).
    
    🚦 **Automerge**: Disabled by config. Please merge this manually once you
    are satisfied.
    
    ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
    rebase/retry checkbox.
    
    🔕 **Ignore**: Close this PR and you won't be reminded about this update
    again.
    
    ---
    
    - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
    this checkbox.
    
    ---
    
    This PR has been generated by [Mend
    Renovate](https://www.mend.io/free-developer-tools/renovate/). View
    repository job log
    [here](https://app.renovatebot.com/dashboard#github/DeFiCh/metachain).
    
    <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMyIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4zIn0=-->
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    e5ba1cc View commit details
    Browse the repository at this point in the history
  5. chore(ts-tests): refactor ts-tests/* to follow pnpm and turbo works…

    …pace design (#86)
    
    #### What this PR does / why we need it:
    
    Move `ts-tests/*` to utilize pnpm and turbo mono-repo workspace design.
    With this, we managed to keep configs (eslint, prettier, babel jest)
    DRY. The PR "workspace-ize" `ts-tests` but ultimately many more PR is
    required to break this package into multiple smaller mono repo packages.
    
    Follow-up PRs required to address these:
    
    - [ ] ESLINT will be added back once we move to "testsuite", also part
    of #79
    - [ ] #78 
    
    ---
    
    **What's new?**
    
    As suggested in
    #66 (comment) I've
    added hardhat compile turbo workflow.
    
    `@birthdayresearch/sticky-turbo-jest` is a turbo-aware `jest-preset`; it
    automatically run `dependsOn` script before running jest. By taking
    advantage of content-aware hashing from turborepo. `dependsOn` only runs
    if the pipeline `inputs` has changed.
    
    When you run your test with `@birthdayresearch/sticky-turbo-jest`
    preset, it uses `displayName` from your jest config to figure out which
    `pipeline` to use. It will automatically pinpoint the corresponding
    `dependsOn` and run all the scripts specified within.
    
    > TLDR, when you run a dependent test, it automatically recompiles your
    contract with hardhat when it detects changes in your `contracts/*.sol`
    file. If it has the cached version, it will simply "output" the result
    instead of rebuilding it.
    
    https://sticky.birthday.dev/packages/sticky-turbo-jest
    
    `package.json`:
    ```json
      "scripts": {
        "compile": "hardhat compile",
        "test": "jest"
      },
      "jest": {
        "displayName": "test",
        "preset": "@birthdayresearch/sticky-turbo-jest"
      },
    ```
    
    `turbo.json`:
    ```json
        "compile": {
          "inputs": ["contracts/**"],
          "outputs": ["artifacts", "cache"]
        },
        "test": {
          "inputs": ["src/**", "**/*.unit.ts", "tests-e2e/**"],
          "dependsOn": ["^build", "compile"]
        },
    ```
    
    #### Which issue(s) does this PR fixes?:
    
    <!--
    (Optional) Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    -->
    
    Fixes part of #79
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    5c7bb96 View commit details
    Browse the repository at this point in the history
  6. chore(.idea): check in codeStyles and .gitignore for .idea/* (#87)

    #### What this PR does / why we need it:
    
    As per the title.
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    d6196da View commit details
    Browse the repository at this point in the history
  7. refactor(testcontainers): move testcontainers into its own package (#67)

    #### What this PR does / why we need it:
    
    Refactor and move `ts-tests` into mono-repo style packages to allow
    separation of context and downstream usability. This is the continuation
    of #42
    
    `@defimetachain/testcontainers`
    
    Provides easy to use and test lightweight, throwaway instances of
    MetaChain provisioned automatically in a Docker
    container.
    
    `MetaChainContainer` and `StartedMetaChainContainer` follows the
    convention defined
    in
    [testcontainers/testcontainers-node](https://github.com/testcontainers/testcontainers-node)
    
    ```ts
    let container: StartedMetaChainContainer;
    let rpc: ethers.providers.JsonRpcProvider;
    
    beforeEach(async () => {
      container = await new MetaChainContainer().start();
    });
    
    afterEach(async () => {
      await container.stop();
    });
    
    it('should createBlock', async function () {
      await container.createBlock();
      expect(await rpc.getBlockNumber()).toStrictEqual(1);
    });
    ```
    
    
    #### Which issue(s) does this PR fixes?:
    <!--
    (Optional) Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    -->
    Fixes #78
    
    #### Additional comments?:
    
    The current implementation in `ts-tests` isn't yet migrated to use the
    new standard and convention defined here. That should be done as part of
    #79.
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    8547030 View commit details
    Browse the repository at this point in the history
  8. chore(docs): add documentation structure for MetaChain (#90)

    #### What this PR does / why we need it:
    
    As per the title. Merely cosmetic change to move documentation structure
    into place.
    
    #### Which issue(s) does this PR fixes?:
    
    <!--
    (Optional) Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    -->
    
    Fixes part of #8
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    ce06fa6 View commit details
    Browse the repository at this point in the history
  9. chore(governance): add area/ain to earmark issues/pr that requires ch…

    …anges on the DeFiCh/ain codebase (#92)
    
    #### What this PR does / why we need it:
    
    As per the title.
    fuxingloh authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    d1a1617 View commit details
    Browse the repository at this point in the history
  10. chore(docs): add draft of MetaChain consensus (#101)

    #### What this PR does / why we need it:
    
    As per the title, this PR is a working draft version of MetaChain
    Consensus.
    
    Signed-off-by: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com>
    Co-authored-by: Eli <31790206+eli-lim@users.noreply.github.com>
    2 people authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    6d3bf1f View commit details
    Browse the repository at this point in the history
  11. docs(token-bridge): add draft for MetaChain Token & Bridge (#102)

    <!--  Thanks for sending a pull request! -->
    
    #### What this PR does / why we need it:
    
    As per the title, this PR is a working draft version of MetaChain Token
    & Bridge.
    
    Signed-off-by: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com>
    Co-authored-by: Eli <31790206+eli-lim@users.noreply.github.com>
    2 people authored and canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    d9704c4 View commit details
    Browse the repository at this point in the history
  12. chore(ts-tests): Replace MetaDContainer with MetaChainContainer (#104)

    <!--  Thanks for sending a pull request! -->
    
    #### What this PR does / why we need it:
    
    #### Which issue(s) does this PR fixes?:
    
    <!--
    (Optional) Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    -->
    
    Fixes #
    
    #### Additional comments?:
    canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    90e5b28 View commit details
    Browse the repository at this point in the history
  13. rename DNC to DFC

    canonbrother committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    5352280 View commit details
    Browse the repository at this point in the history