lotus/gen/main.go

88 lines
1.8 KiB
Go
Raw Normal View History

2019-08-21 17:15:28 +00:00
package main
import (
"fmt"
"os"
2019-10-22 10:20:43 +00:00
gen "github.com/whyrusleeping/cbor-gen"
"github.com/filecoin-project/lotus/api"
2019-11-09 23:00:22 +00:00
"github.com/filecoin-project/lotus/chain/blocksync"
"github.com/filecoin-project/lotus/chain/types"
2020-01-13 17:44:59 +00:00
"github.com/filecoin-project/lotus/lib/statemachine"
2019-11-04 19:03:11 +00:00
"github.com/filecoin-project/lotus/paych"
"github.com/filecoin-project/lotus/storage/sealing"
2019-08-21 17:15:28 +00:00
)
func main() {
2019-09-10 02:05:24 +00:00
err := gen.WriteTupleEncodersToFile("./chain/types/cbor_gen.go", "types",
types.BlockHeader{},
types.Ticket{},
2019-11-21 22:21:45 +00:00
types.EPostProof{},
types.EPostTicket{},
2019-09-10 02:05:24 +00:00
types.Message{},
types.SignedMessage{},
types.MsgMeta{},
2019-09-17 01:56:37 +00:00
types.Actor{},
types.MessageReceipt{},
types.BlockMsg{},
2019-10-22 10:20:43 +00:00
types.SignedStorageAsk{},
types.StorageAsk{},
2019-11-01 13:58:48 +00:00
types.ExpTipSet{},
2019-09-10 02:05:24 +00:00
)
if err != nil {
fmt.Println(err)
os.Exit(1)
2019-08-21 17:15:28 +00:00
}
2020-02-13 00:10:07 +00:00
err = gen.WriteMapEncodersToFile("./paych/cbor_gen.go", "paych",
2019-11-04 19:03:11 +00:00
paych.VoucherInfo{},
paych.ChannelInfo{},
)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2019-12-09 16:40:15 +00:00
err = gen.WriteMapEncodersToFile("./api/cbor_gen.go", "api",
api.PaymentInfo{},
2019-11-06 12:22:08 +00:00
api.SealedRef{},
api.SealedRefs{},
)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2019-11-09 23:00:22 +00:00
err = gen.WriteTupleEncodersToFile("./chain/blocksync/cbor_gen.go", "blocksync",
blocksync.BlockSyncRequest{},
blocksync.BlockSyncResponse{},
blocksync.BSTipSet{},
)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2019-09-09 17:22:40 +00:00
2020-01-21 16:05:10 +00:00
err = gen.WriteMapEncodersToFile("./storage/sealing/cbor_gen.go", "sealing",
sealing.SealTicket{},
sealing.SealSeed{},
sealing.Piece{},
sealing.SectorInfo{},
2020-01-22 02:41:39 +00:00
sealing.Log{},
2019-11-01 13:58:48 +00:00
)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
2020-01-06 21:01:49 +00:00
2020-01-13 17:44:59 +00:00
err = gen.WriteMapEncodersToFile("./lib/statemachine/cbor_gen.go", "statemachine",
statemachine.TestState{},
statemachine.TestEvent{},
2020-01-06 21:01:49 +00:00
)
if err != nil {
fmt.Printf("%+v\n", err)
os.Exit(1)
}
2019-08-21 17:15:28 +00:00
}