Skip to content

feat: format known addresses for consensus txes#2335

Merged
uniyalabhishek merged 1 commit intomainfrom
uniyalabhishek/feature/format-known-addresses-131
Feb 4, 2026
Merged

feat: format known addresses for consensus txes#2335
uniyalabhishek merged 1 commit intomainfrom
uniyalabhishek/feature/format-known-addresses-131

Conversation

@uniyalabhishek
Copy link
Copy Markdown
Contributor

@uniyalabhishek uniyalabhishek commented Sep 19, 2025

This adds a small, reusable address-formatting primitive to the Go client SDK so downstream tools (incl. oasis CLI) can consistently render “known” accounts.

  • Add types.ContextKeyAccountEthMap + types.FormatNamedAddress{,With} to format addresses as name (preferred-address), preferring Ethereum hex when available for the native address.
  • Wire the helper into existing pretty-printers (e.g. PrettyPrintToAmount, consensusaccounts.Undelegate.PrettyPrint) so consensus/runtime tx output can show names instead of raw addresses when a caller provides name/eth maps in context.Context.
  • Add focused unit tests for formatting behavior and one integration-style test covering the updated consensusaccounts pretty-print.
  • Closes Name addresses, if found in wallet/addressbook/test/paratime/rofl entries cli#131 and Prefer Ethereum hex address, if available cli#523 (SDK-side enablement).

PR oasisprotocol/cli#616 is dependent on this.

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 19, 2025

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit f437f1d
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-sdk/deploys/6983007ab31c5900090ab560

Comment thread client-sdk/go/types/address.go
Comment thread client-sdk/go/types/address.go
Comment thread client-sdk/go/types/token.go
Comment thread client-sdk/go/types/token.go
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from c6e493b to 368a2f8 Compare November 5, 2025 11:22
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from 368a2f8 to 39dc9d7 Compare January 19, 2026 18:05
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.64%. Comparing base (e137daf) to head (f437f1d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2335      +/-   ##
==========================================
+ Coverage   48.55%   48.64%   +0.09%     
==========================================
  Files         224      224              
  Lines       16079    16104      +25     
==========================================
+ Hits         7807     7834      +27     
+ Misses       8212     8210       -2     
  Partials       60       60              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from 50f62d5 to a5339d0 Compare January 22, 2026 15:20
@uniyalabhishek uniyalabhishek requested review from matevz and peternose and removed request for pro-wh January 22, 2026 15:27
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from a5339d0 to 555737b Compare January 27, 2026 20:34
Comment thread client-sdk/go/types/token.go Outdated
@uniyalabhishek uniyalabhishek self-assigned this Jan 28, 2026
@uniyalabhishek uniyalabhishek requested a review from matevz January 29, 2026 09:25
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from 15eed1f to b4fc6b9 Compare February 2, 2026 08:42
Comment thread client-sdk/go/types/token.go Outdated
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from 3f5fda1 to dd454cf Compare February 2, 2026 15:49
@uniyalabhishek uniyalabhishek requested a review from matevz February 2, 2026 15:51
Copy link
Copy Markdown
Member

@matevz matevz left a comment

Choose a reason for hiding this comment

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

I think this is good to go now.

Comment thread client-sdk/go/types/token.go Outdated
test: cover consensusaccounts.Undelegate PrettyPrint

feat: preserve user-provided eth addresses

refactor: update address formatting for unnamed Ethereum addresses
@uniyalabhishek uniyalabhishek force-pushed the uniyalabhishek/feature/format-known-addresses-131 branch from d8604c9 to f437f1d Compare February 4, 2026 08:16
@uniyalabhishek uniyalabhishek merged commit 6b659c9 into main Feb 4, 2026
34 of 38 checks passed
@uniyalabhishek uniyalabhishek deleted the uniyalabhishek/feature/format-known-addresses-131 branch February 4, 2026 08:46
github-actions Bot added a commit that referenced this pull request Feb 4, 2026
…niyalabhishek/feature/format-known-addresses-131

feat: format known addresses for consensus txes 6b659c9
github-actions Bot added a commit that referenced this pull request Feb 4, 2026
…/uniyalabhishek/feature/format-known-addresses-131

feat: format known addresses for consensus txes 6b659c9
github-actions Bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request Feb 4, 2026
…sisprotocol/uniyalabhishek/feature/format-known-addresses-131

feat: format known addresses for consensus txes 6b659c9
github-actions Bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request Feb 4, 2026
…oasisprotocol/uniyalabhishek/feature/format-known-addresses-131

feat: format known addresses for consensus txes 6b659c9
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.

Name addresses, if found in wallet/addressbook/test/paratime/rofl entries

4 participants