Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into refactor/btc-history
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelylovas committed Aug 13, 2024
2 parents f9fbb13 + ce79553 commit eaee348
Show file tree
Hide file tree
Showing 95 changed files with 5,133 additions and 3,933 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/e2e_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on:
types: [opened, reopened, 'synchronize', 'ready_for_review']
jobs:
build:
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest-16-cores-core-extension
if: ${{ !github.event.pull_request.draft }}
environment: alpha
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Checkout extension
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Create env file
Expand Down Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Remove onboarding video
run: |
rm -fv ./dist/images/core-ext-hero-hq.webm
- name: Add extension key to manifest file
run: |
echo $(cat ./dist/manifest.json | jq '.key = "${{ secrets.EXTENSION_PUBLIC_KEY }}"') > ./dist/manifest.json
- name: Generate a zip
run: yarn zip
- name: Output extension file version before renaming
Expand All @@ -71,9 +74,9 @@ jobs:
name: extension
path: extension.zip
e2e:
runs-on: ubuntu-latest-16-cores-core-extension
needs: build
name: Run E2E Smoke Tests
runs-on: ubuntu-latest-16-cores
environment: e2e
env:
RUNNER: CI
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"@avalabs/core-coingecko-sdk": "3.0.1-alpha.1",
"@avalabs/core-covalent-sdk": "3.0.1-alpha.1",
"@avalabs/core-etherscan-sdk": "3.0.1-alpha.1",
"@avalabs/core-k2-components": "4.18.0-alpha.44",
"@avalabs/core-snowtrace-sdk": "3.0.1-alpha.1",
"@avalabs/core-token-prices-sdk": "3.0.1-alpha.1",
"@avalabs/core-utils-sdk": "3.0.1-alpha.1",
"@avalabs/core-wallets-sdk": "3.0.1-alpha.1",
"@avalabs/glacier-sdk": "3.0.1-alpha.1",
"@avalabs/glacier-sdk": "2.8.0-alpha.188",
"@avalabs/hw-app-avalanche": "0.14.1",
"@avalabs/core-k2-components": "4.18.0-alpha.47",
"@avalabs/types": "3.0.1-alpha.1",
"@avalabs/vm-module-types": "0.1.4",
"@blockaid/client": "0.10.0",
Expand Down
1 change: 1 addition & 0 deletions src/background/connections/extensionConnection/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export enum ExtensionRequest {
UNIFIED_BRIDGE_GET_FEE = 'unified_bridge_get_fee',
UNIFIED_BRIDGE_ESTIMATE_GAS = 'unified_bridge_estimate_gas',
UNIFIED_BRIDGE_TRANSFER_ASSET = 'unified_bridge_transfer_asset',
UNIFIED_BRIDGE_TRACK_TRANSFER = 'unified_bridge_track_transfer',
UNIFIED_BRIDGE_GET_STATE = 'unified_bridge_get_state',
UNIFIED_BRIDGE_GET_ASSETS = 'unified_bridge_get_assets',

Expand Down
26 changes: 2 additions & 24 deletions src/background/connections/extensionConnection/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { BridgeGetConfigHandler } from '@src/background/services/bridge/handlers
import { BridgeGetStateHandler } from '@src/background/services/bridge/handlers/getBridgeState';
import { BridgeRemoveTransactionHandler } from '@src/background/services/bridge/handlers/removeBridgeTransaction';
import { BridgeSetIsDevEnvHandler } from '@src/background/services/bridge/handlers/setIsDevEnv';
import { BridgeTransferAssetHandler } from '@src/background/services/bridge/handlers/transferAsset';
import { ContactsUpdatedEvents } from '@src/background/services/contacts/events/contactsUpdatedEvent';
import { CreateContactHandler } from '@src/background/services/contacts/handlers/createContact';
import { GetContactsHandler } from '@src/background/services/contacts/handlers/getContacts';
Expand Down Expand Up @@ -75,7 +74,6 @@ import { RemoveFavoriteNetworkHandler } from '@src/background/services/network/h
import { GetNetworksStateHandler } from '@src/background/services/network/handlers/getNetworkState';
import { GetFeatureFlagsHandler } from '@src/background/services/featureFlags/handlers/getFeatureFlags';
import { FeatureFlagsUpdatedEvent } from '@src/background/services/featureFlags/events/featureFlagsUpdatedEvent';
import { GetEthMaxTransferAmountHandler } from '@src/background/services/bridge/handlers/getEthMaxTransferAmount';
import { CloseLedgerTransportHandler } from '@src/background/services/ledger/handlers/closeOpenTransporters';
import { LedgerCloseTransportEvent } from '@src/background/services/ledger/events/ledgerCloseTransport';
import { GetAvaxBalanceHandler } from '@src/background/services/balances/handlers/getAvaxBalance';
Expand Down Expand Up @@ -107,14 +105,10 @@ import { GetRecoveryPhraseExportStateHandler } from '@src/background/services/se
import { InitRecoveryPhraseExportHandler } from '@src/background/services/seedless/handlers/initRecoveryPhraseExport';
import { CompleteRecoveryPhraseExportHandler } from '@src/background/services/seedless/handlers/completeRecoveryPhraseExport';
import { CancelRecoveryPhraseExportHandler } from '@src/background/services/seedless/handlers/cancelRecoveryPhraseExport';
import { UnifiedBridgeTransferAsset } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeTransferAsset';
import { UnifiedBridgeGetFee } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeGetFee';
import { UnifiedBridgeGetState } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeGetState';
import { UnifiedBridgeGetAssets } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeGetAssets';
import { UnifiedBridgeEvents } from '@src/background/services/unifiedBridge/events/unifiedBridgeEvents';
import { GetPrivateKeyHandler } from '@src/background/services/accounts/handlers/getPrivateKey';
import { EstimateGasForBridgeTxHandler } from '@src/background/services/bridge/handlers/estimateGasForBridgeTx';
import { UnifiedBridgeEstimateGas } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeEstimateGas';
import { ImportSeedPhraseHandler } from '@src/background/services/wallet/handlers/importSeedPhrase';
import { ImportLedgerHandler } from '@src/background/services/wallet/handlers/importLedger';
import { GetRecoveryMethodsHandler } from '@src/background/services/seedless/handlers/getRecoveryMethods';
Expand All @@ -134,6 +128,7 @@ import { SetActiveNetworkHandler } from '@src/background/services/network/handle
import { StartBalancesPollingHandler } from '@src/background/services/balances/handlers/startBalancesPolling';
import { StopBalancesPollingHandler } from '@src/background/services/balances/handlers/stopBalancesPolling';
import { BalancesUpdatedEvents } from '@src/background/services/balances/events/balancesUpdatedEvent';
import { UnifiedBridgeTrackTransfer } from '@src/background/services/unifiedBridge/handlers/unifiedBridgeTrackTransfer';

/**
* TODO: GENERATE THIS FILE AS PART OF THE BUILD PROCESS
Expand Down Expand Up @@ -171,11 +166,6 @@ import { BalancesUpdatedEvents } from '@src/background/services/balances/events/
token: 'ExtensionRequestHandler',
useToken: BridgeRemoveTransactionHandler,
},
{ token: 'ExtensionRequestHandler', useToken: BridgeTransferAssetHandler },
{
token: 'ExtensionRequestHandler',
useToken: GetEthMaxTransferAmountHandler,
},
{ token: 'ExtensionRequestHandler', useToken: CreateContactHandler },
{ token: 'ExtensionRequestHandler', useToken: GetContactsHandler },
{ token: 'ExtensionRequestHandler', useToken: UpdateContactHandler },
Expand Down Expand Up @@ -318,20 +308,12 @@ import { BalancesUpdatedEvents } from '@src/background/services/balances/events/
},
{
token: 'ExtensionRequestHandler',
useToken: UnifiedBridgeTransferAsset,
},
{
token: 'ExtensionRequestHandler',
useToken: UnifiedBridgeGetFee,
useToken: UnifiedBridgeTrackTransfer,
},
{
token: 'ExtensionRequestHandler',
useToken: UnifiedBridgeGetState,
},
{
token: 'ExtensionRequestHandler',
useToken: UnifiedBridgeGetAssets,
},
{
token: 'ExtensionRequestHandler',
useToken: GetPrivateKeyHandler,
Expand All @@ -340,10 +322,6 @@ import { BalancesUpdatedEvents } from '@src/background/services/balances/events/
token: 'ExtensionRequestHandler',
useToken: EstimateGasForBridgeTxHandler,
},
{
token: 'ExtensionRequestHandler',
useToken: UnifiedBridgeEstimateGas,
},
{
token: 'ExtensionRequestHandler',
useToken: ImportSeedPhraseHandler,
Expand Down
6 changes: 6 additions & 0 deletions src/background/services/balances/handlers/getNftBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export class GetNftBalancesHandler implements HandlerType {
[TokenType.ERC1155]: undefined,
};
}
if (!scope) {
return {
...request,
error: 'No request scope provided',
};
}
const currentNetwork = await this.networkService.getNetwork(scope);

if (!currentNetwork) {
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/balances/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export interface Balances {
};
}

export const CLOUDFLARE_IPFS_URL = 'https://cloudflare-ipfs.com';
export const IPFS_URL = 'https://ipfs.io';

export interface CachedBalancesInfo {
totalBalance?: TotalBalance;
Expand Down
6 changes: 5 additions & 1 deletion src/background/services/blockaid/BlockaidService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export class BlockaidService {
from: tx.from,
to: tx.to,
data: tx.data,
value: tx.value,
// BigInt cannot be JSON-stringified
value:
typeof tx.value === 'bigint'
? `0x${tx.value.toString(16)}`
: tx.value,
},
metadata: { domain },
});
Expand Down
Loading

0 comments on commit eaee348

Please sign in to comment.