mirror of
https://github.com/fluencelabs/fluence-VRF
synced 2025-05-28 23:21:29 +00:00
more API func impls
This commit is contained in:
parent
b051f97288
commit
119c421e39
13
bls/main.cpp
13
bls/main.cpp
@ -96,6 +96,17 @@ struct Game {
|
|||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_winner(pub_key_type pub_key) {
|
||||||
|
if (state != STATE_REVEALING || winner.len != pub_key.len)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return compare(winner.data, pub_key.data, winner.len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int game_status() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool compare(char *a, char *b, int len) {
|
bool compare(char *a, char *b, int len) {
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
@ -115,6 +126,8 @@ private:
|
|||||||
char **players;
|
char **players;
|
||||||
int len;
|
int len;
|
||||||
int game_id;
|
int game_id;
|
||||||
|
|
||||||
|
pub_key_type winner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user