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"
|
|
|
|
|
2019-11-05 03:42:13 +00:00
|
|
|
"github.com/filecoin-project/lotus/api"
|
2022-10-28 11:03:39 +00:00
|
|
|
"github.com/filecoin-project/lotus/blockstore"
|
2020-09-07 18:31:43 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/exchange"
|
2021-03-09 21:33:01 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/market"
|
2019-10-18 04:47:41 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/types"
|
2022-06-14 15:00:51 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/vm"
|
2022-03-08 21:48:08 +00:00
|
|
|
"github.com/filecoin-project/lotus/cmd/lotus-shed/shedgen"
|
2020-02-21 19:25:57 +00:00
|
|
|
"github.com/filecoin-project/lotus/node/hello"
|
2020-02-13 00:28:23 +00:00
|
|
|
"github.com/filecoin-project/lotus/paychmgr"
|
2022-06-14 18:03:38 +00:00
|
|
|
sectorstorage "github.com/filecoin-project/lotus/storage/sealer"
|
|
|
|
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
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{},
|
2020-04-08 19:06:41 +00:00
|
|
|
types.ElectionProof{},
|
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{},
|
2019-09-18 02:50:03 +00:00
|
|
|
types.BlockMsg{},
|
2019-11-01 13:58:48 +00:00
|
|
|
types.ExpTipSet{},
|
2020-03-25 23:16:17 +00:00
|
|
|
types.BeaconEntry{},
|
2020-09-14 22:43:12 +00:00
|
|
|
types.StateRoot{},
|
2020-10-06 22:22:54 +00:00
|
|
|
types.StateInfo0{},
|
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
|
|
|
}
|
|
|
|
|
2022-03-13 21:24:13 +00:00
|
|
|
err = gen.WriteTupleEncodersToFile("./chain/vm/cbor_gen.go", "vm",
|
|
|
|
vm.FvmExecutionTrace{},
|
2022-09-09 20:26:55 +00:00
|
|
|
vm.FvmGasCharge{},
|
2022-03-13 21:24:13 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2020-02-13 00:28:23 +00:00
|
|
|
err = gen.WriteMapEncodersToFile("./paychmgr/cbor_gen.go", "paychmgr",
|
|
|
|
paychmgr.VoucherInfo{},
|
|
|
|
paychmgr.ChannelInfo{},
|
2020-07-28 23:16:47 +00:00
|
|
|
paychmgr.MsgInfo{},
|
2019-11-04 19:03:11 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
2019-11-05 03:42:13 +00:00
|
|
|
}
|
|
|
|
|
2019-12-09 16:40:15 +00:00
|
|
|
err = gen.WriteMapEncodersToFile("./api/cbor_gen.go", "api",
|
2019-11-05 03:42:13 +00:00
|
|
|
api.PaymentInfo{},
|
2019-11-06 12:22:08 +00:00
|
|
|
api.SealedRef{},
|
|
|
|
api.SealedRefs{},
|
2020-02-27 23:34:48 +00:00
|
|
|
api.SealTicket{},
|
|
|
|
api.SealSeed{},
|
2021-05-19 11:05:07 +00:00
|
|
|
api.PieceDealInfo{},
|
2022-08-26 00:37:36 +00:00
|
|
|
api.SectorPiece{},
|
2021-05-19 11:05:07 +00:00
|
|
|
api.DealSchedule{},
|
2019-11-05 03:42:13 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2020-02-12 18:23:15 +00:00
|
|
|
err = gen.WriteTupleEncodersToFile("./node/hello/cbor_gen.go", "hello",
|
2020-02-12 18:08:49 +00:00
|
|
|
hello.HelloMessage{},
|
|
|
|
hello.LatencyMessage{},
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2020-11-05 16:50:40 +00:00
|
|
|
err = gen.WriteTupleEncodersToFile("./chain/market/cbor_gen.go", "market",
|
|
|
|
market.FundedAddressState{},
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2020-09-07 18:45:34 +00:00
|
|
|
err = gen.WriteTupleEncodersToFile("./chain/exchange/cbor_gen.go", "exchange",
|
2020-09-07 18:31:43 +00:00
|
|
|
exchange.Request{},
|
|
|
|
exchange.Response{},
|
|
|
|
exchange.CompactedMessages{},
|
|
|
|
exchange.BSTipSet{},
|
2019-11-09 23:00:22 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2019-09-09 17:22:40 +00:00
|
|
|
|
2022-06-14 18:08:10 +00:00
|
|
|
err = gen.WriteMapEncodersToFile("./storage/sealer/storiface/cbor_gen.go", "storiface",
|
2020-09-16 20:33:49 +00:00
|
|
|
storiface.CallID{},
|
2022-09-02 15:12:58 +00:00
|
|
|
storiface.SecDataHttpHeader{},
|
2022-09-16 21:45:23 +00:00
|
|
|
storiface.SectorLocation{},
|
2020-09-16 20:33:49 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2022-06-14 18:08:10 +00:00
|
|
|
err = gen.WriteMapEncodersToFile("./storage/sealer/cbor_gen.go", "sealer",
|
2020-09-14 07:44:55 +00:00
|
|
|
sectorstorage.Call{},
|
2020-09-16 15:08:05 +00:00
|
|
|
sectorstorage.WorkState{},
|
2020-09-16 22:35:09 +00:00
|
|
|
sectorstorage.WorkID{},
|
2020-09-14 07:44:55 +00:00
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2022-03-08 21:48:08 +00:00
|
|
|
err = gen.WriteMapEncodersToFile("./cmd/lotus-shed/shedgen/cbor_gen.go", "shedgen",
|
|
|
|
shedgen.CarbNode{},
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2022-10-28 11:03:39 +00:00
|
|
|
err = gen.WriteTupleEncodersToFile("./blockstore/cbor_gen.go", "blockstore",
|
|
|
|
blockstore.NetRpcReq{},
|
|
|
|
blockstore.NetRpcResp{},
|
|
|
|
blockstore.NetRpcErr{},
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2019-08-21 17:15:28 +00:00
|
|
|
}
|