Skip to content

Commit 5ad53a2

Browse files
authored
fix: update TUNA v2 shape (#68)
This was updated upstream before v2 was launched, so we need to update to match
1 parent 1743bf1 commit 5ad53a2

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tuna.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,11 @@ type TunaV2State struct {
7373
LeadingZeros int64
7474
DifficultyNumber int64
7575
EpochTime int64
76-
RealTimeNow int64
77-
Interlink [][]byte
78-
Extra any
76+
CurrentPosixTime int64
77+
MerkleRoot []byte
7978
}
8079

8180
func (t *TunaV2State) MarshalCBOR() ([]byte, error) {
82-
var tmpInterlink []any
83-
for _, item := range t.Interlink {
84-
tmpInterlink = append(tmpInterlink, item)
85-
}
8681
tmp := cbor.NewConstructor(
8782
0,
8883
cbor.IndefLengthList{
@@ -91,9 +86,8 @@ func (t *TunaV2State) MarshalCBOR() ([]byte, error) {
9186
t.LeadingZeros,
9287
t.DifficultyNumber,
9388
t.EpochTime,
94-
t.RealTimeNow,
95-
cbor.IndefLengthList(tmpInterlink),
96-
t.Extra,
89+
t.CurrentPosixTime,
90+
t.MerkleRoot,
9791
},
9892
)
9993
return cbor.Encode(&tmp)

0 commit comments

Comments
 (0)