Skip to content

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

Merged
merged 39 commits into from
Feb 11, 2022
Merged

Runtime Metadata V14 support #55

merged 39 commits into from
Feb 11, 2022

Conversation

posplaw
Copy link
Contributor

@posplaw posplaw commented Nov 30, 2021

Added V14 runtimes hex files
Implemented parsing of runtime metadata V14
Fixed tests
Fixed usages
Fixed some warnings in old files

Alex Oakley added 2 commits October 31, 2021 23:48
Added V14 runtimes hex files
Implemented parsing of runtime metadata V14
Fixed tests
Fixed usages
Fixed some warnings in old files
@posplaw posplaw requested a review from a team November 30, 2021 11:38
@posplaw posplaw marked this pull request as ready for review December 22, 2021 08:43
Alex Oakley added 5 commits December 23, 2021 13:03
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]
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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) }
Copy link
Contributor

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(
Copy link
Contributor

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
Copy link
Contributor

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 {
Copy link
Contributor

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.

@posplaw posplaw merged commit 38d8d0e into develop Feb 11, 2022
@posplaw posplaw deleted the runtime-metadata-v14 branch February 11, 2022 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants