Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Viterbo committed Jul 17, 2023
1 parent 1faf296 commit 9ba9107
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: tests
uses: actions/setup-node@v1
with:
node-version: '16.17.0'
node-version: '16.10.0'
- run: yarn install
- run: yarn test
- run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
16.10.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"last 5 Opera versions"
],
"engines": {
"node": ">= 10.18.1",
"node": ">= 16.10.0",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
Expand Down
1 change: 0 additions & 1 deletion src/antelope/stores/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export const useBalancesStore = defineStore(store_name, {
// so that the caller can subscribe to the confirmation event
response.wait = async () => whenConfirmed;
} else {
// TODO: mobile fix
if (usePlatformStore().isMobile) {
response.wait = async () => Promise.resolve({} as ethers.providers.TransactionReceipt);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/antelope/wallets/authenticators/EVMAuthenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export abstract class EVMAuthenticator {
if (accounts.length > 0) {
return accounts[0] as addressString;
} else {
console.log('----------', checkProvider.provider, checkProvider);
if (!checkProvider.provider.request) {
throw new AntelopeError('antelope.evm.error_support_provider_request');
}
Expand Down
7 changes: 0 additions & 7 deletions src/antelope/wallets/authenticators/WalletConnectAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class WalletConnectAuth extends EVMAuthenticator {

// We are already logged in. Now let's try to force the wallet to connect to the correct network
try {
// TODO: mobile fix
if (!usePlatformStore().isMobile) {
await super.login(network);
}
Expand Down Expand Up @@ -175,14 +174,8 @@ export class WalletConnectAuth extends EVMAuthenticator {

async isConnectedTo(chainId: string): Promise<boolean> {
this.trace('isConnectedTo', chainId);
// TODO: mobile fix
// if (usePlatformStore().isMobile) {
// this.trace('isConnectedTo', 'on mobile hardcodded true');
// return true;
// }
return new Promise(async (resolve) => {
const web3Provider = await this.web3Provider();
console.log('----- web3Provider', web3Provider.network.chainId, web3Provider);
const correct = +web3Provider.network.chainId === +chainId;
this.trace('isConnectedTo', chainId, correct ? 'OK!' : 'not connected');
resolve(correct);
Expand Down
3 changes: 0 additions & 3 deletions src/boot/antelope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,3 @@ export default boot(({ app }) => {
}

});


console.error('TODO: remove https');
1 change: 1 addition & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const setPreferredService = (service) => {

export default function (/* { store, ssrContext } */) {
const createHistory = createWebHistory;

const Router = createRouter({
scrollBehavior: () => ({ left: 0, top: 0 }),
routes,
Expand Down
6 changes: 6 additions & 0 deletions test/jest/__tests__/antelope/stores/balances.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ jest.mock('src/antelope/config', () => ({
}));


jest.mock('@wagmi/core', () => ({
prepareSendTransaction: jest.fn(),
prepareWriteContract: jest.fn(),
}));


import { useBalancesStore } from 'src/antelope/stores/balances';

describe('Antelope Balance Store', () => {
Expand Down

0 comments on commit 9ba9107

Please sign in to comment.