Skip to content

Commit

Permalink
publish module & refactors
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
  • Loading branch information
jsign committed Dec 17, 2023
1 parent 5541b8b commit c6c7759
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/stealth_address.zig → src/eip5564.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const Endian = std.builtin.Endian;
const Secp256k1 = std.crypto.ecc.Secp256k1;
const Keccak256 = std.crypto.hash.sha3.Keccak256;

const Privkey = [32]u8;
const Pubkey = [33]u8;
const EthAddress = [20]u8;
pub const Privkey = [32]u8;
pub const Pubkey = [33]u8;
pub const EthAddress = [20]u8;

// StealthAddress is an implementation of EIP-5564 for the `schemeId`=0x00 (i.e: SECP256k1, with view tags)
// In the future, we can generalize the code if more schemes are added.
Expand Down
25 changes: 1 addition & 24 deletions src/main.zig
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
const std = @import("std");

pub fn main() !void {
// Prints to stderr (it's a shortcut based on `std.io.getStdErr()`)
std.debug.print("All your {s} are belong to us.\n", .{"codebase"});

// stdout is for the actual output of your application, for example if you
// are implementing gzip, then only the compressed bytes should be sent to
// stdout, not any debugging messages.
const stdout_file = std.io.getStdOut().writer();
var bw = std.io.bufferedWriter(stdout_file);
const stdout = bw.writer();

try stdout.print("Run `zig build test` to run the tests.\n", .{});

try bw.flush(); // don't forget to flush!
}

test "simple test" {
var list = std.ArrayList(i32).init(std.testing.allocator);
defer list.deinit(); // try commenting this out and see if zig detects the memory leak!
try list.append(42);
try std.testing.expectEqual(@as(i32, 42), list.pop());
}
pub fn main() !void {}
5 changes: 2 additions & 3 deletions src/root.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const std = @import("std");
const testing = std.testing;
pub const eip5564 = @import("eip5564.zig");

test "stealth address" {
_ = @import("stealth_address.zig");
_ = @import("eip5564.zig");
}

0 comments on commit c6c7759

Please sign in to comment.