Skip to content
Open
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
19 changes: 1 addition & 18 deletions src/choreo/tower/test_tower.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "test_tower_util.h"
#include "fd_epoch_stakes.h"
#include "fd_tower.c"
#include "fd_tower_forks.h"
Expand Down Expand Up @@ -224,24 +225,6 @@ static uchar scratch[ FD_TOWER_FOOTPRINT ] __attribute__((aligned(FD_TOWER_ALIGN
// // FD_TEST( 0==memcmp( restore + off, checkpt + off, sizeof(restore) - off ) );
// }

void
make_vote_account( fd_hash_t const * pubkey, ulong stake, ulong vote, uint conf, fd_tower_accts_t * out ) {
fd_voter_t voter = {
.kind = FD_VOTER_V3,
.v3 = {
.node_pubkey = *pubkey,
.votes_cnt = 1,
.votes = {
{ .slot = vote, .conf = conf },
},
}
};

memcpy( out->data, &voter, sizeof(fd_voter_t) );
out->stake = stake;
out->addr = *pubkey;
}

void test_tower_serde( fd_wksp_t * wksp ) {
fd_txn_p_t txnp[1];

Expand Down
18 changes: 1 addition & 17 deletions src/choreo/tower/test_tower_forks.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
#include "test_tower_util.h"
#include "fd_tower_forks.h"
#include "../voter/fd_voter.h"

void
make_vote_account( fd_hash_t const * pubkey, ulong stake, ulong vote, uint conf, fd_tower_accts_t * out ) {
fd_voter_t voter = {
.kind = FD_VOTER_V3,
.v3 = {
.node_pubkey = *pubkey,
.votes_cnt = 1,
.votes = {
{ .slot = vote, .conf = conf },
},
}
};

memcpy( out->data, &voter, sizeof(fd_voter_t) );
out->stake = stake;
out->addr = *pubkey;
}

void
test_forks_lockouts( fd_wksp_t * wksp ) {
Expand Down
28 changes: 28 additions & 0 deletions src/choreo/tower/test_tower_util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef HEADER_test_tower_util_h
#define HEADER_test_tower_util_h

#include "../voter/fd_voter.h"
#include "fd_tower_forks.h"
static inline void
make_vote_account(fd_hash_t const *pubkey,
ulong stake,
ulong vote,
uint conf,
fd_tower_accts_t *out)
{
fd_voter_t voter = {
.kind = FD_VOTER_V3,
.v3 = {
.node_pubkey = *pubkey,
.votes_cnt = 1,
.votes = {
{.slot = vote, .conf = conf},
},
}};

memcpy(out->data, &voter, sizeof(fd_voter_t));
out->stake = stake;
out->addr = *pubkey;
}

#endif /* HEADER_test_tower_util_h */