Skip to content

feat: expose code property on Encoder class - #53

Open
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:fix-issue-47
Open

feat: expose code property on Encoder class#53
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:fix-issue-47

Conversation

@sumanjeet0012

Copy link
Copy Markdown
Contributor

Fixes #47

Description

This pull request adds a public .code property to the Encoder class.

Changes

  • Exposes self._codec.code via a read-only property code.
  • Brings py-multibase into alignment with go-multibase, which exposes the encoding code via Encoder.Encoding().
  • Added test validation to ensure encoder.code returns the correct multibase prefix byte.

@acul71 acul71 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes — missing newsfragment (blocker)

Thanks for this clean, focused fix for #47. The Encoder.code property matches the issue proposal and looks correct; CI and local make lint / typecheck / test / docs-ci all pass.

Blocker

Please add a towncrier newsfragment:

  • Path: newsfragments/47.feature.rst
  • Content (example): Added a public ``Encoder.code`` property exposing the multibase prefix byte.
  • Must end with a trailing newline

Newsfragments are mandatory for approval on this repo.

Also recommended (non-blocking)

  • Rebase onto current origin/master (branch is ~6 commits behind; dry-run merge is clean today).
  • Note overlap with open PR #54 on the same files — coordinate merge order.
  • Optional: assert another encoding for .code (e.g. base16b"f") and/or mention encoder.code in the README Encoder example.

Happy to re-review once 47.feature.rst is added.

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.

Encoder class lacks a code property exposing the prefix byte

2 participants