From 1ca8faa306d6f74b4f8c06c2c2e56cf4e6079f31 Mon Sep 17 00:00:00 2001 From: Nic Dorman Date: Wed, 13 May 2026 15:09:06 +0000 Subject: [PATCH] fix(antd-zig): pass payment_mode to dataPutPublic/dataPutPrivate in examples 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 --- antd-zig/examples/02-data.zig | 2 +- antd-zig/examples/06-private-data.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/antd-zig/examples/02-data.zig b/antd-zig/examples/02-data.zig index a8189c3..0274337 100644 --- a/antd-zig/examples/02-data.zig +++ b/antd-zig/examples/02-data.zig @@ -13,7 +13,7 @@ pub fn main() !void { const message = "Hello, Autonomi!"; std.debug.print("Storing public data: {s}\n", .{message}); - const put_result = try client.dataPutPublic(message); + const put_result = try client.dataPutPublic(message, null); defer put_result.deinit(allocator); std.debug.print("Stored at address: {s}\n", .{put_result.address}); diff --git a/antd-zig/examples/06-private-data.zig b/antd-zig/examples/06-private-data.zig index 9f9d510..80a5cf1 100644 --- a/antd-zig/examples/06-private-data.zig +++ b/antd-zig/examples/06-private-data.zig @@ -13,7 +13,7 @@ pub fn main() !void { const secret_message = "This is private data"; std.debug.print("Storing private data...\n", .{}); - const put_result = try client.dataPutPrivate(secret_message); + const put_result = try client.dataPutPrivate(secret_message, null); defer put_result.deinit(allocator); std.debug.print("Data map: {s}\n", .{put_result.address});