add miner side commands and a few other goodies

This commit is contained in:
whyrusleeping
2020-03-03 18:49:00 -08:00
parent 52acfb88ee
commit 9169a073b6
6 changed files with 112 additions and 3 deletions
+11
View File
@@ -178,6 +178,9 @@ type StorageMinerStruct struct {
WorkerDone func(ctx context.Context, task uint64, res sectorbuilder.SealRes) error `perm:"admin"`
SetPrice func(context.Context, types.BigInt) error `perm:"admin"`
DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string) error `perm:"write"`
DealsList func(ctx context.Context) ([]storagemarket.StorageDeal, error) `perm:"read"`
}
}
@@ -635,6 +638,14 @@ func (c *StorageMinerStruct) SetPrice(ctx context.Context, p types.BigInt) error
return c.Internal.SetPrice(ctx, p)
}
func (c *StorageMinerStruct) DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error {
return c.Internal.DealsImportData(ctx, dealPropCid, file)
}
func (c *StorageMinerStruct) DealsList(ctx context.Context) ([]storagemarket.StorageDeal, error) {
return c.Internal.DealsList(ctx)
}
var _ api.Common = &CommonStruct{}
var _ api.FullNode = &FullNodeStruct{}
var _ api.StorageMiner = &StorageMinerStruct{}