Skip to content

Commit

Permalink
Revert "Unsettled transfer sessions (#857)"
Browse files Browse the repository at this point in the history
This reverts commit e6adffc.
  • Loading branch information
michaeldjeffrey committed Aug 30, 2024
1 parent f10606d commit 75e7baa
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 313 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package: [boost-manager,file-store,iot-config,iot-packet-verifier,iot-verifier,mobile-config,mobile-packet-verifier,mobile-verifier]
package: [boost-manager,file-store,iot-config,iot-packet-verifier,iot-verifier,mobile-config,mobile-verifier]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-tests-postgres-${{ matrix.package }}
cancel-in-progress: true
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package: [coverage-map,coverage-point-calculator,ingest,reward-scheduler,task-manager]
package: [coverage-map,coverage-point-calculator,ingest,mobile-packet-verifier,reward-scheduler,task-manager]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-tests-${{ matrix.package }}
cancel-in-progress: true
Expand Down
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions file_store/src/file_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ pub const DATA_TRANSFER_SESSION_INGEST_REPORT: &str = "data_transfer_session_ing
pub const INVALID_DATA_TRANSFER_SESSION_INGEST_REPORT: &str =
"invalid_data_transfer_session_ingest_report";
pub const VALID_DATA_TRANSFER_SESSION: &str = "valid_data_transfer_session";
pub const PENDING_DATA_TRANSFER_SESION: &str = "pending_data_transfer_sesion";
pub const PRICE_REPORT: &str = "price_report";
pub const MOBILE_REWARD_SHARE: &str = "mobile_reward_share";
pub const MAPPER_MSG: &str = "mapper_msg";
Expand Down Expand Up @@ -194,7 +193,6 @@ pub enum FileType {
DataTransferSessionIngestReport,
InvalidDataTransferSessionIngestReport,
ValidDataTransferSession,
PendingDataTransferSession,
PriceReport,
MobileRewardShare,
SubscriberLocationReq,
Expand Down Expand Up @@ -272,7 +270,6 @@ impl fmt::Display for FileType {
INVALID_DATA_TRANSFER_SESSION_INGEST_REPORT
}
Self::ValidDataTransferSession => VALID_DATA_TRANSFER_SESSION,
Self::PendingDataTransferSession => PENDING_DATA_TRANSFER_SESION,
Self::PriceReport => PRICE_REPORT,
Self::MobileRewardShare => MOBILE_REWARD_SHARE,
Self::MapperMsg => MAPPER_MSG,
Expand Down Expand Up @@ -347,7 +344,6 @@ impl FileType {
INVALID_DATA_TRANSFER_SESSION_INGEST_REPORT
}
Self::ValidDataTransferSession => VALID_DATA_TRANSFER_SESSION,
Self::PendingDataTransferSession => PENDING_DATA_TRANSFER_SESION,
Self::PriceReport => PRICE_REPORT,
Self::MobileRewardShare => MOBILE_REWARD_SHARE,
Self::MapperMsg => MAPPER_MSG,
Expand Down Expand Up @@ -422,7 +418,6 @@ impl FromStr for FileType {
Self::InvalidDataTransferSessionIngestReport
}
VALID_DATA_TRANSFER_SESSION => Self::ValidDataTransferSession,
PENDING_DATA_TRANSFER_SESION => Self::PendingDataTransferSession,
PRICE_REPORT => Self::PriceReport,
MOBILE_REWARD_SHARE => Self::MobileRewardShare,
MAPPER_MSG => Self::MapperMsg,
Expand Down
30 changes: 2 additions & 28 deletions file_store/src/mobile_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ use helium_crypto::PublicKeyBinary;
use helium_proto::services::poc_mobile::{
invalid_data_transfer_ingest_report_v1::DataTransferIngestReportStatus,
DataTransferEvent as DataTransferEventProto, DataTransferRadioAccessTechnology,
DataTransferSessionIngestReportV1, DataTransferSessionReqV1,
DataTransferSessionSettlementStatus, InvalidDataTransferIngestReportV1,
PendingDataTransferSessionV1,
DataTransferSessionIngestReportV1, DataTransferSessionReqV1, InvalidDataTransferIngestReportV1,
};

use serde::Serialize;
Expand Down Expand Up @@ -183,7 +181,6 @@ pub struct DataTransferSessionReq {
pub rewardable_bytes: u64,
pub pub_key: PublicKeyBinary,
pub signature: Vec<u8>,
pub status: DataTransferSessionSettlementStatus,
}

impl MsgDecode for DataTransferSessionReq {
Expand All @@ -194,7 +191,6 @@ impl TryFrom<DataTransferSessionReqV1> for DataTransferSessionReq {
type Error = Error;

fn try_from(v: DataTransferSessionReqV1) -> Result<Self> {
let status = v.status();
Ok(Self {
rewardable_bytes: v.rewardable_bytes,
signature: v.signature,
Expand All @@ -203,7 +199,6 @@ impl TryFrom<DataTransferSessionReqV1> for DataTransferSessionReq {
.ok_or_else(|| Error::not_found("data transfer usage"))?
.try_into()?,
pub_key: v.pub_key.into(),
status,
})
}
}
Expand All @@ -217,28 +212,7 @@ impl From<DataTransferSessionReq> for DataTransferSessionReqV1 {
rewardable_bytes: v.rewardable_bytes,
pub_key: v.pub_key.into(),
signature: v.signature,
reward_cancelled: false,
status: v.status as i32,
}
}
}

impl DataTransferSessionReq {
pub fn to_pending_proto(
self,
received_timestamp: DateTime<Utc>,
) -> PendingDataTransferSessionV1 {
let event_timestamp = self.data_transfer_usage.timestamp.encode_timestamp_millis();
let received_timestamp = received_timestamp.encode_timestamp_millis();

PendingDataTransferSessionV1 {
pub_key: self.pub_key.into(),
payer: self.data_transfer_usage.payer.into(),
upload_bytes: self.data_transfer_usage.upload_bytes,
download_bytes: self.data_transfer_usage.download_bytes,
rewardable_bytes: self.rewardable_bytes,
event_timestamp,
received_timestamp,
..Default::default()
}
}
}
5 changes: 0 additions & 5 deletions file_store/src/traits/file_sink_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ impl_file_sink!(
FileType::OracleBoostingReport.to_str(),
"oracle_boosting_report"
);
impl_file_sink!(
poc_mobile::PendingDataTransferSessionV1,
FileType::PendingDataTransferSession.to_str(),
"pending_data_transfer_session"
);
impl_file_sink!(
poc_mobile::RadioThresholdIngestReportV1,
FileType::RadioThresholdIngestReport.to_str(),
Expand Down
3 changes: 0 additions & 3 deletions mobile_packet_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,3 @@ http-serde = { workspace = true }
sha2 = { workspace = true }
humantime-serde = { workspace = true }
custom-tracing = { path = "../custom_tracing" }

[dev-dependencies]
rand = { workspace = true }

This file was deleted.

Loading

0 comments on commit 75e7baa

Please sign in to comment.