Skip to content

Commit 36298b6

Browse files
committed
Fix failing tests
1 parent cbcd415 commit 36298b6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

initialization/initialization.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,8 @@ func (init *Initializer) saveMetadata() error {
701701
}
702702

703703
func (init *Initializer) loadMetadata() (*shared.PostMetadata, error) {
704-
// TODO(mafa): migrate metadata if needed before loading it
704+
if err := MigratePoST(init.opts.DataDir, init.logger); err != nil {
705+
return nil, err
706+
}
705707
return LoadMetadata(init.opts.DataDir)
706708
}

shared/post_metadata.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ var ErrStateMetadataFileMissing = errors.New("metadata file is missing")
1313
type PostMetadata struct {
1414
Version int `json:",omitempty"`
1515

16-
NodeId NodeID
17-
CommitmentAtxId ATXID
16+
NodeId []byte
17+
CommitmentAtxId []byte
1818

1919
LabelsPerUnit uint64
2020
NumUnits uint32
@@ -58,6 +58,7 @@ func (n *NonceValue) UnmarshalJSON(data []byte) (err error) {
5858
return
5959
}
6060

61+
// TODO(mafa): for version 2 of metadata use NodeID as type for NodeID.
6162
type NodeID []byte
6263

6364
func (n NodeID) MarshalJSON() ([]byte, error) {
@@ -73,6 +74,7 @@ func (n *NodeID) UnmarshalJSON(data []byte) (err error) {
7374
return
7475
}
7576

77+
// TODO(mafa): for version 2 of metadata use ATXID as type for CommitmentAtxID.
7678
type ATXID []byte
7779

7880
func (a ATXID) MarshalJSON() ([]byte, error) {

0 commit comments

Comments
 (0)