0.7.25
This commit is contained in:
@@ -33,7 +33,7 @@ impl KbOnchainObservationDto {
|
||||
slot: std::option::Option<u64>,
|
||||
payload: serde_json::Value,
|
||||
) -> Self {
|
||||
Self {
|
||||
return Self {
|
||||
id: None,
|
||||
observation_kind,
|
||||
source_kind,
|
||||
@@ -42,7 +42,7 @@ impl KbOnchainObservationDto {
|
||||
slot,
|
||||
payload,
|
||||
observed_at: chrono::Utc::now(),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ impl TryFrom<crate::KbOnchainObservationEntity> for KbOnchainObservationDto {
|
||||
"cannot parse on-chain observation observed_at '{}': {}",
|
||||
entity.observed_at, error
|
||||
)));
|
||||
}
|
||||
},
|
||||
};
|
||||
let payload_result = serde_json::from_str::<serde_json::Value>(&entity.payload_json);
|
||||
let payload = match payload_result {
|
||||
@@ -73,7 +73,7 @@ impl TryFrom<crate::KbOnchainObservationEntity> for KbOnchainObservationDto {
|
||||
"cannot parse on-chain observation payload_json '{}': {}",
|
||||
entity.payload_json, error
|
||||
)));
|
||||
}
|
||||
},
|
||||
};
|
||||
let slot = match entity.slot {
|
||||
Some(slot) => {
|
||||
@@ -85,12 +85,12 @@ impl TryFrom<crate::KbOnchainObservationEntity> for KbOnchainObservationDto {
|
||||
"cannot convert on-chain observation slot '{}' to u64: {}",
|
||||
slot, error
|
||||
)));
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
None => None,
|
||||
};
|
||||
Ok(Self {
|
||||
return Ok(Self {
|
||||
id: Some(entity.id),
|
||||
observation_kind: entity.observation_kind,
|
||||
source_kind,
|
||||
@@ -99,6 +99,6 @@ impl TryFrom<crate::KbOnchainObservationEntity> for KbOnchainObservationDto {
|
||||
slot,
|
||||
payload,
|
||||
observed_at,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user