Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract the dropdown menu from VRF v2 cost calculator #1446

Merged
merged 25 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d0d0331
extract-dropdown
simkasss Aug 8, 2023
9d4b0b5
remove mainChainName useState
simkasss Aug 9, 2023
6c4b725
improve useQueryString hook
simkasss Aug 9, 2023
fb2aeb4
improve getNetworkFromQueryString
simkasss Aug 9, 2023
cb78bff
return null
simkasss Aug 9, 2023
ce49d74
Remove useless DropdownMenu component + fill dropdown input with late…
Aug 9, 2023
550db0f
Refactor CostTable component to fix bugs in getting state values
Aug 9, 2023
51ff59c
Fix bug where API call was made with undefined or null input
Aug 9, 2023
0894fc6
Add additional states to reducer state to have a single source of truth
Aug 9, 2023
a4a5457
Implement throttle for API calls
Aug 9, 2023
8877cee
Remove logging
Aug 9, 2023
d44a554
WIP to fix API call rate limit bug
Aug 10, 2023
5afe392
Fixed issue where loading text did not appear when a network was sele…
yacine-benichou Aug 28, 2023
d279e1e
Use env variables to get VRF calculator API url + clean code
yacine-benichou Aug 29, 2023
69d1013
Remove comments in methodCheckbox component
yacine-benichou Aug 29, 2023
39f7115
Fix type errors in CostTable.test.ts file
yacine-benichou Aug 29, 2023
2180713
Empty commit
Aug 29, 2023
a1fc230
account test
Aug 29, 2023
1835a29
new email set
Aug 29, 2023
25cb85b
empty commit
Aug 29, 2023
b8757ab
Empty commit
Aug 30, 2023
b815856
Use env variable in costTable test file
Aug 30, 2023
1d33c39
Remove env variable use
Aug 30, 2023
5d80d00
fix lint issue
Aug 30, 2023
3c3e2aa
Update src/features/data/chains.ts
dwightjl Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
},
moduleNameMapper: {
"\\.(css)$": "<rootDir>/src/__mocks__/styleMock.ts",
"^~/(.*)$": "<rootDir>/src/$1",
},
transformIgnorePatterns: ["<rootDir>/node_modules/"],
}
47 changes: 0 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"github-slugger": "^2.0.0",
"nanostores": "^0.8.1",
"preact": "^10.16.0",
"query-string": "^8.1.0",
"react-instantsearch-hooks-web": "^6.47.3"
},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions src/features/data/chains.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { getNetworkFromQueryString, CHAINS } from "./chains"
import { expect, test } from "@jest/globals"

describe("getNetworkFromQueryString", () => {
test("works with testnet", () => {
const queryString = "ethereum-sepolia"
const chain = CHAINS.filter((chain) => chain.label === "Ethereum")[0]
const chainNetwork = chain.networks.filter((network) => network.name === "Sepolia Testnet")[0]
expect(getNetworkFromQueryString(queryString)).toEqual({ chain, chainNetwork })
})

test("works with mainnet", () => {
const queryString = "polygon-mainnet"
const chain = CHAINS.filter((chain) => chain.label === "Polygon (Matic)")[0]
const chainNetwork = chain.networks.filter((network) => network.name === "Polygon Mainnet")[0]
expect(getNetworkFromQueryString(queryString)).toEqual({ chain, chainNetwork })
})
test("return null when invalid queryString", () => {
const queryString = "falsy-string"
expect(getNetworkFromQueryString(queryString)).toEqual({ chain: null, chainNetwork: null })
})
})
Loading
Loading