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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
pub const CREDENTIAL_SENDER: &str = "cred-sys";
#[crate::service(name = "credentials", dispatch = false, psibase_mod = "crate")]
#[allow(unused_variables)]
pub mod service {
use crate::{
services::{tokens::Quantity, transact::ServiceMethod},
AccountNumber, Claim, MethodNumber, TimePointSec,
};
#[action]
fn init() {
unimplemented!()
}
#[allow(non_snake_case)]
#[action]
fn canAuthUserSys(user: AccountNumber) {
unimplemented!()
}
#[allow(non_snake_case)]
#[action]
fn checkAuthSys(
flags: u32,
requester: AccountNumber,
sender: AccountNumber,
action: ServiceMethod,
allowedActions: Vec<ServiceMethod>,
claims: Vec<Claim>,
) {
unimplemented!()
}
#[action]
#[allow(non_snake_case)]
fn isAuthSys(
sender: AccountNumber,
authorizers: Vec<AccountNumber>,
method: Option<ServiceMethod>,
auth_set: Option<Vec<AccountNumber>>,
) -> bool {
unimplemented!()
}
#[action]
#[allow(non_snake_case)]
fn isRejectSys(
sender: AccountNumber,
authorizers: Vec<AccountNumber>,
method: Option<ServiceMethod>,
auth_set: Option<Vec<AccountNumber>>,
) -> bool {
unimplemented!()
}
/// Issues a credential
///
/// Parameters:
/// - `pubkey_fingerprint`: The fingerprint of the credential public key
/// - `expires`: The number of seconds until the credential expires
/// - `allowed_actions`: The actions that the credential is allowed to call on the issuer service
///
/// This action is meant to be called inline by another service.
/// The caller service is the credential issuer.
///
/// A transaction sent from the CREDENTIAL_SENDER account must include a proof for a claim
/// that matches the specified public key.
#[action]
fn issue(
pubkey_fingerprint: crate::Checksum256,
expires: Option<u32>,
allowed_actions: Vec<MethodNumber>,
) -> u32 {
unimplemented!()
}
/// Notifies the credentials service that tokens have been credited to a credential
///
/// This notification must be called after crediting the credential's service, or else
/// the credited tokens will not be aplied to a particular credential.
#[action]
fn resource(id: u32, amount: Quantity) {
unimplemented!()
}
/// Gets the fingerprint of the specified credential pubkey
#[allow(non_snake_case)]
#[action]
fn getFingerprint(id: u32) -> crate::Checksum256 {
unimplemented!()
}
/// Gets the `expiry_date` of the specified credential
#[action]
fn get_expiry_date(id: u32) -> Option<TimePointSec> {
unimplemented!()
}
/// Gets the `id` of the active credential
#[action]
fn get_active() -> Option<u32> {
unimplemented!()
}
/// Deletes the specified credential.
/// Can only be called by the credential's issuer.
#[action]
fn consume(id: u32) {
unimplemented!()
}
}
#[test]
fn verify_schema() {
crate::assert_schema_matches_package::<Wrapper>();
}