Skip to content

Commit

Permalink
Clean up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Apolixit committed Jul 30, 2024
1 parent ff6cb6e commit 5f866c4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 13 additions & 0 deletions Substrate.NET.Metadata.Tests/MetadataServiceV15Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ public void MetadataV15_WhenInstanciate_ShouldSucceed()
Assert.That(_metadataService.GetMetadataVersion(metadataHex), Is.EqualTo(MetadataVersion.V15));

var res = new MetadataV15(metadataHex);

Assert.That(res, Is.Not.Null);
Assert.That(res.Version, Is.EqualTo(MetadataVersion.V15));

Assert.That(res.RuntimeMetadataData.Lookup.Value.Length, Is.GreaterThan(0));
Assert.That(res.RuntimeMetadataData.Modules.Value.Length, Is.GreaterThan(0));

Assert.That((int)res.RuntimeMetadataData.OuterEnums.CallType.Value, Is.GreaterThanOrEqualTo(0));
Assert.That((int)res.RuntimeMetadataData.OuterEnums.ErrorType.Value, Is.GreaterThanOrEqualTo(0));
Assert.That((int)res.RuntimeMetadataData.OuterEnums.EventType.Value, Is.GreaterThanOrEqualTo(0));

Assert.That(res.RuntimeMetadataData.Apis.Value.Length, Is.GreaterThan(0));

Assert.That(res.RuntimeMetadataData.Custom.Map.Value, Is.Not.Null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ public override void Decode(byte[] byteArray, ref int p)
public TType CallType { get; private set; } = default!;
public TType SignatureType { get; private set; } = default!;
public TType ExtraType { get; private set; } = default!;
public BaseVec<SignedExtensionMetadataV14> SignedExtensions { get; private set; }
public BaseVec<SignedExtensionMetadataV14> SignedExtensions { get; private set; } = default!;
}
}
14 changes: 7 additions & 7 deletions Substrate.NET.Metadata/V15/RuntimeMetadataV15.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ public override void Decode(byte[] byteArray, ref int p)
TypeSize = p - start;
}

public PortableRegistry Lookup { get; private set; }
public PortableRegistry Lookup { get; private set; } = default!;

public BaseVec<ModuleMetadataV15> Modules { get; private set; }
public BaseVec<ModuleMetadataV15> Modules { get; private set; } = default!;

public ExtrinsicMetadataV15 Extrinsic { get; private set; }
public ExtrinsicMetadataV15 Extrinsic { get; private set; } = default!;

public BaseVec<RuntimeApiMetadataV15> Apis { get; private set; }
public BaseVec<RuntimeApiMetadataV15> Apis { get; private set; } = default!;

public TType TypeId { get; private set; }
public TType TypeId { get; private set; } = default!;

public OuterEnums15 OuterEnums { get; private set; }
public OuterEnums15 OuterEnums { get; private set; } = default!;

public CustomMetadata15 Custom { get; private set; }
public CustomMetadata15 Custom { get; private set; } = default!;
}
}

0 comments on commit 5f866c4

Please sign in to comment.