8000 migrate to @scure/base for base64 & bech32 encoding by dynst · Pull Request #1666 · cosmos/cosmjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

migrate to @scure/base for base64 & bech32 encoding #1666

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dynst
Copy link
Contributor
@dynst dynst commented Jun 12, 2025

TypeScript return types are narrowed in a way that's still backwards-compatible.

Return types are narrowed in a way that's still backwards-compatible.
@dynst
Copy link
Contributor Author
dynst commented Jun 12, 2025

This repository exceeded its LFS budget. The account responsible for the budget should increase it to restore access.

CircleCI output
Cloning git repository - git@github.com:cosmos/cosmjs.git
Fetching from remote repository
Checking out branch
Cloning into '.'...
From github.com:cosmos/cosmjs
 * [new ref]               refs/pull/1666/head -> origin/pull/1666
Downloading .yarn/cache/@agoric-babel-standalone-npm-7.9.5-d7c88bfb35-d5bae2402a.zip (4.6 MB)
Error downloading object: .yarn/cache/@agoric-babel-standalone-npm-7.9.5-d7c88bfb35-d5bae2402a.zip (3b2b29e): Smudge error: Error downloading .yarn/cache/@agoric-babel-standalone-npm-7.9.5-d7c88bfb35-d5bae2402a.zip (3b2b29e1a7e1b6f059ef1c4c2429defd1bbb9fb7187b7c63c5f243caf13fb5f7): batch response: This repository exceeded its LFS budget. The account responsible for the budget should increase it to restore access.

Errors logged to '/home/circleci/project/.git/lfs/logs/20250612T163655.63273083.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: .yarn/cache/@agoric-babel-standalone-npm-7.9.5-d7c88bfb35-d5bae2402a.zip: smudge filter lfs failed
failed to checkout: exit status 128

@webmaster128
Copy link
Member

Thanks. LFS budget was fixed now.

I am happy for the new implementation. But can we do that without changing the types of CosmJS interfaces? Is it possible to use bech32 decoding without knowing the prefix?

@dynst
Copy link
Contributor Author
dynst commented Jun 17, 2025

But can we do that without changing the types of CosmJS interfaces? Is it possible to use bech32 decoding without knowing the prefix?

For a backwards compatible 0.33.2 release, existing TypeScript code can't break if it was expecting a string to be returned from the encoding function, and a more-specific-kind-of-string gets returned now, right? I tested it out. Things only break if you change the types of a function's arguments to be more-specific and strict than the caller provides.

The new return type of the decode function and some address-getters doesn't force users to change anything, but it does give them the choice to take advantage of the new type to enforce more compile-time constraints (statically ensuring this string is a valid address) in their codebase.

And if you mean, is it possible to use this library's decode function without casting (address as `${string}1${string}`), it really does require that.

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.

2 participants
0