Skip to content

feat: add GetContent + bump steemutil to v0.0.30 - #14

Merged
ety001 merged 1 commit into
masterfrom
feat/get-content
Aug 13, 2026
Merged

feat: add GetContent + bump steemutil to v0.0.30#14
ety001 merged 1 commit into
masterfrom
feat/get-content

Conversation

@ety001

@ety001 ety001 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

Add GetContent(author, permlink string) (*protocolapi.Content, error) wrapping condenser_api.get_content, for steemdb-sync's comment rescanner (Batch 5). Uses the single-object return pattern (like GetFollowCount): positional params [author, permlink], returns a pointer.

Bumps steemutil require v0.0.29v0.0.30, which provides the new Content / VoteState / Beneficiary types (steemutil #18, tag v0.0.30).

Why this depends on steemutil v0.0.30

The Content/VoteState types did not exist before. Critically, steemutil #18 corrected a spec error: the original requirement assumed the share_type fields were "always JSON strings", but live testing showed they are int/string-mixed (within one response, active_votes[].rshares has both a number 2125781185 and a string "221646137396"). Those fields use json.RawMessage in steemutil, so this SDK's tests deliberately exercise both forms.

Tests

go build ./... + go test ./... all green.

  • TestGetContent — mock server returns a discussion with deliberately mixed share_type forms (top-level net_rshares as JSON string, total_vote_weight as JSON number; active_votes[0].rshares string vs [1].rshares number) to prove the json.RawMessage fields decode both forms steemd emits.
  • TestGetContent_ParamsShape — asserts params is [author, permlink] (2-element positional array).
  • GetContent added to the TestParamsShape_IsArrayNotObject table.

After merge

This SDK will need its own version bump (e.g. v0.0.30) so downstream consumers (steemdb-sync, etc.) can pick up GetContent.

Add GetContent(author, permlink) wrapping condenser_api.get_content with
the single-object return pattern (like GetFollowCount): positional params
[author, permlink], returns *protocolapi.Content (now available in
steemutil v0.0.30).

Bump steemutil require v0.0.29 -> v0.0.30.

Tests:
  - TestGetContent: mock server returns a discussion with deliberately MIXED
    share_type forms (net_rshares as JSON string, total_vote_weight as JSON
    number; active_votes[0].rshares string vs [1].rshares number) to prove
    the json.RawMessage fields decode both forms steemd emits.
  - TestGetContent_ParamsShape: asserts params is [author, permlink].
  - GetContent added to the TestParamsShape_IsArrayNotObject table.
@ety001
ety001 merged commit 04be921 into master Aug 13, 2026
2 checks passed
@ety001
ety001 deleted the feat/get-content branch August 13, 2026 14:53
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