Skip to content

chore(contract): sync ocp protos to 8220291 - #6

Merged
bmc08gt merged 2 commits into
mainfrom
chore/sync-ocp-8220291
Sep 14, 2026
Merged

bmc08gt merged 2 commits into
mainfrom
chore/sync-ocp-8220291

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Syncs to ocp-protobuf-api@82202912, three commits on from the ea6418c5 this was pinned at:

  • 07d584b0 GetBalance can now filter by mint and provide per-mint balances (#64)
  • 62b4738e Get balances rpc (#65)
  • 82202912 Remove GetBalance RPC in favour of GetBalances (#66)

Intended release: 0.4.0. Breaking, so the minor bump carries it pre-1.0. The CHANGELOG.md entry is in this PR, since publish.yml reads the section matching the version it publishes and refuses a version with none.

What changed

One proto file, proto/balance/v1/ocp_balance_service.proto. The Balance service had exactly one RPC and it is replaced outright, with no deprecation window.

Before After
RPC GetBalance GetBalances
Request single owner repeated owners (1-1024) plus optional repeated mints filter
Response flat uint64 core_mint_value map<string, OwnerBalance> balances_by_owner

OwnerBalance carries the core_mint_value total the old response returned directly, plus map<string, MintBalance> balances_by_mint for the per-mint breakdown. The scalar total still exists, one level further down.

GetBalancesRequest carries no auth or signature field, same as GetBalanceRequest before it. It reads balances for arbitrary owner accounts rather than the caller's own, so there is nothing to sign.

The enum removal

GetBalancesResponse.Result drops NOT_FOUND. OK and DENIED keep 0 and 1, so no surviving case renumbers and no positional rawValue mapping shifts underneath a consumer. This is a case removal, not a renumbering.

What does change is that "this owner has no balance" no longer has a result code. An owner with nothing to report is simply absent from balances_by_owner, so code that branched on NOT_FOUND has to branch on a missing map entry instead, and code that treated any non-OK result as a hard failure will now see OK where it used to see NOT_FOUND.

Consumers

Both app PRs are open and build against this checkout through the local override. They are drafts because they pin 0.4.0, which does not exist until this merges and publish.yml runs:

scripts/toolchain.env is untouched, and Sources/ moved only where proto/ did.

Replaces the Balance service's single RPC. GetBalance is gone; GetBalances
takes a repeated owners list (1-1024) plus an optional mints filter, and
returns balances_by_owner keyed by owner address, each entry carrying a
core_mint_value total and its own balances_by_mint breakdown.

GetBalancesResponse.Result drops NOT_FOUND. OK and DENIED keep their
numbers, so nothing renumbers, but an owner with no balances is now
absent from the map rather than signalled by a result code.
@bmc08gt bmc08gt self-assigned this Sep 14, 2026
@bmc08gt
bmc08gt merged commit 15ce331 into main Sep 14, 2026
3 checks passed
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.

1 participant