Skip to content

Commit

Permalink
removed old logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bee344 committed Jul 23, 2024
1 parent 1924fcd commit dd61a51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
8 changes: 0 additions & 8 deletions packages/page-settings/src/Metadata/Extensions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ interface Props {

function Extensions({ chainInfo, className, rawMetadata }: Props): React.ReactElement<Props> {

Check failure on line 26 in packages/page-settings/src/Metadata/Extensions.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Missing space before function parentheses
const rawDef: MetadataDef = objectSpread<MetadataDef>({}, { ...chainInfo, rawMetadata: rawMetadata ? rawMetadata : '0x00' })

Check failure on line 27 in packages/page-settings/src/Metadata/Extensions.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Unnecessary use of conditional expression for default assignment

Check failure on line 27 in packages/page-settings/src/Metadata/Extensions.tsx

View workflow job for this annotation

GitHub Actions / pr (lint)

Missing semicolon
console.log('raw placeholder', rawMetadata)
// const rawDef = chainInfo;
console.log('rawDef in Extensions.tsx:', rawDef);

const { t } = useTranslation();
const { extensions } = useExtensions();
Expand All @@ -46,16 +43,11 @@ function Extensions({ chainInfo, className, rawMetadata }: Props): React.ReactEl
if (chainInfo && extensions?.[selectedIndex]) {
toggleBusy();

console.log('running _updateMeta');
console.log('running new rawDef', rawDef);


extensions[selectedIndex]
.update(rawDef)
.catch(() => false)
.then(() => toggleBusy())
.catch(console.error);
console.log('updated')
}
},
[chainInfo, extensions, rawDef, selectedIndex, toggleBusy]
Expand Down
20 changes: 9 additions & 11 deletions packages/page-settings/src/useRawMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@ import { useEffect, useState } from 'react';

import { createNamedHook, useApi, } from '@polkadot/react-hooks';

function useRawMetadataImpl (): HexString | null {
const { api, isApiReady} = useApi();
function useRawMetadataImpl(): HexString | null {
const { api, isApiReady } = useApi();
const [state, setState] = useState<HexString | null>(null);

useEffect(
():void => {
isApiReady
&& api.call.metadata.metadataAtVersion(15).then((opaque) => {
const raw = opaque.toHex();
(): void => {
isApiReady
&& api.call.metadata.metadataAtVersion(15).then((opaque) => {
const raw = opaque.toHex();

console.log('raw: ', raw);
setState(raw)

setState(raw)


}).catch()},
}).catch()
},
[api, isApiReady]
);

Expand Down
1 change: 0 additions & 1 deletion packages/react-hooks/src/useLedger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ let ledger: LedgerGeneric | null = null;
let ledgerType: TransportType | null = null;

function retrieveLedger (api: ApiPromise): LedgerGeneric {
console.log('retrieve ledger');
const currType = uiSettings.ledgerConn as TransportType;

if (!ledger || ledgerType !== currType) {
Expand Down
7 changes: 0 additions & 7 deletions packages/react-signer/src/TxSigned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ async function wrapTx (api: ApiPromise, currentItem: QueueTx, { isMultiCall, mul
async function extractParams (api: ApiPromise, address: string, options: Partial<SignerOptions>, getLedger: () => LedgerGeneric, setQrState: (state: QrState) => void): Promise<['qr' | 'signing', string, Partial<SignerOptions>, boolean]> {
const pair = keyring.getPair(address);
const { meta: { accountOffset, addressOffset, isExternal, isHardware, isInjected, isLocal, isProxied, source } } = pair;
console.log('isHardware: ', isHardware);
console.log('isExternal ', isExternal);
console.log('isInjexted: ', isInjected);

if (isHardware) {
return ['signing', address, { ...options, signer: new LedgerSigner(api, getLedger, accountOffset || 0, addressOffset || 0) }, false];
Expand All @@ -212,10 +209,6 @@ async function extractParams (api: ApiPromise, address: string, options: Partial

assert(injected, `Unable to find a signer for ${address}`);

console.log('injected signer metadata: ',injected.metadata);
console.log('injected signer withST: ',options.withSignedTransaction);
console.log('injected signer mode: ', options.mode);

return ['signing', address, { ...options, signer: injected.signer }, false];
}

Expand Down

0 comments on commit dd61a51

Please sign in to comment.