Add unimplemented state functions
This change adds several unimplemented state functions to the
PurchaseOrderState object, allowing the transaction handler to access
this state.
cfg_if! {
if #[cfg(target_arch = "wasm32")] {
+ use sabre_sdk::ApplyError;
use sabre_sdk::TransactionContext;
} else {
use sawtooth_sdk::processor::handler::TransactionContext;
+ use sawtooth_sdk::processor::handler::ApplyError;
}
}
+use grid_sdk::protocol::{
+ pike::state::{Agent, Organization},
+ purchase_order::state::PurchaseOrder,
+};
+
pub struct PurchaseOrderState<'a> {
_context: &'a dyn TransactionContext,
}
@@ -28,4 +35,24 @@ impl<'a> PurchaseOrderState<'a> {
pub fn new(context: &'a dyn TransactionContext) -> Self {
Self { _context: context }
}
+
+ pub fn _get_purchase_order(&self, _po_uuid: &str) -> Result<Option<PurchaseOrder>, ApplyError> {
+ unimplemented!();
+ }
+
+ pub fn _set_purchase_order(
+ &self,
+ _po_uuid: &str,
+ _purchase_order: PurchaseOrder,
+ ) -> Result<(), ApplyError> {
+ unimplemented!();
+ }
+
+ pub fn _get_agent(&self, _public_key: &str) -> Result<Option<Agent>, ApplyError> {
+ unimplemented!();
+ }
+
+ pub fn _get_organization(&self, _id: &str) -> Result<Option<Organization>, ApplyError> {
+ unimplemented!();
+ }
}
