fix(antd-zig): pass payment_mode to dataPutPublic/dataPutPrivate in examples#79
Open
Nic-dorman wants to merge 1 commit into
Open
fix(antd-zig): pass payment_mode to dataPutPublic/dataPutPrivate in examples#79Nic-dorman wants to merge 1 commit into
Nic-dorman wants to merge 1 commit into
Conversation
…xamples
The example call sites were one arg short:
examples/02-data.zig:16: error: member function expected 2 argument(s), found 1
const put_result = try client.dataPutPublic(message);
The SDK signature has been two-arg for a while:
pub fn dataPutPublic(self: *Client, data: []const u8,
payment_mode: ?[]const u8) !PutResult
Pass null for the optional payment mode (matches what fileUploadPublic
already does in 04-files.zig).
Affected examples:
- 02-data.zig:16 dataPutPublic
- 06-private-data.zig:16 dataPutPrivate
Note: end-to-end execution is currently blocked on an unrelated Zig version
mismatch in the SDK source itself (.empty initializer + http.Client.open
do not coexist in any released Zig) - tracked in #78. The type-check of
the call sites passes once that is sorted; this PR fixes the example
shape independently.
Closes #70
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70.
examples/02-data.zigandexamples/06-private-data.zigwere calling the SDK's put methods with one arg short:Pass
nullfor the optional payment-mode (mirrors04-files.zig, which already passesnulltofileUploadPublic).Affected:
02-data.zig:16—dataPutPublic06-private-data.zig:16—dataPutPrivate03-chunks.zig(chunkPutis single-arg) and04-files.zig(already correct) are unchanged.Test plan
src/json_helpers.zig/src/antd.zigitself: the source uses.empty(Zig 0.15-dev) ANDhttp.Client.open(Zig 0.14.x), which don't coexist in any released Zig. Filed separately as antd-zig source uses Zig APIs from incompatible versions; doesn't compile on any released Zig #78. Once that lands,zig build run-02-datashould green up.Out of scope (worth a separate ticket)
examples/05-graph.zigcallsgraphEntryPut,graphEntryGet,graphEntryExists, andgraphEntryCost, none of which exist onClientinsrc/antd.zig— looks like the entire graph example is targeting an API surface that hasn't landed yet. Not touching it here.