2020-10-28 17:35:56 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
2021-06-08 21:30:23 +00:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2020-10-28 17:35:56 +00:00
|
|
|
|
2020-11-12 14:18:30 +00:00
|
|
|
"github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
)
|
|
|
|
|
2021-06-08 21:30:23 +00:00
|
|
|
const TicketRandomnessLookback = 1
|
2020-10-28 17:35:56 +00:00
|
|
|
|
2020-11-27 16:16:08 +00:00
|
|
|
// DioneTask represents the values of task computation
|
2021-06-08 21:30:23 +00:00
|
|
|
// DEPRECATED!
|
2020-10-28 17:35:56 +00:00
|
|
|
type DioneTask struct {
|
2021-04-26 22:01:04 +00:00
|
|
|
OriginChain uint8
|
|
|
|
RequestType string
|
|
|
|
RequestParams string
|
|
|
|
Miner peer.ID
|
2021-06-08 21:30:23 +00:00
|
|
|
MinerEth common.Address
|
2021-04-26 22:01:04 +00:00
|
|
|
ElectionProof *ElectionProof
|
|
|
|
BeaconEntries []BeaconEntry
|
2021-06-08 21:30:23 +00:00
|
|
|
DrandRound uint64
|
2021-04-26 22:01:04 +00:00
|
|
|
Payload []byte
|
|
|
|
RequestID string
|
|
|
|
ConsensusID string
|
|
|
|
Signature []byte `hash:"-"`
|
2020-11-15 05:59:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewDioneTask(
|
2020-11-27 16:16:08 +00:00
|
|
|
originChain uint8,
|
|
|
|
requestType string,
|
|
|
|
requestParams string,
|
2020-11-15 05:59:46 +00:00
|
|
|
miner peer.ID,
|
|
|
|
electionProof *ElectionProof,
|
|
|
|
beacon []BeaconEntry,
|
2021-06-08 21:30:23 +00:00
|
|
|
drandRound uint64,
|
2020-11-15 05:59:46 +00:00
|
|
|
payload []byte,
|
|
|
|
) *DioneTask {
|
|
|
|
return &DioneTask{
|
2020-11-27 16:16:08 +00:00
|
|
|
OriginChain: originChain,
|
|
|
|
RequestType: requestType,
|
|
|
|
RequestParams: requestParams,
|
2020-11-25 18:54:59 +00:00
|
|
|
Miner: miner,
|
2020-11-15 05:59:46 +00:00
|
|
|
ElectionProof: electionProof,
|
|
|
|
BeaconEntries: beacon,
|
2021-06-08 21:30:23 +00:00
|
|
|
DrandRound: drandRound,
|
2020-11-15 05:59:46 +00:00
|
|
|
Payload: payload,
|
|
|
|
}
|
2020-10-28 17:35:56 +00:00
|
|
|
}
|