bounty

package
v0.0.0-...-1427f80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactStats

type ArtifactStats struct {
	Hash           string `json:"hash"`
	BlockSize      int    `json:"block_size"`
	CumulativeSize int    `json:"cumulative_size"`
	DataSize       int    `json:"data_size"`
	NumLinks       int    `json:"num_links"`
}

type Assertion

type Assertion struct {
	Author   common.Address `json:"author"`
	Bid      *big.Int       `json:"bid"`
	Mask     *big.Int       `json:"mask"`
	Verdicts *big.Int       `json:"verdicts"`
	Metadata string         `json:"metadata"`
}

Keep these in sync with the BountyRegistry contract

type Bounty

type Bounty struct {
	Guid            uuid.UUID      `json:"guid"`
	Author          common.Address `json:"author"`
	Amount          *big.Int       `json:"amount"`
	ArtifactURI     string         `json:"uri"`
	ExpirationBlock *big.Int       `json:"expiration"`
	Resolved        bool           `json:"resolved"`
	Verdicts        []bool         `json:"verdicts"`
}

Keep these in sync with the BountyRegistry contract

func NewBountyFromRaw

func NewBountyFromRaw(rb RawBounty) *Bounty

type BountyRegistry

type BountyRegistry struct {
	// contains filtered or unexported fields
}

func NewBountyRegistry

func NewBountyRegistry(session *bindings.BountyRegistrySession, client *ethclient.Client, ipfs string) *BountyRegistry

func (*BountyRegistry) DownloadArtifact

func (br *BountyRegistry) DownloadArtifact(ipfshash string) (io.ReadCloser, error)

func (*BountyRegistry) GetActiveBounties

func (br *BountyRegistry) GetActiveBounties() []*Bounty

func (*BountyRegistry) GetAssertionsByGuid

func (br *BountyRegistry) GetAssertionsByGuid(guid *big.Int) []*Assertion

func (*BountyRegistry) GetBounties

func (br *BountyRegistry) GetBounties() []*Bounty

func (*BountyRegistry) GetBountyByGuid

func (br *BountyRegistry) GetBountyByGuid(guid *big.Int) *Bounty

func (*BountyRegistry) ListArtifacts

func (br *BountyRegistry) ListArtifacts(ipfshash string) ([]string, error)

func (*BountyRegistry) PostAssertion

func (br *BountyRegistry) PostAssertion(ctx context.Context, bountyGuid *big.Int, bid int, mask []bool, verdicts []bool, metadata string) error

func (*BountyRegistry) PostBounty

func (br *BountyRegistry) PostBounty(ctx context.Context, uri string, amount, blockDuration int) (*big.Int, error)

func (*BountyRegistry) StatArtifact

func (br *BountyRegistry) StatArtifact(ipfshash string) (*ArtifactStats, error)

func (*BountyRegistry) UploadArtifacts

func (br *BountyRegistry) UploadArtifacts(rs map[string]io.Reader) (string, error)

func (*BountyRegistry) WatchForEvents

func (br *BountyRegistry) WatchForEvents(eventChan chan *Event) error

type Event

type Event struct {
	Type string
	Body interface{}
}

type NewAssertionEvent

type NewAssertionEvent struct {
	BountyGuid string
	Author     common.Address
	Index      *big.Int
	Bid        *big.Int
	Mask       []bool
	Verdicts   []bool
	Metadata   string
}

func NewAssertionEventFromLog

func NewAssertionEventFromLog(nae NewAssertionEventLog) *NewAssertionEvent

type NewAssertionEventLog

type NewAssertionEventLog struct {
	BountyGuid *big.Int
	Author     common.Address
	Index      *big.Int
	Bid        *big.Int
	Mask       *big.Int
	Verdicts   *big.Int
	Metadata   string
}

type NewBountyEvent

type NewBountyEvent struct {
	Guid            string
	Author          common.Address
	Amount          *big.Int
	ArtifactURI     string
	ExpirationBlock *big.Int
}

func NewBountyEventFromLog

func NewBountyEventFromLog(nbe NewBountyEventLog) *NewBountyEvent

type NewBountyEventLog

type NewBountyEventLog struct {
	Guid            *big.Int
	Author          common.Address
	Amount          *big.Int
	ArtifactURI     string
	ExpirationBlock *big.Int
}

type NewVerdictEvent

type NewVerdictEvent struct {
	BountyGuid string
	Verdicts   []bool
}

func NewVerdictEventFromLog

func NewVerdictEventFromLog(nve NewVerdictEventLog) *NewVerdictEvent

type NewVerdictEventLog

type NewVerdictEventLog struct {
	BountyGuid *big.Int
	Verdicts   *big.Int
}

type RawBounty

type RawBounty struct {
	Guid            *big.Int
	Author          common.Address
	Amount          *big.Int
	ArtifactURI     string
	ExpirationBlock *big.Int
	Resolved        bool
	Verdicts        *big.Int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL