Definition ordering (#2699)
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes * def order * fixes Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
This commit is contained in:
co-authored by
Jaco Greeff
Andrew Jones
parent
d7dc36c65b
commit
cd5a5da45c
@@ -103,18 +103,18 @@ const registry = {
|
||||
MtLookupTypeId: 'u32',
|
||||
MtPath: 'Vec<Text>',
|
||||
MtType: {
|
||||
def: 'MtTypeDef',
|
||||
path: 'MtPath',
|
||||
params: 'Vec<MtLookupTypeId>',
|
||||
path: 'MtPath'
|
||||
def: 'MtTypeDef'
|
||||
},
|
||||
MtTypeDef: {
|
||||
_enum: {
|
||||
Array: 'MtTypeDefArray',
|
||||
Composite: 'MtTypeDefComposite',
|
||||
Primitive: 'MtTypeDefPrimitive',
|
||||
Variant: 'MtTypeDefVariant',
|
||||
Sequence: 'MtTypeDefSequence',
|
||||
Array: 'MtTypeDefArray',
|
||||
Tuple: 'MtTypeDefTuple',
|
||||
Variant: 'MtTypeDefVariant'
|
||||
Primitive: 'MtTypeDefPrimitive'
|
||||
}
|
||||
},
|
||||
MtTypeDefArray: {
|
||||
@@ -136,9 +136,9 @@ const registry = {
|
||||
variants: 'Vec<MtVariant>'
|
||||
},
|
||||
MtVariant: {
|
||||
discriminant: 'Option<u64>',
|
||||
name: 'Text',
|
||||
fields: 'Vec<MtField>',
|
||||
name: 'Text'
|
||||
discriminant: 'Option<u64>'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -179,25 +179,25 @@ export interface MtPath extends Vec<Text> {}
|
||||
|
||||
/** @name MtType */
|
||||
export interface MtType extends Struct {
|
||||
readonly def: MtTypeDef;
|
||||
readonly params: Vec<MtLookupTypeId>;
|
||||
readonly path: MtPath;
|
||||
readonly params: Vec<MtLookupTypeId>;
|
||||
readonly def: MtTypeDef;
|
||||
}
|
||||
|
||||
/** @name MtTypeDef */
|
||||
export interface MtTypeDef extends Enum {
|
||||
readonly isArray: boolean;
|
||||
readonly asArray: MtTypeDefArray;
|
||||
readonly isComposite: boolean;
|
||||
readonly asComposite: MtTypeDefComposite;
|
||||
readonly isPrimitive: boolean;
|
||||
readonly asPrimitive: MtTypeDefPrimitive;
|
||||
readonly isSequence: boolean;
|
||||
readonly asSequence: MtTypeDefSequence;
|
||||
readonly isTuple: boolean;
|
||||
readonly asTuple: MtTypeDefTuple;
|
||||
readonly isVariant: boolean;
|
||||
readonly asVariant: MtTypeDefVariant;
|
||||
readonly isSequence: boolean;
|
||||
readonly asSequence: MtTypeDefSequence;
|
||||
readonly isArray: boolean;
|
||||
readonly asArray: MtTypeDefArray;
|
||||
readonly isTuple: boolean;
|
||||
readonly asTuple: MtTypeDefTuple;
|
||||
readonly isPrimitive: boolean;
|
||||
readonly asPrimitive: MtTypeDefPrimitive;
|
||||
}
|
||||
|
||||
/** @name MtTypeDefArray */
|
||||
@@ -243,9 +243,9 @@ export interface MtTypeDefVariant extends Struct {
|
||||
|
||||
/** @name MtVariant */
|
||||
export interface MtVariant extends Struct {
|
||||
readonly discriminant: Option<u64>;
|
||||
readonly fields: Vec<MtField>;
|
||||
readonly name: Text;
|
||||
readonly fields: Vec<MtField>;
|
||||
readonly discriminant: Option<u64>;
|
||||
}
|
||||
|
||||
export type PHANTOM_CONTRACTSABI = 'contractsAbi';
|
||||
|
||||
Reference in New Issue
Block a user