Skip to content

Commit

Permalink
feature(ui-ux): added contract/token support for metascan (#202)
Browse files Browse the repository at this point in the history
* added verified contract listing

* added contracts routes to header

* chore(ui-ux): use transaction type (#204)

* chore(ui-ux): use testnet api (#205)

* added skeleton loader for sc

* fix(conflict): fix merge conflict to main (#220)

* feat(ui-ux): handle lost block details and display block hash (#212)

* feat(ui-ux): handle reorganized block details page

* feat(ui-ux): retain gas price decimal

* feat(ui-ux): display block hash and refactor block details

* remove double await

---------

Co-authored-by: pierregee <[email protected]>

* fix(ui-ux): fetch tx confirmation from blockscout v1 api (#218)

fix(ui-ux): fetch tx confirmation from blockscount v1 api

* feat(ui-ux): display decoded input for token transfer txs (#213)

feat(ui-ux): display decoded input

* feat(ui-ux): update main title and reduce size (#219)

---------

Co-authored-by: pierregee <[email protected]>

* feat(ui-ux): redirect hash to correct page

* feat(ui-ux): add api integration on contract detail page (#232)

* feat(ui-ux): add api integration on contract detail page

* remove commented link -  verified contracts in footer

* reorder tabs

* rm log

* improve ui spacing

* revert changes

* feat(ui-ux): update tabs inside contract details (#235)

* feat(ui-ux): update main tabs inside contract details

* adjust sub-tab

* fix sub-tab name

* feat(ui-ux): add contract code details (#248)

* feat(ui-ux): add code details

* fix overlapping ui

* display code blocks

* display all contract files

* improve comment

* fix filename for empty file path

* fix build

* fix build

* feature(ui-ux): verify smart contract (#245)

* added verify contract step 1 and terms page

* added error state for input

* minor text change

* added validation for step one

* allow edit of smartcontract details

* added smartcontraction verification flow

* updated api endpoint and added redirection flow

* added action btn for partial and full rest

* Update src/api/SmartContractApi.ts

Co-authored-by: Lyka Labrada <[email protected]>

* Update next.config.js

Co-authored-by: Lyka Labrada <[email protected]>

* Allow vyper SC verifiaction and refactoring

* update evm version

---------

Co-authored-by: Lyka Labrada <[email protected]>

* feat(core): add contract read and write methods (#246)

* feat(core): add contract read and write methods

* fix(ui-ux): uncommit ui padding

* fix key error, method_id is optional

* feat(core): add metamask connection to metachain

* handle contract write with defi value

* clean up code for contract method form

* replace ethers utils with viem

* move contract methods api call inside own component

* add expand all and reset form functions

* move custom defichain evm chains into separate file

* cleanup

* fix empty inputs error

* fix next.config

* feat(ui-ux): redirect contract address to contract page (#256)

* feat(ui-ux): add unverified contract ux (#258)

* feat(ui-ux): add unverified contract ux

* remove log

* feat(ui-ux): add plus icon to add zeroes on write input (#257)

* feat(ui-ux): add plus icon to add zeroes on write input

* feat(ui-ux): autofocus on custom input

* feat(ui-ux): add maximum limit to custom decimal

* feat(core): integrate config api from blockscout v2 (#259)

* feat(core): integrate config api from blockscout v2

* remove unused apis

* fix looping mapping

* fix switched compiler versions

* fix(ui-ux): refactor smart contract page components (#260)

* feat(core): integrate config api from blockscout v2

* remove unused apis

* fix(ui-ux): refactor smart contract page components

* clean prop types

* add disabled dropdown ui

* add new interface for stepone

* add prop types in step 2

---------

Co-authored-by: Lyka Labrada <[email protected]>

* feature(ui-ux): smart contract verification using JSON input (#255)

* added verify contract step 1 and terms page

* added error state for input

* minor text change

* added validation for step one

* allow edit of smartcontract details

* added smartcontraction verification flow

* updated api endpoint and added redirection flow

* added action btn for partial and full rest

* Update src/api/SmartContractApi.ts

Co-authored-by: Lyka Labrada <[email protected]>

* Update next.config.js

Co-authored-by: Lyka Labrada <[email protected]>

* Allow vyper SC verifiaction and refactoring

* update evm version

* refactor code

* fix(ui-ux): tx for contract creation - to is incorrect (#254)

* fix(ui-ux): tx for contract creation - to is incorrect

* redirect to contract page

* json upload fix

* minor fixes

* removed unused code

* code refactor

* remove liceance selection

* remove unused whitelisted url

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: pierregee <[email protected]>

* feat(core): update domain name for node testnet (#264)

* feat(core): update domain name for node testnet

* update chains url

* feature(ui-ux): added support to specify library name and address to verify SC (#263)

* added lib support standard contract verification

* hide SolidityMultiPartFiles SC verification

* added placeholder

* feat(ui-ux): display read proxy and write proxy methods (#261)

* feat(ui-ux): display read proxy and write proxy methods

* update rpc url

* update rpc url on chains config

* feature(core): resolved conflicts with main (#267)

chore(ops): move to node 18 and update deps (#251)

* chore(ops): move to node 18 and update deps

* chore(ops): move to node 18 and update deps

Co-authored-by: JJ Adonis <[email protected]>

* feat(ui-ux): add tokens list (#265)

Co-authored-by: Lyka Labrada <[email protected]>

* fix(build): fix feature/contract branch build error (#268)

fix(build): fix feature branch build error

* feature(ui-ux): added support for multipart file upload (#266)

* feature(ui-ux): added support for multipart file upload

* minor fix

* code refactoring

* feature(ui-ux): added file upload ui changes (#269)

* minor refactoring

* added file upload ui cahnges

* fix(build): fix feature/contract build (#270)

* chore(ops): move to node 18 and update deps (#251) (#274)

* chore(ops): move to node 18 and update deps

* chore(ops): move to node 18 and update deps

Co-authored-by: JJ Adonis <[email protected]>

* fix(core): merge branch 'main' of github.com:WavesHQ/metascan into harsh/fix-conflicts (#275)

chore(ops): move to node 18 and update deps (#251)

* chore(ops): move to node 18 and update deps

* chore(ops): move to node 18 and update deps

Co-authored-by: JJ Adonis <[email protected]>

* fix(conflict): fix merge conflict to main (#276)

chore(ops): move to node 18 and update deps (#251)

* chore(ops): move to node 18 and update deps

* chore(ops): move to node 18 and update deps

Co-authored-by: JJ Adonis <[email protected]>

* feature(ui-ux): added maintenancepage (#277)

* feature(ui-ux): added maintanence page

* added verification url in constants

* Update src/pages/Maintenance.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update src/pages/Maintenance.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update src/pages/Maintenance.tsx

Co-authored-by: Lyka Labrada <[email protected]>

---------

Co-authored-by: Lyka Labrada <[email protected]>

* feature(ui-ux): minor SC UI updates (#278)

* added routing changes and cortract name

* added support for child path to show active header link

* removed consoles

* fix(build): fix build error (#280)

* fix(core): fixed linti issue (#281)

fix(core): fixed linting issue

* fix(conflict): Merge 'main' into branch feature/contract and fix conflict (#283)

chore(config): whitelist new ocean rpc (#282)

chore(config): use ocean rpc

* fix(ui-ux): added fix for health check (#284)

* fix(ui-ux): updated health api check (#286)

Update MainContainer.tsx

* feat(ui-ux): add token svg (#291)

* feature(ui-ux): added check for already verified contract address (#294)

* fix(ui-ux): fixed error message issue in InputComponent (#297)

* feat(ui-ux): add token details and contract, merge all addresses into one page `/address/[aid]` (#290)

* feat(ui-ux): add token details, transfers and holders api

* list - update N/A

* feat(ui-ux): update token list row ui

* feat(ui-ux): add [tokenId] page

* feat(ui-ux): fetch token creator and transfercount from diff apis

* feat(ui-ux): use query mutation to manually trigger requests

* feat(ui-ux): fix displayed tx type on token transfers

* feat(ui-ux): add tooltips for token details

* feat(ui-ux): add specific 404 for token details

* update tooltip design

* Fix ui alignment issues

* Fix null/0 address and symbol

* Update address QRcode value

* Add full border to some sections

* feat(ui-ux): redesign transaction row

* feat(ui-ux): fix overflow display

* fix(lint): fix lint errors

* fix(ui-ux): remove extra margin in contract details

* fix(ui-ux): fix tokens list pagination

* feat(ui-ux): add token contract

* feat(ui-ux): fix logs pagination loader

* fix tokens list pagination

* feat(ui-ux): share common components between contract and address page

* disable no-array-index-key rule

* feat(ui-ux): add loader for logs list

* fix empty token name

* updte token symbol color in list

* feat(ui-ux): display total tokens count of an address

* update any props

* feat(ui-ux): add tooltip on contract details page

* remove link shallow prop

* rename 'classname' prop to 'containerClassname'

* feature(ui-ux): added tokens listing in contract details (#288)

* refined tokens list in contracts

* pagination

* fix

* fixed pagination

---------

Co-authored-by: Lyka Labrada <[email protected]>

* update token holders skeloton loader

* adjust token holders list decimal scale

* fix(ui-ux): fixed txn loader (#289)

fix(ui-ux): fided txn loader

* chore(refactor): merge pages for address + contract + token + token contract (#293)

* chore(refactor): merge contract and token details page into address

* feat(ui-ux): add token page that uses same address component

* chore(refactor): update contract tokens api call

* chore(cleanup): remove console log, fix missing pagination

* fix(ui-ux): refetch list data on address change

* feat(ui-ux): remove transfers status, add type

* fix token holders pagination

* remove SC token list header

* fix(ui-ux): fixed table header alignment (#295)

* hide tab if no data available

* revert commit, hide token count if zero

* fix flickering screen

* remove redundant padding

* update passed data to transactionrow

* update token total supply tooltip

---------

Co-authored-by: Harsh R <[email protected]>

---------

Co-authored-by: Harsh R <[email protected]>

* chore(ui-ux): add comment to list data timeout, fix minor issues (#296)

* feat(ui-ux): add token details, transfers and holders api

* list - update N/A

* feat(ui-ux): update token list row ui

* feat(ui-ux): add [tokenId] page

* feat(ui-ux): fetch token creator and transfercount from diff apis

* feat(ui-ux): use query mutation to manually trigger requests

* feat(ui-ux): fix displayed tx type on token transfers

* feat(ui-ux): add tooltips for token details

* feat(ui-ux): add specific 404 for token details

* update tooltip design

* Fix ui alignment issues

* Fix null/0 address and symbol

* Update address QRcode value

* Add full border to some sections

* feat(ui-ux): redesign transaction row

* feat(ui-ux): fix overflow display

* fix(lint): fix lint errors

* fix(ui-ux): remove extra margin in contract details

* fix(ui-ux): fix tokens list pagination

* feat(ui-ux): add token contract

* feat(ui-ux): fix logs pagination loader

* fix tokens list pagination

* feat(ui-ux): share common components between contract and address page

* disable no-array-index-key rule

* feat(ui-ux): add loader for logs list

* fix empty token name

* updte token symbol color in list

* feat(ui-ux): display total tokens count of an address

* update any props

* feat(ui-ux): add tooltip on contract details page

* remove link shallow prop

* rename 'classname' prop to 'containerClassname'

* feature(ui-ux): added tokens listing in contract details (#288)

* refined tokens list in contracts

* pagination

* fix

* fixed pagination

---------

Co-authored-by: Lyka Labrada <[email protected]>

* update token holders skeloton loader

* adjust token holders list decimal scale

* fix(ui-ux): fixed txn loader (#289)

fix(ui-ux): fided txn loader

* chore(refactor): merge pages for address + contract + token + token contract (#293)

* chore(refactor): merge contract and token details page into address

* feat(ui-ux): add token page that uses same address component

* chore(refactor): update contract tokens api call

* chore(cleanup): remove console log, fix missing pagination

* fix(ui-ux): refetch list data on address change

* feat(ui-ux): remove transfers status, add type

* fix token holders pagination

* remove SC token list header

* fix(ui-ux): fixed table header alignment (#295)

* hide tab if no data available

* revert commit, hide token count if zero

* fix flickering screen

* remove redundant padding

* update passed data to transactionrow

* update token total supply tooltip

---------

Co-authored-by: Harsh R <[email protected]>

* chore(ui-ux): add comment to list data timeout

* chore(ui-ux): cleanup minor code issues

* add loader on page number change

* put back react/no-array-index-key lint rule

---------

Co-authored-by: Harsh R <[email protected]>

* fix(ui-ux): hide tokens count for tokens details page (#300)

* fix(ui-ux): fixed amount not converted correctly on tokens page (#299)

* fix(ui-ux): fixed alignment issue for decode input in txn detail page (#301)

* fix(ui-ux): fixed alignment issue for decode input in txn detail page

* minor improvement

* feature(ui-ux): updated footer to add explorer links (#307)

* fix(ui-ux): txn count in verified SC listing (#306)

* fix(ui-ux): txn count in verified SC listing

* fixed padding issue for codebox

* fix(ui-ux): fix null symbol on token transfers list (#305)

* fix(ui-ux): fix incorrect active tab when moving to token page (#304)

* fix(ui-ux): fix incorrect active tab when moving to token page

* also update token link for mobile

---------

Co-authored-by: Pierre Gee <[email protected]>

* feature(ui-ux): added token link in txn details  (#309)

* feature(ui-ux): added token link in txn details page and solved some alignment issue

* token row alignment fix

* feat(ui-ux): add tooltip for mobile and tablet view (#308)

* feat(ui-ux): add tooltip for mobile and tablet view

* fix typo

---------

Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: pierregee <[email protected]>

* feat(core): update t and c (#302)

* feat(core): update t and c

* use semantic html

* add section 7-11

* fix typo

* fix typos

* fix typos

* add periods

---------

Co-authored-by: Lyka Labrada <[email protected]>

* fix(ui-ux): fix multiple re-renders, add common `useFetchListData` hook (#303)

* fix(ui-ux): fix multiple re-renders, add common useFetchListData hook

* remove unnecessary fetchedData var

* feat(ui-ux): use 'source' query params to fix rerender issue on tab change (#310)

* chore(e2e): add e2e test for blocks list page and tx details page (#311)

* chore(e2e): add e2e test for blocks list page

* change blocks file into directory

* chore(e2e): initial tx details page e2e

* chore(e2e): e2e test for tx details page

* chore(e2e): add test for token minting tx type

---------

Co-authored-by: Pierre Gee <[email protected]>

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: pierregee <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Keng Ye <[email protected]>
  • Loading branch information
6 people authored Aug 7, 2023
1 parent be8051e commit 4b37d65
Show file tree
Hide file tree
Showing 126 changed files with 10,548 additions and 3,570 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": ["./node_modules/@waveshq/standard-web-linter"],
"globals": {
"JSX": "readonly"
},
"rules": {
"jsx-a11y/no-static-element-interactions": [
"error",
Expand Down Expand Up @@ -34,6 +37,9 @@
{ "props": true, "ignorePropertyModificationsFor": ["state"] }
],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/no-useless-constructor": "off",
"import/prefer-default-export": "warn"
}
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ public-hoist-pattern[]=*defichain*
engine-strict=true
auto-install-peers=true
enable-pre-post-scripts=true
node-linker=hoisted
183 changes: 183 additions & 0 deletions cypress/e2e/pages/blocks/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
context("/blocks on macbook-16", () => {
const BASE_URL = Cypress.config().baseUrl;

beforeEach(() => {
cy.visit("/blocks");
cy.viewport("macbook-16");
});

it("should have page header, footer and search bar", () => {
cy.findByTestId("header-container").should("be.visible");
cy.findByTestId("footer-container").should("be.visible");
cy.findByTestId("search-bar-container").should("be.visible");
});

it("should have heading and list table container", () => {
cy.findByTestId("blocks-list")
.should("be.visible")
.within(() => {
cy.get("h1").should("have.text", "Blocks");
});
});

it("should have data row with block information", () => {
cy.findAllByTestId("mobile-block-row").should("not.exist");
cy.findAllByTestId("desktop-block-row").should("be.visible");
cy.findAllByTestId("desktop-block-row")
.first()
.within(() => {
cy.get('[data-testid^="block-number-"]')
.should("be.visible")
.should("have.attr", "href")
.and("include", "/block/");

cy.findByTestId("block-reward")
.should("be.visible")
.within(() => {
cy.get("span").eq(0).contains("Reward");
cy.get("span").eq(1).contains("DFI");
});

cy.findByTestId("fee-recipient")
.should("be.visible")
.within(() => {
cy.get("span").contains("Fee recipient");
cy.get("a")
.should("contain.text", "0x")
.should("have.attr", "href")
.and("include", "/address/");
});

cy.findByTestId("block-txs-count")
.should("be.visible")
.within(() => {
cy.get("span").contains(" transactions");
});

cy.findByTestId("desktop-block-timeago")
.should("be.visible")
.within(() => {
cy.get("span").contains(" ago");
});
});
});

it("should display pagination on top and bottom part of the page", () => {
cy.findAllByTestId("pagination-container").should("have.length", 2); // top & bottom

// Top pagination, test `next` pages
cy.findAllByTestId("pagination-container").eq(0).should("be.visible");
cy.findAllByTestId("pagination-container")
.eq(0)
.within(() => {
cy.findByTestId("Pagination.Prev").should("not.exist");
cy.findByTestId("Pagination.Next").should("be.visible");

let nextPageLink = "";
cy.findByTestId("page-2")
.should("be.visible")
.invoke("attr", "href")
.then((value) => {
nextPageLink = value || "";
});
cy.findByTestId("page-2").click();
cy.then(() => {
cy.location("href").should("eq", `${BASE_URL}${nextPageLink}`);
cy.findByTestId("Pagination.Prev").should("be.visible");
});
});

// Bottom pagination, test `previous` pages
cy.findAllByTestId("pagination-container").eq(1).should("be.visible");
cy.findAllByTestId("pagination-container")
.eq(1)
.within(() => {
cy.findByTestId("Pagination.Prev").should("be.visible");
cy.findByTestId("Pagination.Next").should("be.visible");

let prevPageLink = "";
cy.findByTestId("Pagination.Prev")
.should("be.visible")
.invoke("attr", "href")
.then((value) => {
prevPageLink = value || "";
});
cy.findByTestId("Pagination.Prev").click();
cy.then(() => {
cy.location("href").should("eq", `${BASE_URL}${prevPageLink}`);
cy.findByTestId("Pagination.Prev").should("not.exist");
cy.findByTestId("Pagination.Next").should("be.visible");
});
});
});
});

context("/blocks on iphone-x", () => {
beforeEach(() => {
cy.visit("/blocks");
cy.viewport("iphone-x");
});

it("should have page header, footer and search bar", () => {
cy.findByTestId("header-container").should("be.visible");
cy.findByTestId("header-openMenu").should("be.visible");
cy.findByTestId("footer-container").should("be.visible");
cy.findByTestId("search-bar-container").should("be.visible");
});

it("should have heading and list table container", () => {
cy.findByTestId("blocks-list")
.should("be.visible")
.within(() => {
cy.get("h1").should("have.text", "Blocks");
});
});

it("should have data row with block information", () => {
cy.findAllByTestId("desktop-block-row").should("not.exist");
cy.findAllByTestId("mobile-block-row").should("be.visible");
cy.findAllByTestId("mobile-block-row")
.first()
.within(() => {
cy.get('[data-testid^="block-number-"]')
.should("be.visible")
.should("have.attr", "href")
.and("include", "/block/");

cy.findByTestId("block-reward")
.should("be.visible")
.within(() => {
cy.get("span").eq(0).contains("Reward");
cy.get("span").eq(1).contains("DFI");
});

cy.findByTestId("fee-recipient")
.should("be.visible")
.within(() => {
cy.get("span").contains("Fee recipient");
cy.get("a")
.should("contain.text", "0x")
.should("have.attr", "href")
.and("include", "/address/");
});

cy.findByTestId("block-txs-count")
.should("be.visible")
.within(() => {
cy.get("span").contains(" transactions");
});

cy.findByTestId("mobile-block-timeago")
.should("be.visible")
.within(() => {
cy.get("span").contains(" ago");
});
});
});

it("should display pagination on top and bottom part of the page", () => {
cy.findAllByTestId("pagination-container").should("have.length", 2); // top & bottom
cy.findAllByTestId("pagination-container").eq(0).should("be.visible");
cy.findAllByTestId("pagination-container").eq(1).should("be.visible");
});
});
73 changes: 73 additions & 0 deletions cypress/e2e/pages/transaction/TokenMinting.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
context("/tx/[tid] on macbook-16", () => {
const txHash =
"0x760e433e8d215309412d8ecd9927192ddf61d0f2546e532951c129ce5bc33c7b";

beforeEach(() => {
cy.visit(`/tx/${txHash}`);
cy.viewport("macbook-16");
});

it("should display page header, footer and search bar", () => {
cy.findByTestId("header-container").should("be.visible");
cy.findByTestId("footer-container").should("be.visible");
cy.findByTestId("search-bar-container").should("be.visible");
});

it("should display page title", () => {
cy.findByTestId("transaction-details-title")
.should("be.visible")
.should("have.text", "Transaction details");
});

it("should display transaction details", () => {
cy.findByTestId("tx-hash").should("have.text", txHash);
cy.findByTestId("transaction-timestamp").contains(
"(07-26-2023 09:31:33 AM +UTC)"
);
cy.findByTestId("transaction-block").should("have.text", "89946");
cy.findByTestId("transaction-block")
.should("have.attr", "href")
.and("include", `/block/89946`);
cy.findByTestId("transaction-confirmations").contains(" blocks");
cy.findByTestId("transaction-type").should("have.text", "Token minting");
cy.findByTestId("transaction-status").should("have.text", "Success");
cy.findByTestId("transaction-amount").contains("0.00000000 DFI");
cy.findByTestId("transaction-fee").should("have.text", "0.00042306 DFI");
});

it("should display wallet details", () => {
// From address
cy.findByTestId("from-title").should("have.text", "From");
cy.findByTestId("transaction-details-from")
.should("have.attr", "href")
.and("include", "/address/0x36375828fd821935cFf3E8AB6322cAb54BBfaDeC");
// Interacted with contract
cy.findByTestId("interacted-with-contract-(to)-title").should(
"have.text",
"Interacted with contract (To)"
);
cy.findByTestId("transaction-details-to")
.should("have.attr", "href")
.and("include", "/address/0xE815f2aD238B218E6becb93d846EA8FF90eDB39C");
// Tokens minted
cy.findByTestId("tokens-minted-title").should("have.text", "Tokens minted");
cy.findByTestId("token-transfers").should("be.visible");
cy.findByTestId("token-transferred-from")
.should("have.attr", "href")
.and("include", "/address/0x0000000000000000000000000000000000000000");
cy.findByTestId("token-transferred-to")
.should("have.attr", "href")
.and("include", "/address/0x36375828fd821935cFf3E8AB6322cAb54BBfaDeC");
// For token
cy.findByTestId("token-transferred-for").should("be.visible");
cy.findByTestId("for-token-container").contains("For: ");
cy.findByTestId("token-transferred-for").should(
"have.text",
"100,000.00000000"
);
cy.findAllByTestId("token-transferred-for-symbol")
.should("contain.text", "fDUSD")
.should("have.attr", "href")
.and("include", "/token/0xE815f2aD238B218E6becb93d846EA8FF90eDB39C");
});
});
Loading

0 comments on commit 4b37d65

Please sign in to comment.