-
Notifications
You must be signed in to change notification settings - Fork 8
Runtime Metadata V14 support #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added V14 runtimes hex files Implemented parsing of runtime metadata V14 Fixed tests Fixed usages Fixed some warnings in old files
Updated Starscream URL Bumped version Returned HEX coding for Data (need to fix v14 with this) Updated JSON files for legacy schemas, fixed their some default values Fixed some tests
// MARK: - Schema | ||
|
||
public struct Schema: ScaleCodable { | ||
public let types: [SchemaItem] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SchemaType mb better
value: TypeMetadata.Def.Composite, | ||
mediator: TypeRegistering | ||
) throws -> Node { | ||
// if value.fields.count == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be nice to have some comment or TODO about why we need this
} | ||
} | ||
|
||
guard let mapping = mapping else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be combined with the conditional statement above
} | ||
} | ||
|
||
guard let components = components else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be combined with the conditional statement above
@@ -3,21 +3,31 @@ import Foundation | |||
public class HexCodingStrategy { | |||
static func encoding(data: Data, encoder: Encoder) throws { | |||
var container = encoder.singleValueContainer() | |||
let hex = data.toHex(includePrefix: true) | |||
try container.encode(hex) | |||
let array = data.map { String($0) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's not "hex" coding strategy anymore. Just confusing class naming, imho
], | ||
extrinsic: ExtrinsicMetadata(version: 1, | ||
signedExtensions: [])) | ||
RuntimeMetadata.v1( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have same for v14? Of course, no time for tests now, but mb it'll be useful to have TODO here?
version: 9010 | ||
) | ||
} | ||
// Seems outdated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it outdated? Or it can be helpful someday?
// MARK: - V14 | ||
|
||
extension RuntimeMetadataV14 { | ||
public struct EventMetadata: RuntimeEventMetadata { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have single event metadata with two different inits.
… optimize create runtime snapshot func
…ferent generic types
Added V14 runtimes hex files
Implemented parsing of runtime metadata V14
Fixed tests
Fixed usages
Fixed some warnings in old files