|
@@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize};
|
|
|
use sha1::{Digest, Sha1};
|
|
|
use std::option::Option;
|
|
|
|
|
|
+pub const REQUIRE_BRIDGE_TOKEN: bool = false;
|
|
|
+
|
|
|
#[derive(Debug)]
|
|
|
pub enum PositiveReportError {
|
|
|
DateInFuture,
|
|
@@ -46,7 +48,8 @@ impl PositiveReport {
|
|
|
lox_proof: lox_pr::Request,
|
|
|
country: String,
|
|
|
) -> Self {
|
|
|
- if CONFIG.require_bridge_token && bridge_token.is_none() {
|
|
|
+ //if CONFIG.require_bridge_token && bridge_token.is_none() {
|
|
|
+ if REQUIRE_BRIDGE_TOKEN && bridge_token.is_none() {
|
|
|
panic!("Bridge tokens are required for positive reports.");
|
|
|
}
|
|
|
let mut hasher = Sha1::new();
|
|
@@ -110,7 +113,8 @@ impl PositiveReport {
|
|
|
Htable: &RistrettoBasepointTable,
|
|
|
) -> bool {
|
|
|
// Verify bridge token
|
|
|
- if CONFIG.require_bridge_token {
|
|
|
+ //if CONFIG.require_bridge_token {
|
|
|
+ if REQUIRE_BRIDGE_TOKEN {
|
|
|
let bridge_token = self.bridge_token.unwrap();
|
|
|
let bridge_key = bridge_info.pubkey;
|
|
|
if bridge_key.is_none() {
|
|
@@ -153,7 +157,8 @@ pub struct SerializablePositiveReport {
|
|
|
impl SerializablePositiveReport {
|
|
|
pub fn to_report(self) -> Result<PositiveReport, PositiveReportError> {
|
|
|
// Check that fields are valid
|
|
|
- if CONFIG.require_bridge_token && self.bridge_token.is_none() {
|
|
|
+ //if CONFIG.require_bridge_token && self.bridge_token.is_none() {
|
|
|
+ if REQUIRE_BRIDGE_TOKEN && self.bridge_token.is_none() {
|
|
|
return Err(PositiveReportError::MissingBridgeToken);
|
|
|
}
|
|
|
if self.country == "" {
|