This repository was archived by the owner on Feb 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathSCPNomination.cs
50 lines (47 loc) · 1.84 KB
/
SCPNomination.cs
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
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten
namespace Stellar.Generated
{
// === xdr source ============================================================
// struct SCPNomination
// {
// Hash quorumSetHash; // D
// Value votes<>; // X
// Value accepted<>; // Y
// };
// ===========================================================================
public class SCPNomination {
public SCPNomination () {}
public Hash QuorumSetHash { get; set; }
public Value[] Votes { get; set; }
public Value[] Accepted { get; set; }
public static void Encode(IByteWriter stream, SCPNomination encodedSCPNomination) {
Hash.Encode(stream, encodedSCPNomination.QuorumSetHash);
int votessize = encodedSCPNomination.Votes.Length;
XdrEncoding.EncodeInt32(votessize, stream);
for (int i = 0; i < votessize; i++) {
Value.Encode(stream, encodedSCPNomination.Votes[i]);
}
int acceptedsize = encodedSCPNomination.Accepted.Length;
XdrEncoding.EncodeInt32(acceptedsize, stream);
for (int i = 0; i < acceptedsize; i++) {
Value.Encode(stream, encodedSCPNomination.Accepted[i]);
}
}
public static SCPNomination Decode(IByteReader stream) {
SCPNomination decodedSCPNomination = new SCPNomination();
decodedSCPNomination.QuorumSetHash = Hash.Decode(stream);
int votessize = XdrEncoding.DecodeInt32(stream);
decodedSCPNomination.Votes = new Value[votessize];
for (int i = 0; i < votessize; i++) {
decodedSCPNomination.Votes[i] = Value.Decode(stream);
}
int acceptedsize = XdrEncoding.DecodeInt32(stream);
decodedSCPNomination.Accepted = new Value[acceptedsize];
for (int i = 0; i < acceptedsize; i++) {
decodedSCPNomination.Accepted[i] = Value.Decode(stream);
}
return decodedSCPNomination;
}
}
}