From a032b01ed8e351e0b5d88db74f51a8fcad7e4186 Mon Sep 17 00:00:00 2001 From: "daniel.vladco" Date: Wed, 24 Jul 2024 16:59:13 +0300 Subject: [PATCH] parent c775ed3a756e0ea4af647c0c038e66d0d9ad605c author daniel.vladco 1721829553 +0300 committer daniel.vladco 1721989837 +0300 gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEp/B5JgRVFrv4jeo0NRcmXQtfSkgFAmajes0ACgkQNRcmXQtf Skidrg//TebF4dKkt8fiVdgGCHLlVD4mI4JsE0ySEsIE1BQGz0myrRdKqd3psthK DtgPsJiMahcnivW8mkAVhG3E6pdZwFXqjArO3v47k/A0hmfSrr+CzF8AG9rU9ACf uY8/b1tjNgtMRbQQJLH3Ythjx2+yJaoywcJF9QgYRE+zk4D/WW/Rcr3AVkZhJ7Lk fgP4IltydVNYiT0k4xvLEqjjSQDKDT3bT4KFHDLIIkMS7ZF5fbAIQEC+cjCrz0az iC7v5HepV158FgmeEijJVvUh8PTWLF+Pifv0sybOgVx/VSMm048aRlbVZN3PVFPP zM4TAYJgb9YXHS2UtmSVAvkBLa6xVh7i97HNXzF9+Izxpk/HNoRd3scbgp/8Jk78 Q7EFdc1VDaGo002U0DIBGaTLBleTQu1ukzPHtclrHlGMI5f4vTnWGUDStw97i5+L h0Fs+c+n4Ig7/Wy5+skTOGvaKNfMWGF+fZpg1Jnv9urLdzva6guelnpsf9/dwzI+ ezh1tzn8L2+jNVTs4/Inv+K9nfqN7L0HPe6c9rheWmystNYKL3Z3h05W/3ulgW1M 8kk3Y2AxcFugPGPaQ/49MezVn2SehlNJh8Z1RzRQio3I8+GKYj24O+TNrPyN3muc B0/5Psw7xbuQzNYmqjbZU9mdibU74kpomThW9D5sg7urNeteAF0= =5+iJ -----END PGP SIGNATURE----- feat: add header fields fix: use hash types where needed feat: change epoch types to hash slice Add ticket structs (#18) fix: use existing ticket struct --- internal/block/header.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/block/header.go b/internal/block/header.go index 50bb32b..ca7cea0 100644 --- a/internal/block/header.go +++ b/internal/block/header.go @@ -1,4 +1,20 @@ package block +import ( + "github.com/eigerco/strawberry/internal/crypto" + "github.com/eigerco/strawberry/internal/time" +) + +// Header as defined in the section 5 in the paper type Header struct { + ParentHash crypto.Hash // Hp + PriorStateRoot crypto.Hash // Hr + ExtrinsicHash crypto.Hash // Hx + TimeSlotIndex time.Timeslot // Ht + EpochMarker []crypto.Hash // He + WinningTicketsMarker [time.TimeslotsPerEpoch]*Ticket // Hw + JudgementsMarkers []crypto.Hash // Hj + BlockAuthorKey []byte // Hk + VRFSignature []byte // Hv + BlockSealSignature []byte // Hs }