Missed passing metadata=self.metadata in Option.process#134
Merged
arjanz merged 1 commit intoJAMdotTech:az-option-missing-metadatafrom Oct 16, 2025
Merged
Missed passing metadata=self.metadata in Option.process#134arjanz merged 1 commit intoJAMdotTech:az-option-missing-metadatafrom
metadata=self.metadata in Option.process#134arjanz merged 1 commit intoJAMdotTech:az-option-missing-metadatafrom
Conversation
|
@arjanz pls take a look this PR |
Contributor
|
Confirmed, I created a unit test with data mentioned above and the patch fixed decoding of the extrinsic: def test_encode_with_bittensor_metadata(self):
metadata_fixture_dict = load_type_registry_file(
os.path.join(os.path.dirname(__file__), 'fixtures', 'metadata_hex.json')
)
metadata_decoder = RuntimeConfiguration().create_scale_object(
'MetadataVersioned', data=ScaleBytes(metadata_fixture_dict["bittensor_test"])
)
metadata_decoder.decode()
runtime_config = RuntimeConfigurationObject(implements_scale_info=True)
runtime_config.update_type_registry(load_type_registry_preset("core"))
runtime_config.add_portable_registry(metadata_decoder)
extrinsic = runtime_config.create_scale_object(
"Extrinsic",
data=ScaleBytes("0x85028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01d8a8c7ab390badc106832ccb721d1acea313335db6c0bcd816c160a1c2784e3f41f503d08f321ab66aa3401e941737ebad721ea3db5c7bee784b87f9130fcc8e009c00001b000700c817a80402286bee0700902f50099228010001073b8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4800"),
metadata=metadata_decoder
)
extrinsic.decode()
self.assertIsNotNone(extrinsic.value) |
e751481
into
JAMdotTech:az-option-missing-metadata
1 of 5 checks passed
arjanz
added a commit
that referenced
this pull request
Oct 16, 2025
* Missed passing `metadata=self.metadata` in `Option.process` (#134) * Added extrinsic unit test * Updated Python versions in Github Actions --------- Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
Contributor
|
Patch released: https://pypi.org/project/scalecodec/1.2.12/ |
Contributor
Author
Wonderful. Thanks so much Arjan! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm actually not quite sure how to add a test for this. But it resolves decoding an Extrinsic with the data
given this metadata:
metadata.txt