Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 36 additions & 2 deletions .github/workflows/pioneer-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: build
run: |
yarn install --frozen-lockfile
yarn workspace pioneer run build
yarn workspace pioneer build

pioneer_build_osx:
name: MacOS Build
Expand All @@ -34,4 +34,38 @@ jobs:
- name: build
run: |
yarn install --frozen-lockfile
yarn workspace pioneer run build
yarn workspace pioneer build

pioneer_lint_ubuntu:
name: Ubuntu Linting
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: lint
run: |
yarn install --frozen-lockfile
yarn workspace pioneer lint

pioneer_lint_osx:
name: MacOS Linting
runs-on: macos-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: lint
run: |
yarn install --frozen-lockfile
yarn workspace pioneer lint
6 changes: 5 additions & 1 deletion pioneer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = {
},
rules: {
...base.rules,
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/camelcase': 'off',
'react/prop-types': 'off',
'new-cap': 'off',
'@typescript-eslint/interface-name-prefix': 'off'
}
};
71 changes: 0 additions & 71 deletions pioneer/.github/workflows/pr-any.yml

This file was deleted.

32 changes: 0 additions & 32 deletions pioneer/.github/workflows/push-master.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pioneer/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: '@polkadot/dev-react/config/babel',
sourceType: 'unambiguous',
sourceType: 'unambiguous'
};
2 changes: 2 additions & 0 deletions pioneer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"clean": "polkadot-dev-clean-build",
"clean:i18n": "rm -rf packages/apps/public/locales/en && mkdir -p packages/apps/public/locales/en",
"lint": "eslint --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
"lint-only-errors": "eslint --quiet --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
"lint-autofix": "eslint --fix --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
"postinstall": "polkadot-dev-yarn-only",
"test": "echo \"skipping tests\"",
"vanitygen": "node packages/app-accounts/scripts/vanitygen.js",
Expand Down
7 changes: 3 additions & 4 deletions pioneer/packages/app-accounts/src/MemoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import { Text } from '@polkadot/types';
type Props = MyAccountProps & {};

type State = {
memo: string,
modified: boolean,
memo: string;
modified: boolean;
};

class Component extends React.PureComponent<Props, State> {

state: State = {
memo: '',
modified: false,
modified: false
};

render () {
Expand Down
4 changes: 2 additions & 2 deletions pioneer/packages/app-accounts/src/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<P
label={t('Restore JSON')}
onClick={_toggleImport}
/>
{isLedger() && (
{isLedger() && (
<>
<Button.Or />
<Button
Expand Down Expand Up @@ -87,7 +87,7 @@ function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<P
onStatusChange={onStatusChange}
/>
)}
{accounts && Object.keys(accounts).map((address): React.ReactNode => (
{accounts && Object.keys(accounts).map((address): React.ReactNode => (
<Account
address={address}
key={address}
Expand Down
4 changes: 2 additions & 2 deletions pioneer/packages/app-accounts/src/modals/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ function Create ({ className, onClose, onStatusChange, seed: propsSeed, t, type:
};
const _onChangeName = (name: string): void => setName({ isNameValid: !!name.trim(), name });
const _toggleConfirmation = (): void => setIsConfirmationOpen(!isConfirmationOpen);
const context = useMyAccount()
const context = useMyAccount();

const _onCommit = (): void => {
if (!isValid) {
return;
}

const status = createAccount(`${seed}${derivePath}`, pairType, name, password, t('created account'));
context.set(status.account as string)
context.set(status.account as string);

_toggleConfirmation();
onStatusChange(status);
Expand Down
8 changes: 4 additions & 4 deletions pioneer/packages/app-accounts/src/modals/Derive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import React, { useContext, useEffect, useState } from 'react';
import { AddressRow, Button, Input, InputAddress, Modal, Password, StatusContext } from '@polkadot/react-components';
import { useDebounce } from '@polkadot/react-components/hooks';
import keyring from '@polkadot/ui-keyring';
import { isPasswordValid } from '@polkadot/joy-utils/accounts';
import { isPasswordValid, downloadAccount } from '@polkadot/joy-utils/accounts';
import { keyExtractPath } from '@polkadot/util-crypto';

import { useMyAccount } from '@polkadot/joy-utils/MyAccountContext';

import translate from '../translate';
import { downloadAccount } from '@polkadot/joy-utils/accounts';

import CreateConfirmation from './CreateConfirmation';

interface Props extends I18nProps {
Expand Down Expand Up @@ -82,7 +82,7 @@ function Derive ({ className, from, onClose, t }: Props): React.ReactElement {
const [suri, setSuri] = useState('');
const debouncedSuri = useDebounce(suri);
const isValid = !!address && !deriveError && isNameValid && isPassValid;
const context = useMyAccount()
const context = useMyAccount();

useEffect((): void => {
setIsLocked(source.isLocked);
Expand Down Expand Up @@ -122,7 +122,7 @@ function Derive ({ className, from, onClose, t }: Props): React.ReactElement {
}

const status = createAccount(source, suri, name, password, t('created account'));
context.set(status.account as string)
context.set(status.account as string);

_toggleConfirmation();
queueAction(status);
Expand Down
2 changes: 1 addition & 1 deletion pioneer/packages/app-accounts/src/modals/Import.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Import extends TxComponent<Props, State> {
status.message = t('account restored');

InputAddress.setLastValue('account', address);
this.context.set(address)
this.context.set(address);
} catch (error) {
this.setState({ isPassValid: true });

Expand Down
4 changes: 2 additions & 2 deletions pioneer/packages/app-accounts/src/modals/Qr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Props extends I18nProps, ModalProps {
function QrModal ({ className, onClose, onStatusChange, t }: Props): React.ReactElement<Props> {
const [{ isNameValid, name }, setName] = useState({ isNameValid: false, name: '' });
const [scanned, setScanned] = useState<Scanned | null>(null);
const context = useMyAccount()
const context = useMyAccount();

const _onNameChange = (name: string): void => setName({ isNameValid: !!name.trim(), name });

Expand All @@ -40,7 +40,7 @@ function QrModal ({ className, onClose, onStatusChange, t }: Props): React.React

keyring.addExternal(address, { genesisHash, name: name.trim() });
InputAddress.setLastValue('account', address);
context.set(address)
context.set(address);

onStatusChange({
account: address,
Expand Down
13 changes: 6 additions & 7 deletions pioneer/packages/app-address-book/src/MemoByAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ import MemoView from '@polkadot/joy-utils/memo/MemoView';
import { RouteComponentProps } from 'react-router';

type Props = RouteComponentProps & {
history: History,
history: History;
match: {
params: {
accountId?: string
}
}
accountId?: string;
};
};
};

type State = {
loaded: boolean,
accountInput?: string
loaded: boolean;
accountInput?: string;
};

export default class Component extends React.PureComponent<Props, State> {

static getDerivedStateFromProps (props: Props, currentState: State): State | null {
const { match: { params: { accountId } } } = props;
const { loaded } = currentState;
Expand Down
6 changes: 3 additions & 3 deletions pioneer/packages/app-explorer/src/SummarySession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ interface Props extends I18nProps {
sessionInfo?: DerivedSessionInfo;
withEra?: boolean;
withSession?: boolean;
epochIndex?: u64,
currentEraStartSessionIndex?: SessionIndex
epochIndex?: u64;
currentEraStartSessionIndex?: SessionIndex;
}

function renderSession ({ sessionInfo, t, withSession = true }: Props): React.ReactNode {
Expand Down Expand Up @@ -89,6 +89,6 @@ export default translate(
withCalls<Props>(
['derive.session.info', { propName: 'sessionInfo' }],
['query.babe.epochIndex', { propName: 'epochIndex' }],
['query.staking.currentEraStartSessionIndex', { propName: 'currentEraStartSessionIndex'}]
['query.staking.currentEraStartSessionIndex', { propName: 'currentEraStartSessionIndex' }]
)(SummarySession)
);
4 changes: 2 additions & 2 deletions pioneer/packages/app-staking/src/Actions/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props extends I18nProps, ComponentProps, ApiProps {
myControllers?: string[];
}

function getMyStashes(myControllers?: string[], allAccounts?: SubjectInfo): string[] | null {
function getMyStashes (myControllers?: string[], allAccounts?: SubjectInfo): string[] | null {
const result: string[] = [];

if (!myControllers) {
Expand All @@ -40,7 +40,7 @@ function getMyStashes(myControllers?: string[], allAccounts?: SubjectInfo): stri
return result;
}

function Accounts({
function Accounts ({
allAccounts,
allStashes,
className,
Expand Down
6 changes: 3 additions & 3 deletions pioneer/packages/app-staking/src/Overview/CurrentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Props extends I18nProps {
stakingOverview?: DerivedStakingOverview;
}

function renderColumn(
function renderColumn (
myAccounts: string[],
addresses: AccountId[] | string[],
defaultName: string,
Expand Down Expand Up @@ -56,11 +56,11 @@ function renderColumn(
);
}

function filterAccounts(list: string[] = [], without: AccountId[] | string[]): string[] {
function filterAccounts (list: string[] = [], without: AccountId[] | string[]): string[] {
return list.filter((accountId): boolean => !without.includes(accountId as any));
}

function CurrentList(props: Props): React.ReactElement<Props> {
function CurrentList (props: Props): React.ReactElement<Props> {
const { isSubstrateV2 } = useContext(ApiContext);
const [filter, setFilter] = useState<ValidatorFilter>('all');
const [myAccounts] = useState(keyring.getAccounts().map(({ address }): string => address));
Expand Down
Loading