Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return constants with the correct type and value', (): void => {
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(ClassOf(registry, 'BlockNumber'));
// 3 second blocks, 28 days
expect(consts.democracy.cooloffPeriod.toNumber()).toEqual(28 * 24 * 60 * (60 / 3));
});
export default function Amount (props: Props): React.ReactElement {
const { className, defaultValue: { value }, isDisabled, isError, label, onEnter, style, withLabel } = props;
const defaultValue = isDisabled
? (
value instanceof ClassOf(registry, 'AccountIndex')
? value.toString()
: formatNumber(value)
)
: bnToBn((value as number) || 0).toString();
return (
return memo((_accountIndex: AccountIndex | string): Observable => {
const accountIndex = _accountIndex instanceof ClassOf(api.registry, 'AccountIndex')
? _accountIndex
: createType(api.registry, 'AccountIndex', _accountIndex);
return querySection.enumSet>(accountIndex.div(ENUMSET_SIZE)).pipe(
startWith([]),
map((accounts): AccountId | undefined =>
(accounts || [])[accountIndex.mod(ENUMSET_SIZE).toNumber()]
)
);
});
}
export default function VoteThresholdParam (props: Props): React.ReactElement {
const { className, defaultValue: { value }, isDisabled, isError, label, style, withLabel } = props;
const defaultValue = value instanceof ClassOf(registry, 'VoteThreshold')
? value.toNumber()
: bnToBn(value as number).toNumber();
return (
public update (id: number, result: Hash | SubmittableResult): void {
if (result instanceof ClassOf('Hash')) {
this._queueSetTxStatus(id, 'sent', result.toHex());
} else {
this._queueSetTxStatus(id, result.status.type.toLowerCase() as QueueTxStatus, status);
}
}
}
public update (id: number, result: Hash | SubmittableResult): void {
if (result instanceof ClassOf(registry, 'Hash')) {
this._queueSetTxStatus(id, 'sent', result.toHex());
} else {
this._queueSetTxStatus(id, result.status.type.toLowerCase() as QueueTxStatus, status);
}
}
}