2020-07-01 16:29:09 +00:00
|
|
|
package testkit
|
2020-06-30 22:02:01 +00:00
|
|
|
|
|
|
|
import (
|
2022-08-25 18:20:41 +00:00
|
|
|
"github.com/libp2p/go-libp2p/core/peer"
|
2022-06-14 15:00:51 +00:00
|
|
|
"github.com/testground/sdk-go/sync"
|
|
|
|
|
2020-06-30 22:02:01 +00:00
|
|
|
"github.com/filecoin-project/go-address"
|
2022-06-14 15:00:51 +00:00
|
|
|
|
2020-06-30 22:02:01 +00:00
|
|
|
"github.com/filecoin-project/lotus/genesis"
|
|
|
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-07-01 16:29:09 +00:00
|
|
|
GenesisTopic = sync.NewTopic("genesis", &GenesisMsg{})
|
|
|
|
BalanceTopic = sync.NewTopic("balance", &InitialBalanceMsg{})
|
|
|
|
PresealTopic = sync.NewTopic("preseal", &PresealMsg{})
|
2020-07-07 12:58:09 +00:00
|
|
|
ClientsAddrsTopic = sync.NewTopic("clients_addrs", &ClientAddressesMsg{})
|
2020-07-01 16:29:09 +00:00
|
|
|
MinersAddrsTopic = sync.NewTopic("miners_addrs", &MinerAddressesMsg{})
|
2020-07-27 11:57:01 +00:00
|
|
|
SlashedMinerTopic = sync.NewTopic("slashed_miner", &SlashedMinerMsg{})
|
2020-07-01 16:29:09 +00:00
|
|
|
PubsubTracerTopic = sync.NewTopic("pubsub_tracer", &PubsubTracerMsg{})
|
|
|
|
DrandConfigTopic = sync.NewTopic("drand_config", &DrandRuntimeInfo{})
|
2020-06-30 22:02:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-07-01 16:29:09 +00:00
|
|
|
StateReady = sync.State("ready")
|
|
|
|
StateDone = sync.State("done")
|
|
|
|
StateStopMining = sync.State("stop-mining")
|
|
|
|
StateMinerPickSeqNum = sync.State("miner-pick-seq-num")
|
2020-07-27 11:57:01 +00:00
|
|
|
StateAbortTest = sync.State("abort-test")
|
2020-06-30 22:02:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type InitialBalanceMsg struct {
|
|
|
|
Addr address.Address
|
2020-07-07 21:02:29 +00:00
|
|
|
Balance float64
|
2020-06-30 22:02:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PresealMsg struct {
|
|
|
|
Miner genesis.Miner
|
|
|
|
Seqno int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type GenesisMsg struct {
|
|
|
|
Genesis []byte
|
|
|
|
Bootstrapper []byte
|
|
|
|
}
|
|
|
|
|
2020-07-07 12:58:09 +00:00
|
|
|
type ClientAddressesMsg struct {
|
2020-07-07 16:38:15 +00:00
|
|
|
PeerNetAddr peer.AddrInfo
|
|
|
|
WalletAddr address.Address
|
2020-08-28 12:36:20 +00:00
|
|
|
GroupSeq int64
|
2020-07-07 12:58:09 +00:00
|
|
|
}
|
|
|
|
|
2020-06-30 22:02:01 +00:00
|
|
|
type MinerAddressesMsg struct {
|
2020-07-07 12:58:09 +00:00
|
|
|
FullNetAddrs peer.AddrInfo
|
|
|
|
MinerNetAddrs peer.AddrInfo
|
|
|
|
MinerActorAddr address.Address
|
2020-07-27 11:57:01 +00:00
|
|
|
WalletAddr address.Address
|
|
|
|
}
|
|
|
|
|
|
|
|
type SlashedMinerMsg struct {
|
|
|
|
MinerActorAddr address.Address
|
2020-06-30 22:02:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PubsubTracerMsg struct {
|
|
|
|
Multiaddr string
|
|
|
|
}
|
|
|
|
|
|
|
|
type DrandRuntimeInfo struct {
|
|
|
|
Config dtypes.DrandConfig
|
|
|
|
GossipBootstrap dtypes.DrandBootstrap
|
|
|
|
}
|