Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/error.zig

This file was deleted.

3 changes: 0 additions & 3 deletions src/root.zig
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const std = @import("std");
const testing = std.testing;
pub const PubkeyIndexMap = @import("./pubkey_index_map.zig").PubkeyIndexMap;
pub const CommitteeIndices = @import("./committee_indices.zig");
pub const ComputeShuffledIndex = CommitteeIndices.ComputeShuffledIndex;

export fn add(a: i32, b: i32) i32 {
return a + b;
Expand Down
28 changes: 20 additions & 8 deletions src/root_c_abi.zig
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
const std = @import("std");
const Mutex = std.Thread.Mutex;
pub const PubkeyIndexMap = @import("pubkey_index_map.zig").PubkeyIndexMap;
const PUBKEY_INDEX_MAP_KEY_SIZE = @import("pubkey_index_map.zig").PUBKEY_INDEX_MAP_KEY_SIZE;
const innerShuffleList = @import("shuffle.zig").innerShuffleList;
const SEED_SIZE = @import("shuffle.zig").SEED_SIZE;
const committee_indices = @import("committee_indices.zig");
const ErrorCode = @import("error.zig").ErrorCode;
const NOT_FOUND_INDEX = @import("error.zig").NOT_FOUND_INDEX;
const ERROR_INDEX = @import("error.zig").ERROR_INDEX;
pub const PubkeyIndexMap = @import("utils/pubkey_index_map.zig").PubkeyIndexMap;
const PUBKEY_INDEX_MAP_KEY_SIZE = @import("utils/pubkey_index_map.zig").PUBKEY_INDEX_MAP_KEY_SIZE;
const innerShuffleList = @import("utils/shuffle.zig").innerShuffleList;
const SEED_SIZE = @import("utils/shuffle.zig").SEED_SIZE;
const committee_indices = @import("utils/committee_indices.zig");

pub const ErrorCode = struct {
pub const Success: c_uint = 0;
pub const InvalidInput: c_uint = 1;
pub const Error: c_uint = 2;
pub const TooManyThreadError: c_uint = 2;
pub const MemoryError: c_uint = 3;
pub const ThreadError: c_uint = 4;
pub const InvalidPointerError: c_uint = 5;
pub const Pending: c_uint = 10;
};

// this special index 4,294,967,295 is used to mark a not found
pub const NOT_FOUND_INDEX = 0xffffffff;
pub const ERROR_INDEX = 0xffffffff;

var gpa = std.heap.GeneralPurposeAllocator(.{}){};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading