Remove handled address tranform logs (#3807)

* Remove handled address tranform logs

* Update packages/react-params/src/initValue.ts

* Update packages/react-params/src/initValue.ts
This commit is contained in:
Jaco Greeff 2020-10-01 22:32:01 +02:00 committed by GitHub
parent 7cfadd4e0f
commit 7b299cc4bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -88,14 +88,11 @@ function Call (props: Props): React.ReactElement<Props> | null {
(): void => {
if (!accountId || !callContract || !callMessage || !endowment || !weight) return;
!!callContract && callContract
callContract
.call('rpc', callMessage.def.name, endowment, weight, ...params)
.send(accountId)
.then(
(outcome: ContractCallOutcome): void => {
setOutcomes([outcome, ...outcomes]);
}
);
.then((outcome: ContractCallOutcome) => setOutcomes([outcome, ...outcomes]))
.catch(console.error);
},
[accountId, callContract, callMessage, endowment, weight, outcomes, params]
);
@ -111,7 +108,7 @@ function Call (props: Props): React.ReactElement<Props> | null {
);
const isValid = useMemo(
(): boolean => !!accountId && !!callContract && !!callContract.address && !!callContract.abi && isWeightValid && isEndowmentValid,
() => !!accountId && !!callContract && !!callContract.address && !!callContract.abi && isWeightValid && isEndowmentValid,
[accountId, callContract, isEndowmentValid, isWeightValid]
);

View File

@ -60,7 +60,7 @@ function transformToAddress (value?: string | Uint8Array | null): string | null
try {
return addressToAddress(value) || null;
} catch (error) {
console.error('Unable to transform address', value);
// noop, handled by return
}
return null;

View File

@ -15,7 +15,7 @@ export default function toAddress (value?: string | Uint8Array | null, allowIndi
return keyring.encodeAddress(u8a);
} catch (error) {
console.error('Unable to encode address', (error as Error).message, value);
// noop, undefined return indicates invalid/transient
}
}