-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstateful.rs
73 lines (64 loc) · 1.71 KB
/
stateful.rs
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
#[allow(unused_imports)]
use solid::Encode;
#[derive(Encode)]
pub struct GetDetailsNamedOutput<'a> {
pub message_: &'a str,
pub random_bytes_: solid::Bytes<'a>,
pub random_bytes10_: solid::bytesfix::BytesFix<'a, 10>,
}
pub struct StatefulContract;
impl StatefulContract {
#[rustfmt::skip]
#[allow(dead_code)]
pub fn new(message_: &str, random_bytes_: solid::Bytes<'_>, random_bytes10_: solid::bytesfix::BytesFix<'_, 10>) -> Vec<u8> {
solid::Builder::new()
.push(message_)
.push(random_bytes_)
.push(random_bytes10_)
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn get_details() -> Vec<u8> {
solid::Builder::new()
.name("getDetails")
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn get_details_named() -> Vec<u8> {
solid::Builder::new()
.name("getDetailsNamed")
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn get_message() -> Vec<u8> {
solid::Builder::new()
.name("getMessage")
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn kill() -> Vec<u8> {
solid::Builder::new()
.name("kill")
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn print_message(messages_: Vec<&str>) -> Vec<u8> {
solid::Builder::new()
.push(messages_)
.name("printMessage")
.build()
}
#[rustfmt::skip]
#[allow(dead_code)]
pub fn set_message(message_: &str) -> Vec<u8> {
solid::Builder::new()
.push(message_)
.name("setMessage")
.build()
}
}