Skip to content

Commit c6c7759

Browse files
committed
publish module & refactors
Signed-off-by: Ignacio Hagopian <[email protected]>
1 parent 5541b8b commit c6c7759

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

src/stealth_address.zig renamed to src/eip5564.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const Endian = std.builtin.Endian;
33
const Secp256k1 = std.crypto.ecc.Secp256k1;
44
const Keccak256 = std.crypto.hash.sha3.Keccak256;
55

6-
const Privkey = [32]u8;
7-
const Pubkey = [33]u8;
8-
const EthAddress = [20]u8;
6+
pub const Privkey = [32]u8;
7+
pub const Pubkey = [33]u8;
8+
pub const EthAddress = [20]u8;
99

1010
// StealthAddress is an implementation of EIP-5564 for the `schemeId`=0x00 (i.e: SECP256k1, with view tags)
1111
// In the future, we can generalize the code if more schemes are added.

src/main.zig

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1 @@
1-
const std = @import("std");
2-
3-
pub fn main() !void {
4-
// Prints to stderr (it's a shortcut based on `std.io.getStdErr()`)
5-
std.debug.print("All your {s} are belong to us.\n", .{"codebase"});
6-
7-
// stdout is for the actual output of your application, for example if you
8-
// are implementing gzip, then only the compressed bytes should be sent to
9-
// stdout, not any debugging messages.
10-
const stdout_file = std.io.getStdOut().writer();
11-
var bw = std.io.bufferedWriter(stdout_file);
12-
const stdout = bw.writer();
13-
14-
try stdout.print("Run `zig build test` to run the tests.\n", .{});
15-
16-
try bw.flush(); // don't forget to flush!
17-
}
18-
19-
test "simple test" {
20-
var list = std.ArrayList(i32).init(std.testing.allocator);
21-
defer list.deinit(); // try commenting this out and see if zig detects the memory leak!
22-
try list.append(42);
23-
try std.testing.expectEqual(@as(i32, 42), list.pop());
24-
}
1+
pub fn main() !void {}

src/root.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
const std = @import("std");
2-
const testing = std.testing;
1+
pub const eip5564 = @import("eip5564.zig");
32

43
test "stealth address" {
5-
_ = @import("stealth_address.zig");
4+
_ = @import("eip5564.zig");
65
}

0 commit comments

Comments
 (0)