Fix debug_advance
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
2165728088
commit
1f967c6f63
@ -3,6 +3,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/binary"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
lapi "github.com/filecoin-project/lotus/api"
|
lapi "github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
@ -68,11 +71,21 @@ func init() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// TODO: beacon
|
// TODO: beacon
|
||||||
|
ep := &types.ElectionProof{}
|
||||||
|
ep.WinCount = ep.ComputeWinCount(types.NewInt(1), types.NewInt(1))
|
||||||
|
for ep.WinCount == 0 {
|
||||||
|
fakeVrf := make([]byte, 8)
|
||||||
|
unixNow := uint64(time.Now().UnixNano())
|
||||||
|
binary.LittleEndian.PutUint64(fakeVrf, unixNow)
|
||||||
|
|
||||||
|
ep.VRFProof = fakeVrf
|
||||||
|
ep.WinCount = ep.ComputeWinCount(types.NewInt(1), types.NewInt(1))
|
||||||
|
}
|
||||||
|
|
||||||
uts := head.MinTimestamp() + uint64(build.BlockDelay)
|
uts := head.MinTimestamp() + uint64(build.BlockDelay)
|
||||||
nheight := head.Height() + 1
|
nheight := head.Height() + 1
|
||||||
blk, err := api.MinerCreateBlock(ctx, &lapi.BlockTemplate{
|
blk, err := api.MinerCreateBlock(ctx, &lapi.BlockTemplate{
|
||||||
addr, head.Key(), ticket, &types.ElectionProof{}, nil, msgs, nheight, uts, gen.ValidWpostForTesting,
|
addr, head.Key(), ticket, ep, nil, msgs, nheight, uts, gen.ValidWpostForTesting,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("creating block: %w", err)
|
return xerrors.Errorf("creating block: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user