lotus/retrieval/impl/run_cbor_gen.go
hannahhoward 5b74a71dd3 feat(retrievalmarket): extract skeleton interfaces
Define all types to spec, modify interfaces, wrap old code

fix(builder): use client blockstore for retrieval

feat(retrieval): add node implementations

add node adapters for client & provider so that retrieval can be extracted
2020-01-08 12:45:43 -08:00

34 lines
613 B
Go

package retrievalimpl
import (
"fmt"
"os"
cborgen "github.com/whyrusleeping/cbor-gen"
)
func RunCborGen() error {
genName := "./impl/cbor_gen.go"
reName := "./impl/cbor_gen_old.go"
if err := os.Rename(genName, reName); err != nil {
return fmt.Errorf("could not rename %s to %s", genName, reName)
}
if err := cborgen.WriteTupleEncodersToFile(
genName,
"retrievalimpl",
RetParams{},
OldQuery{},
OldQueryResponse{},
Unixfs0Offer{},
OldDealProposal{},
OldDealResponse{},
Block{},
); err != nil {
return err
}
if err := os.Remove(reName); err != nil {
return err
}
return nil
}