1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use ic_kit::RejectionCode;
use thiserror::Error;
mod insert;
pub use insert::*;
mod query;
pub use query::get_transaction;
#[derive(Error, Debug)]
pub enum GetTransactionError {
#[error("the query was rejected")]
Unexpected(RejectionCode, String),
#[error("no transaction found with the given id")]
InvalidId,
}
#[derive(Error, Debug)]
pub enum InsertTransactionError {
#[error("the query was rejected")]
Unexpected(RejectionCode, String),
#[error("the root canister does not accept writes from this canister")]
CantWrite,
#[error("no transaction found with the given id")]
InvalidId,
}