-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(retrievalmarket): remove old types
- Loading branch information
1 parent
a7d62b8
commit 58940d3
Showing
19 changed files
with
128 additions
and
2,604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,8 @@ | ||
package migrations | ||
|
||
import ( | ||
versioning "github.com/filecoin-project/go-ds-versioning/pkg" | ||
"github.com/filecoin-project/go-ds-versioning/pkg/versioned" | ||
|
||
"github.com/filecoin-project/go-fil-markets/discovery" | ||
"github.com/filecoin-project/go-fil-markets/retrievalmarket" | ||
"github.com/filecoin-project/go-fil-markets/retrievalmarket/migrations" | ||
) | ||
|
||
//go:generate cbor-gen-for RetrievalPeers0 | ||
|
||
// RetrievalPeers0 is version 0 of RetrievalPeers | ||
type RetrievalPeers0 struct { | ||
Peers []migrations.RetrievalPeer0 | ||
} | ||
|
||
// MigrateRetrievalPeers0To1 migrates a tuple encoded list of retrieval peers to a map encoded list | ||
func MigrateRetrievalPeers0To1(oldRps *RetrievalPeers0) (*discovery.RetrievalPeers, error) { | ||
peers := make([]retrievalmarket.RetrievalPeer, 0, len(oldRps.Peers)) | ||
for _, oldRp := range oldRps.Peers { | ||
peers = append(peers, retrievalmarket.RetrievalPeer{ | ||
Address: oldRp.Address, | ||
ID: oldRp.ID, | ||
PieceCID: oldRp.PieceCID, | ||
}) | ||
} | ||
return &discovery.RetrievalPeers{ | ||
Peers: peers, | ||
}, nil | ||
} | ||
|
||
// RetrievalPeersMigrations are migrations for the store local discovery list of peers we can retrieve from | ||
var RetrievalPeersMigrations = versioned.BuilderList{ | ||
versioned.NewVersionedBuilder(MigrateRetrievalPeers0To1, versioning.VersionKey("1")), | ||
} | ||
var RetrievalPeersMigrations = versioned.BuilderList{} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.