parent
5eebabd356
commit
cce56c0e7e
@ -22,7 +22,8 @@ function getParam ([{ name, type }]: ParamDef[], index: number): ParamDef {
|
||||
}
|
||||
|
||||
export function getParams (inputParams: ParamDef[], prev: ParamDef[], max: number): ParamDef[] {
|
||||
if (prev.length === max) {
|
||||
// HACK: I don't know why `max` changes to `undefined`.
|
||||
if (prev.length === max || isUndefined(max)) {
|
||||
return prev;
|
||||
}
|
||||
|
||||
@ -36,6 +37,10 @@ export function getParams (inputParams: ParamDef[], prev: ParamDef[], max: numbe
|
||||
}
|
||||
|
||||
export function getValues ({ value }: RawParam): RawParam[] {
|
||||
if (value instanceof Set) {
|
||||
value = [...value.values()];
|
||||
}
|
||||
|
||||
return Array.isArray(value)
|
||||
? value.map((value: RawParam) =>
|
||||
isUndefined(value) || isUndefined(value.isValid)
|
||||
|
||||
@ -74,7 +74,7 @@ const componentDef: TypeToComponent[] = [
|
||||
{ c: Text, t: ['String', 'Text'] },
|
||||
{ c: Struct, t: ['Struct'] },
|
||||
{ c: Tuple, t: ['Tuple'] },
|
||||
{ c: Vector, t: ['Vec'] },
|
||||
{ c: Vector, t: ['Vec', 'BTreeSet'] },
|
||||
{ c: VectorFixed, t: ['VecFixed'] },
|
||||
{ c: Vote, t: ['Vote'] },
|
||||
{ c: VoteThreshold, t: ['VoteThreshold'] },
|
||||
@ -121,6 +121,9 @@ function fromDef ({ displayName, info, lookupName, sub, type }: TypeDef): string
|
||||
case TypeDefInfo.Struct:
|
||||
return 'Struct';
|
||||
|
||||
case TypeDefInfo.BTreeSet:
|
||||
return 'BTreeSet';
|
||||
|
||||
case TypeDefInfo.Tuple:
|
||||
return components[type] === Account
|
||||
? type
|
||||
|
||||
Loading…
Reference in New Issue
Block a user