Documentation
Tagion
EventPackage
tagion
hashgraph
HashGraphBasic
@
safe
struct
EventPackage {
@
exclude
Buffer
fingerprint
;
@
label
(
StdNames
.
sign
)
Signature
signature
;
@
label
(
StdNames
.
owner
)
Pubkey
pubkey
;
@
label
("$body")
EventBody
event_body
;
}
Mixed In Members
From
mixin
HiBONRecord
!(
q{
/++ Used when a Event is received from another node +/
this
(
const
SecureNet
net
,
const
(
Document
)
doc_epack
)
immutable
pure
{
immutable
_this
=
EventPackage
(
doc_epack
);
//this(doc_epack);
this
.
signature
=
_this
.
signature
;
this
.
pubkey
=
_this
.
pubkey
;
this
.
event_body
=
_this
.
event_body
;
fingerprint
=
cast
(
Buffer
)
net
.
hash
.
calc
(
_this
.
event_body
);
consensus_check
(
pubkey
.
length
!
is
0
,
ConsensusFailCode
.
EVENT_MISSING_PUBKEY
);
consensus_check
(
signature
.
length
!
is
0
,
ConsensusFailCode
.
EVENT_MISSING_SIGNATURE
);
consensus_check
(
net
.
verify
(
Fingerprint
(
fingerprint
),
signature
,
pubkey
),
ConsensusFailCode
.
EVENT_BAD_SIGNATURE
); }
/++ Create a EventPackage from a body +/
this
(
const
SecureNet
net
,
immutable
(
EventBody
)
ebody
)
immutable
pure
{
pubkey
=
net
.
pubkey
;
event_body
=
ebody
;
auto
sig
=
net
.
sign
(
event_body
);
signature
=
sig
.
signature
;
fingerprint
=
cast
(
Buffer
)
sig
.
message
; }
this
(
const
SecureNet
net
,
const
Pubkey
pkey
,
const
Signature
signature
,
immutable
(
EventBody
)
ebody
)
immutable
pure
{
pubkey
=
pkey
;
event_body
=
ebody
;
auto
_fingerprint
=
net
.
hash
.
calc
(
event_body
);
fingerprint
=
cast
(
Buffer
)
_fingerprint
;
this
.
signature
=
signature
;
consensus_check
(
net
.
verify
(
_fingerprint
,
signature
,
pubkey
),
ConsensusFailCode
.
EVENT_BAD_SIGNATURE
); }
}
)
recordName
string
recordName
()
Get the record type name set by @recordType("name")
tagion
hashgraph
HashGraphBasic
enums
ExchangeState
functions
isMajority
structs
EvaPayload
EventBody
EventPackage
RoundVote
Wavefront