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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use crate::blockchainapi::clientidentity::ClientIdentity;
use fabric_ledger_protos::common_messages::TransactionContext as TxCtx;
#[derive(Default,Clone)]
pub struct TransactionContext {
tx_id: std::string::String,
channel_id: std::string::String,
}
impl TransactionContext {
pub fn new(ctx: &TxCtx) -> TransactionContext {
TransactionContext {
channel_id: ctx.channel_id.clone(),
tx_id: ctx.transaction_id.clone(),
}
}
pub fn get_id(&self) -> String {
self.tx_id.clone()
}
pub fn get_timestamp(&self) -> String {
todo!("get_id")
}
pub fn get_channelid(&self) -> std::string::String {
self.channel_id.clone()
}
pub fn get_peer_mspid(&self) -> String {
todo!("get_id")
}
pub fn get_submitting_identity(&self) -> Result<ClientIdentity, String> {
todo!("get_submitting_identity");
}
pub fn current_transaction() -> TransactionContext {
todo!("get_id")
}
}