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
/*
* Algod REST API.
*
* API endpoint for algod operations.
*
* The version of the OpenAPI document: 0.0.1
* Contact: contact@algorand.com
* Generated by: https://openapi-generator.tech
*/
use algonaut_encoding::Bytes;
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GetTransactionProof200Response {
/// The type of hash function used to create the proof, must be one of: * sha512_256 * sha256
#[serde(rename = "hashtype")]
pub hashtype: Hashtype,
/// Index of the transaction in the block's payset.
#[serde(rename = "idx")]
pub idx: u64,
/// Proof of transaction membership.
#[serde(rename = "proof")]
pub proof: Bytes,
/// Hash of SignedTxnInBlock for verifying proof.
#[serde(rename = "stibhash")]
pub stibhash: Bytes,
/// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.
#[serde(rename = "treedepth")]
pub treedepth: u64,
}
impl GetTransactionProof200Response {
pub fn new(
hashtype: Hashtype,
idx: u64,
proof: Bytes,
stibhash: Bytes,
treedepth: u64,
) -> GetTransactionProof200Response {
GetTransactionProof200Response {
hashtype,
idx,
proof,
stibhash,
treedepth,
}
}
}
/// The type of hash function used to create the proof, must be one of: * sha512_256 * sha256
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Hashtype {
#[serde(rename = "sha512_256")]
#[default]
Sha512256,
#[serde(rename = "sha256")]
Sha256,
}