Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case BalanceErrs.MintingFailed:
return <div>Minting your test tokens failed unexpectedly. Please refresh the page and try again.</div>;
case BalanceErrs.AllowanceSettingFailed:
return (
<div>
An unexpected error occurred while trying to set your test token allowance. Please refresh the
page and try again.
</div>
);
case undefined:
return null; // No error to show
default:
throw errorUtils.spawnSwitchErr('errorType', this.state.errorType);
}
}
private _onErrorOccurred(errorType: BalanceErrs): void {
/>
);
});
typeName = (
<div>
[
{_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => {
return [prev, ', ', curr];
})}
]
</div>
);
break;
default:
throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType);
}
// HACK: Normalize BigNumber to simply BigNumber. For some reason the type
// name is unpredictably one or the other.
if (typeName === 'BigNumber') {
typeName = 'BigNumber';
}
const commaSeparatedTypeArgs = _.reduce(typeArgs, (prev: React.ReactNode, curr: React.ReactNode) => {
return [prev, ', ', curr];
});
const isExportedClassReference = !!props.type.isExportedClassReference;
const typeNameUrlIfExists = !_.isUndefined(props.type.externalLink) ? props.type.externalLink : undefined;
if (!_.isUndefined(typeNameUrlIfExists)) {
typeName = props.isInPopover ? (
<span style="{{">{typeName}</span>
) : (
}
break;
}
case ExchangeEvents.CancelUpTo: {
// TODO(logvinov): Do it smarter and actually look at the salt and order epoch
// Invalidate cache
const args = decodedLog.args as ExchangeCancelUpToEventArgs;
this._orderFilledCancelledLazyStore.deleteAllIsCancelled();
// Revalidate orders
const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByMaker(args.makerAddress);
await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
break;
}
default:
throw errorUtils.spawnSwitchErr('decodedLog.event', decodedLog.event);
}
}
private async _emitRevalidateOrdersAsync(orderHashes: string[], transactionHash?: string): Promise {
const seenTypeNames = _.map(docSection.types, t => t.name);
const isUnseen = !_.includes(seenTypeNames, customType.name);
if (isUnseen) {
docSection.types.push(customType);
}
break;
}
case KindString.Class:
// We currently do not support more then a single class per file
// except for the types section, where we ignore classes since we
// only want to render type definitions.
break;
default:
throw errorUtils.spawnSwitchErr('kindString', entity.kindString);
}
});
return docSection;
let buttonIconName;
if (isWrappedEtherDirectionOpen) {
buttonLabel = 'cancel';
buttonIconName = 'zmdi-close';
} else {
switch (wrappedEtherDirection) {
case Side.Deposit:
buttonLabel = 'wrap';
buttonIconName = 'zmdi-long-arrow-down';
break;
case Side.Receive:
buttonLabel = 'unwrap';
buttonIconName = 'zmdi-long-arrow-up';
break;
default:
throw errorUtils.spawnSwitchErr('wrappedEtherDirection', wrappedEtherDirection);
}
}
const onClick = isWrappedEtherDirectionOpen
? this._closeWrappedEtherActionRow.bind(this, wrappedEtherDirection)
: this._openWrappedEtherActionRow.bind(this, wrappedEtherDirection);
return (
);
}
private _openWrappedEtherActionRow(wrappedEtherDirection: Side): void {
return <span>;
}
let label;
switch (this.state.buttonState) {
case ButtonState.Ready:
label = this.props.labelReady;
break;
case ButtonState.Loading:
label = this.props.labelLoading;
break;
case ButtonState.Complete:
label = this.props.labelComplete;
break;
default:
throw errorUtils.spawnSwitchErr('ButtonState', this.state.buttonState);
}
return (
);
}
public async onClickAsync(): Promise {</span>