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

Commit

Permalink
Try w/o prebuilt dist
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Jul 14, 2021
1 parent b1bd716 commit ea886ce
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 30 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ jobs:
run: |
mkdir .yarncache
yarn install --cache-folder ./.yarncache --frozen-lockfile
rm -rf .yarncache
yarn cache clean
- run: yarn test:coverage

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"lint:check": "eslint './src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "yarn lint:check --fix",
"postinstall": "patch-package && electron-builder install-app-deps && yarn generate-types && yarn copy-gateway-types",
"preinstall": "if [ $GITHUB_ACTIONS ]; then yarn config set network-concurrency 2; fi",
"preelectron-pack": "yarn build",
"prettier:check": "yarn prettier --check",
"prettier:fix": "yarn prettier --write",
Expand Down Expand Up @@ -167,7 +168,7 @@
"@gnosis.pm/safe-contracts": "1.1.1-dev.2",
"@gnosis.pm/safe-deployments": "^1.0.0",
"@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#17058d4",
"@gnosis.pm/safe-react-gateway-sdk": "https://github.com/gnosis/safe-react-gateway-sdk.git#1550ebd",
"@gnosis.pm/safe-react-gateway-sdk": "https://github.com/gnosis/safe-react-gateway-sdk.git#14b436e",
"@ledgerhq/hw-transport-node-hid-singleton": "5.51.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.11.0",
Expand Down Expand Up @@ -271,7 +272,7 @@
"electron": "^9.4.0",
"electron-builder": "22.10.5",
"electron-notarize": "1.0.0",
"eslint": "^7.29.0",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.3.1",
Expand All @@ -286,7 +287,7 @@
"redux-mock-store": "^1.5.4",
"sass": "^1.32.0",
"typechain": "^5.0.0",
"typescript": "4.3.4",
"typescript": "^4.3.5",
"wait-on": "^5.3.0"
}
}
4 changes: 2 additions & 2 deletions src/logic/currencyValues/api/fetchAvailableCurrencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getFiatCurrencies, GatewayDefinitions } from '@gnosis.pm/safe-react-gateway-sdk'
import { getNetworkName } from 'src/config'
import { getClientGatewayUrl } from 'src/config'

export const fetchAvailableCurrencies = async (): Promise<GatewayDefinitions['FiatCurrencies']> => {
return getFiatCurrencies(getNetworkName())
return getFiatCurrencies(getClientGatewayUrl())
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ describe('fetchTokenCurrenciesBalances', () => {
selectedCurrency: 'USD',
})

expect(getBalances).toHaveBeenCalledWith('RINKEBY', '0xdfA693da0D16F5E7E78FdCBeDe8FC6eBEa44f1Cf', 'USD', {
exclude_spam: true,
trusted: false,
})
expect(getBalances).toHaveBeenCalledWith(
'http://localhost:8001/v1',
'0xdfA693da0D16F5E7E78FdCBeDe8FC6eBEa44f1Cf',
'USD',
{
exclude_spam: true,
trusted: false,
},
)
})
})
8 changes: 5 additions & 3 deletions src/logic/safe/api/fetchTokenCurrenciesBalances.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getBalances, GatewayDefinitions } from '@gnosis.pm/safe-react-gateway-sdk'
import { getNetworkName } from 'src/config'
import { getClientGatewayUrl } from 'src/config'
import { checksumAddress } from 'src/utils/checksumAddress'

export type TokenBalance = {
Expand All @@ -24,7 +24,9 @@ export const fetchTokenCurrenciesBalances = async ({
excludeSpamTokens = true,
trustedTokens = false,
}: FetchTokenCurrenciesBalancesProps): Promise<BalanceEndpoint> => {
const network = getNetworkName()
const address = checksumAddress(safeAddress)
return getBalances(network, address, selectedCurrency, { exclude_spam: excludeSpamTokens, trusted: trustedTokens })
return getBalances(getClientGatewayUrl(), address, selectedCurrency, {
exclude_spam: excludeSpamTokens,
trusted: trustedTokens,
})
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getTransactionHistory, getTransactionQueue } from '@gnosis.pm/safe-react-gateway-sdk'
import { getNetworkName } from 'src/config'
import { getClientGatewayUrl } from 'src/config'
import { HistoryGatewayResponse, QueuedGatewayResponse } from 'src/logic/safe/store/models/types/gateway'
import { checksumAddress } from 'src/utils/checksumAddress'
import { Errors, CodedException } from 'src/logic/exceptions/CodedException'
Expand All @@ -25,7 +25,7 @@ export const loadPagedHistoryTransactions = async (

try {
const { results, next, previous } = await getTransactionHistory(
getNetworkName(),
getClientGatewayUrl(),
checksumAddress(safeAddress),
historyPointers[safeAddress].next,
)
Expand All @@ -40,7 +40,7 @@ export const loadPagedHistoryTransactions = async (

export const loadHistoryTransactions = async (safeAddress: string): Promise<HistoryGatewayResponse['results']> => {
try {
const { results, next, previous } = await getTransactionHistory(getNetworkName(), checksumAddress(safeAddress))
const { results, next, previous } = await getTransactionHistory(getClientGatewayUrl(), checksumAddress(safeAddress))

if (!historyPointers[safeAddress]) {
historyPointers[safeAddress] = { next, previous }
Expand Down Expand Up @@ -73,7 +73,7 @@ export const loadPagedQueuedTransactions = async (

try {
const { results, next, previous } = await getTransactionQueue(
getNetworkName(),
getClientGatewayUrl(),
checksumAddress(safeAddress),
queuedPointers[safeAddress].next,
)
Expand All @@ -88,7 +88,7 @@ export const loadPagedQueuedTransactions = async (

export const loadQueuedTransactions = async (safeAddress: string): Promise<QueuedGatewayResponse['results']> => {
try {
const { results, next, previous } = await getTransactionQueue(getNetworkName(), checksumAddress(safeAddress))
const { results, next, previous } = await getTransactionQueue(getClientGatewayUrl(), checksumAddress(safeAddress))

if (!queuedPointers[safeAddress] || queuedPointers[safeAddress].next === null) {
queuedPointers[safeAddress] = { next, previous }
Expand Down
4 changes: 2 additions & 2 deletions src/logic/safe/utils/safeInformation.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getSafeInfo as fetchSafeInfo, GatewayDefinitions } from '@gnosis.pm/safe-react-gateway-sdk'
import { Errors, CodedException } from 'src/logic/exceptions/CodedException'
import { getNetworkName } from 'src/config'
import { getClientGatewayUrl } from 'src/config'

export type SafeInfo = GatewayDefinitions['SafeAppInfo']

export const getSafeInfo = async (safeAddress: string): Promise<SafeInfo> => {
try {
return await fetchSafeInfo(getNetworkName(), safeAddress)
return await fetchSafeInfo(getClientGatewayUrl(), safeAddress)
} catch (e) {
throw new CodedException(Errors._605, e.message)
}
Expand Down
4 changes: 2 additions & 2 deletions src/logic/tokens/api/fetchSafeCollectibles.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getCollectibles, GatewayDefinitions } from '@gnosis.pm/safe-react-gateway-sdk'
import { getNetworkName } from 'src/config'
import { getClientGatewayUrl } from 'src/config'
import { checksumAddress } from 'src/utils/checksumAddress'

export type CollectibleResult = GatewayDefinitions['SafeCollectibleResponse']

export const fetchSafeCollectibles = async (safeAddress: string): Promise<CollectibleResult[]> => {
return getCollectibles(getNetworkName(), checksumAddress(safeAddress))
return getCollectibles(getClientGatewayUrl(), checksumAddress(safeAddress))
}
74 changes: 67 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1869,9 +1869,9 @@
classnames "^2.2.6"
react-media "^1.10.0"

"@gnosis.pm/safe-react-gateway-sdk@https://github.com/gnosis/safe-react-gateway-sdk.git#1550ebd":
"@gnosis.pm/safe-react-gateway-sdk@https://github.com/gnosis/safe-react-gateway-sdk.git#14b436e":
version "1.0.0"
resolved "https://github.com/gnosis/safe-react-gateway-sdk.git#1550ebd81076b4e6b0e413179804198c1bb8b832"
resolved "https://github.com/gnosis/safe-react-gateway-sdk.git#14b436e5b98a8393ec4dbfe1c99849bc7cb01d69"
dependencies:
unfetch "^4.2.0"

Expand Down Expand Up @@ -1919,6 +1919,20 @@
dependencies:
"@hapi/hoek" "^9.0.0"

"@humanwhocodes/config-array@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==
dependencies:
"@humanwhocodes/object-schema" "^1.2.0"
debug "^4.1.1"
minimatch "^3.0.4"

"@humanwhocodes/object-schema@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf"
integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==

"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
Expand Down Expand Up @@ -9306,7 +9320,7 @@ eslint-webpack-plugin@^2.5.2:
micromatch "^4.0.2"
schema-utils "^3.0.0"

eslint@^7.11.0, eslint@^7.29.0:
eslint@^7.11.0:
version "7.29.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0"
integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==
Expand Down Expand Up @@ -9351,6 +9365,52 @@ eslint@^7.11.0, eslint@^7.29.0:
text-table "^0.2.0"
v8-compile-cache "^2.0.3"

eslint@^7.30.0:
version "7.30.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8"
integrity sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==
dependencies:
"@babel/code-frame" "7.12.11"
"@eslint/eslintrc" "^0.4.2"
"@humanwhocodes/config-array" "^0.5.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.0.1"
doctrine "^3.0.0"
enquirer "^2.3.5"
escape-string-regexp "^4.0.0"
eslint-scope "^5.1.1"
eslint-utils "^2.1.0"
eslint-visitor-keys "^2.0.0"
espree "^7.3.1"
esquery "^1.4.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
file-entry-cache "^6.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.1.2"
globals "^13.6.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash.merge "^4.6.2"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
progress "^2.0.0"
regexpp "^3.1.0"
semver "^7.2.1"
strip-ansi "^6.0.0"
strip-json-comments "^3.1.0"
table "^6.0.9"
text-table "^0.2.0"
v8-compile-cache "^2.0.3"

espree@^7.3.0, espree@^7.3.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
Expand Down Expand Up @@ -20773,10 +20833,10 @@ typescript-tuple@^2.2.1:
dependencies:
typescript-compare "^0.0.2"

typescript@4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc"
integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==
typescript@^4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==

typical@^2.6.0, typical@^2.6.1:
version "2.6.1"
Expand Down

0 comments on commit ea886ce

Please sign in to comment.