Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new farming events #94

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pkg/types/farmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,37 @@ package types

import (
"github.com/samber/mo"

"github.com/chia-network/go-chia-libs/pkg/tuple"
)

// FarmerMissingSignagePoints is the struct representation of the missing signage points tuple
type FarmerMissingSignagePoints struct {
Timestamp Timestamp // uint64 in the Python Tuple
Count uint32
}

// EventFarmerNewSignagePoint is the event data for `new_signage_point` in the farmer service
type EventFarmerNewSignagePoint struct {
SPHash Bytes32 `json:"sp_hash"`
MissingSignagePoints mo.Option[tuple.Tuple[FarmerMissingSignagePoints]]
}

// EventFarmerNewFarmingInfo is the event data for `new_farming_info` from the farmer
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer_api.py#L535
type EventFarmerNewFarmingInfo struct {
FarmingInfo struct {
ChallengeHash Bytes32 `json:"challenge_hash"`
SignagePoint Bytes32 `json:"signage_point"`
PassedFilter uint32 `json:"passed_filter"`
Proofs uint32 `json:"proofs"`
TotalPlots uint32 `json:"total_plots"`
Timestamp Timestamp `json:"timestamp"`
NodeID Bytes32 `json:"node_id"`
LookupTime uint64 `json:"lookup_time"`
} `json:"farming_info"`
}

// EventFarmerSubmittedPartial is the event data for `submitted_partial` from the farmer
// https://github.com/Chia-Network/chia-blockchain/blob/main/chia/farmer/farmer_api.py#L270
type EventFarmerSubmittedPartial struct {
Expand Down