getChainInfoFromSpecVersion method

ChainInfo getChainInfoFromSpecVersion(
  1. SpecVersion specVersion
)

Implementation

ChainInfo getChainInfoFromSpecVersion(SpecVersion specVersion) {
  final DecodedMetadata decodedMetadata =
      MetadataDecoder.instance.decode(specVersion.metadata);

  LegacyTypes? types;

  // Pre checking helps to avoid extra computation for processing LegacyTypesBundle.
  if (decodedMetadata.isPreV14 && typesBundleDefinition != null) {
    types = getLegacyTypesFromBundle(
        typesBundleDefinition!, specVersion.specVersion);
  }

  final ChainInfo description =
      ChainInfo.fromMetadata(decodedMetadata, types);

  return description;
}