diff --git a/pkg/types/block.go b/pkg/types/block.go index c3df2b4..03fdbc5 100644 --- a/pkg/types/block.go +++ b/pkg/types/block.go @@ -105,6 +105,8 @@ type BlockEvent struct { KSize uint8 `json:"k_size"` HeaderHash string `json:"header_hash"` Height uint32 `json:"height"` + ValidationTime float64 `json:"validation_time"` + PreValidationTime float64 `json:"pre_validation_time"` BlockCost uint64 `json:"block_cost"` BlockFees uint64 `json:"block_fees"` TransactionGeneratorSizeBytes uint64 `json:"transaction_generator_size_bytes"` diff --git a/pkg/types/farmer.go b/pkg/types/farmer.go new file mode 100644 index 0000000..2e905fb --- /dev/null +++ b/pkg/types/farmer.go @@ -0,0 +1,29 @@ +package types + +// EventFarmerSubmittedPartial is the event data for `submitted_partial` from the farmer +type EventFarmerSubmittedPartial struct { + LauncherID string `json:"launcher_id"` + PoolURL string `json:"pool_url"` + CurrentDifficulty uint64 `json:"current_difficulty"` + PointsAcknowledgedSinceStart uint64 `json:"points_acknowledged_since_start"` +} + +// EventFarmerProof is the farmer event `proof` +type EventFarmerProof struct { + Proof DeclareProofOfSpace `json:"proof"` + PassedFilter bool `json:"passed_filter"` +} + +// DeclareProofOfSpace matches to the farmer protocol type +type DeclareProofOfSpace struct { + ChallengeHash string `json:"challenge_hash"` + ChallengeChainSP string `json:"challenge_chain_sp"` + SignagePointIndex uint8 `json:"signage_point_index"` + RewardChainSP string `json:"reward_chain_sp"` + ProofOfSpace ProofOfSpace `json:"proof_of_space"` + ChallengeChainSPSignature G2Element `json:"challenge_chain_sp_signature"` + RewardChainSPSignature G2Element `json:"reward_chain_sp_signature"` + FarmerPuzzleHash string `json:"farmer_puzzle_hash"` + PoolTarget *PoolTarget `json:"pool_target,omitempty"` + PoolSignature *G2Element `json:"pool_signature,omitempty"` +} diff --git a/pkg/types/harvester.go b/pkg/types/harvester.go new file mode 100644 index 0000000..e5763d5 --- /dev/null +++ b/pkg/types/harvester.go @@ -0,0 +1,10 @@ +package types + +// EventHarvesterFarmingInfo is the event data for `farming_info` from the harvester +type EventHarvesterFarmingInfo struct { + ChallengeHash string `json:"challenge_hash"` + TotalPlots uint64 `json:"total_plots"` + FoundProofs uint64 `json:"found_proofs"` + EligiblePlots uint64 `json:"eligible_plots"` + Time float64 `json:"time"` +} diff --git a/pkg/websocketclient/websocketclient.go b/pkg/websocketclient/websocketclient.go index aa7226c..e30307e 100644 --- a/pkg/websocketclient/websocketclient.go +++ b/pkg/websocketclient/websocketclient.go @@ -200,7 +200,7 @@ func (c *WebsocketClient) AddDisconnectHandler(onDisconnect rpcinterface.Disconn } func (c *WebsocketClient) reconnectLoop() { - for _, handler := range c.disconnectHandlers{ + for _, handler := range c.disconnectHandlers { handler() } for {