Skip to content

Commit

Permalink
Enable full rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed Jun 6, 2024
1 parent 192a535 commit 5b95628
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VALUES
from
now() at time zone 'utc'
)
)
) - (24 * 60 * 60) + 180
)
) ON CONFLICT (key) DO
UPDATE
Expand All @@ -24,7 +24,7 @@ SET
from
now() at time zone 'utc'
)
)
) - (24 * 60 * 60) + 180
);

INSERT INTO
Expand All @@ -39,7 +39,36 @@ VALUES
epoch
from
now() at time zone 'utc'
)
) + 180 -- Adding 180 seconds
)
)
) ON CONFLICT (key) DO
UPDATE
SET
value = (
SELECT
floor(
extract(
epoch
from
now() at time zone 'utc'
)
) + 180 -- Adding 180 seconds
);

INSERT INTO
meta (key, value)
VALUES
(
'disable_complete_data_checks_until',
(
SELECT
floor(
extract(
epoch
from
now() at time zone 'utc'
) + (24 * 60 * 60)
)
)
) ON CONFLICT (key) DO
Expand All @@ -53,5 +82,5 @@ SET
from
now() at time zone 'utc'
)
)
) + (24 * 60 * 60)
);
2 changes: 1 addition & 1 deletion docker/mobile/reward_index/settings.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modelog = "reward_index=debug,file_store=info,custom_tracing=info"
interval = "10 minutes"
interval = "10 seconds"
mode = "mobile"

unallocated_reward_entity_key = "131kC5gTPFfTyzziHbh2PWz2VSdF4gDvhoC5vqCz25N7LFtDocF"
Expand Down
2 changes: 1 addition & 1 deletion docker/mobile/verifier/settings.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
log = "mobile_verifier=debug,file_store=info,custom_tracing=info"
log = "price=debug,mobile_verifier=debug,file_store=info,custom_tracing=info"
cache = "/opt/mobile-verifier/data"
rewards = "24 hours"
reward_period_offset = "30 seconds"
Expand Down
12 changes: 3 additions & 9 deletions test_mobile/tests/common/hotspot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,11 @@ impl Hotspot {
.expect("sign");

let request = self.set_metadata(wifi_heartbeat_req.clone());
tracing::debug!(
"submitting wifi_heartbeat @ {} = {:?}",
timestamp.to_datetime(),
wifi_heartbeat_req
);

let res = self.mobile_client.submit_wifi_heartbeat(request).await?;
tracing::debug!(
"submitted wifi_heartbeat @ {} = {:?}",
"submitted wifi_heartbeat @ {} = {:?} {:?}",
timestamp.to_datetime(),
wifi_heartbeat_req,
res
);

Expand Down Expand Up @@ -219,7 +214,7 @@ async fn populate_mobile_metadata(

let uuid = Uuid::new_v4();
let h3_index: u64 = location.into();
let device_type = serde_json::to_value("wifiIndoor")?;
let device_type = serde_json::to_value("wifiOutdoor")?;

let wallet_b58 = wallet.public_key().to_string();

Expand Down Expand Up @@ -248,7 +243,6 @@ async fn populate_mobile_metadata(
.execute(&pool)
.await?;

// let pk_binary: PublicKeyBinary = keypair.public_key().to_owned().into();
let pk_binary = PublicKeyBinary::from_str(keypair.public_key().to_string().as_str())?;
let entity_key = bs58::decode(pk_binary.to_string()).into_vec()?;

Expand Down
8 changes: 6 additions & 2 deletions test_mobile/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ async fn main() -> Result<()> {

hotspot1.submit_coverage_object(co_uuid).await?;

hotspot1.submit_speedtest(1001, 1001, 25).await?;
hotspot1.submit_speedtest(1002, 1002, 25).await?;
hotspot1
.submit_speedtest(500_000_000, 500_000_000, 25)
.await?;
hotspot1
.submit_speedtest(500_000_000, 500_000_000, 25)
.await?;

for x in (1..=12).rev() {
hotspot1
Expand Down

0 comments on commit 5b95628

Please sign in to comment.