mirror of
https://github.com/fluencelabs/fluence-VRF
synced 2025-04-25 07:12:14 +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;
|
||||
}
|
||||
|
||||
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:
|
||||
bool compare(char *a, char *b, int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
@ -115,6 +126,8 @@ private:
|
||||
char **players;
|
||||
int len;
|
||||
int game_id;
|
||||
|
||||
pub_key_type winner;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user