diff --git a/.gitignore b/.gitignore index 6be2fafc8..6f73f51bb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ eth/protocol # Our compiled binary livepeer +livepeer_cli diff --git a/cmd/livepeer/livepeer.go b/cmd/livepeer/livepeer.go index 651a98678..2906ae221 100644 --- a/cmd/livepeer/livepeer.go +++ b/cmd/livepeer/livepeer.go @@ -542,17 +542,6 @@ func setupOrchestrator(ctx context.Context, n *core.LivepeerNode, em eth.EventMo rs := eventservices.NewRewardService(n.Eth) n.EthServices["RewardService"] = rs - // Create job service to listen for new jobs and transcode if assigned to the job - js := eventservices.NewJobService(n) - n.EthServices["JobService"] = js - - // Restart jobs as necessary - err = js.RestartTranscoder() - if err != nil { - glog.Errorf("Unable to restart orchestrator: %v", err) - // non-fatal, so continue - } - return nil } diff --git a/cmd/livepeer_cli/livepeer_cli.go b/cmd/livepeer_cli/livepeer_cli.go index 1ed21e080..a7460b67e 100644 --- a/cmd/livepeer_cli/livepeer_cli.go +++ b/cmd/livepeer_cli/livepeer_cli.go @@ -83,7 +83,6 @@ func (w *wizard) initializeOptions() []wizardOpt { {desc: "Get node status", invoke: func() { w.stats(w.orchestrator) }}, {desc: "View protocol parameters", invoke: w.protocolStats}, {desc: "List registered orchestrators", invoke: func() { w.registeredOrchestratorStats() }}, - {desc: "Print latest jobs", invoke: w.printLast5Jobs}, {desc: "Invoke \"initialize round\"", invoke: w.initializeRound}, {desc: "Invoke \"bond\"", invoke: w.bond}, {desc: "Invoke \"unbond\"", invoke: w.unbond}, @@ -95,8 +94,6 @@ func (w *wizard) initializeOptions() []wizardOpt { {desc: "Invoke \"reward\"", invoke: w.callReward, orchestrator: true}, {desc: "Invoke multi-step \"become an orchestrator\"", invoke: w.activateOrchestrator, orchestrator: true}, {desc: "Set orchestrator config", invoke: w.setOrchestratorConfig, orchestrator: true}, - {desc: "Invoke \"deposit\" (ETH)", invoke: w.deposit, notOrchestrator: true}, - {desc: "Invoke \"withdraw deposit\" (ETH)", invoke: w.withdraw, notOrchestrator: true}, {desc: "Set broadcast config", invoke: w.setBroadcastConfig, notOrchestrator: true}, {desc: "Set Eth gas price", invoke: w.setGasPrice}, {desc: "Get test LPT", invoke: w.requestTokens, testnet: true}, diff --git a/cmd/livepeer_cli/wizard_deposit.go b/cmd/livepeer_cli/wizard_deposit.go index 8205dae1b..96d0c2baf 100644 --- a/cmd/livepeer_cli/wizard_deposit.go +++ b/cmd/livepeer_cli/wizard_deposit.go @@ -3,7 +3,6 @@ package main import ( "fmt" "math/big" - "net/url" "github.com/livepeer/go-livepeer/eth" ) @@ -16,23 +15,3 @@ func str2eth(v string) string { } return eth.FormatUnits(i, "ETH") } - -func (w *wizard) deposit() { - fmt.Printf("Current deposit: %v\n", str2eth(w.getDeposit())) - fmt.Printf("Current balance: %v\n", str2eth(w.getEthBalance())) - fmt.Printf("Enter Deposit Amount in Wei - ") - amount := w.readBigInt() - - val := url.Values{ - "amount": {fmt.Sprintf("%v", amount.String())}, - } - - httpPostWithParams(fmt.Sprintf("http://%v:%v/deposit", w.host, w.httpPort), val) -} - -func (w *wizard) withdraw() { - // We don't run str2eth here to facilitate copy-pasting - fmt.Printf("Current deposit in Wei: %v\n", w.getDeposit()) - - httpPost(fmt.Sprintf("http://%v:%v/withdrawDeposit", w.host, w.httpPort)) -} diff --git a/cmd/livepeer_cli/wizard_jobs.go b/cmd/livepeer_cli/wizard_jobs.go deleted file mode 100644 index 9e9bf04da..000000000 --- a/cmd/livepeer_cli/wizard_jobs.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import ( - "fmt" -) - -func (w *wizard) printLast5Jobs() { - fmt.Print("Enter # of the latest jobs you would like to print ") - c := w.readInt() - - fmt.Println(httpGet(fmt.Sprintf("http://%v:%v/latestJobs?count=%v", w.host, w.httpPort, c))) - return -} diff --git a/cmd/livepeer_cli/wizard_stats.go b/cmd/livepeer_cli/wizard_stats.go index 45ddaaad7..a774e1b6d 100644 --- a/cmd/livepeer_cli/wizard_stats.go +++ b/cmd/livepeer_cli/wizard_stats.go @@ -93,17 +93,9 @@ func (w *wizard) protocolStats() { []string{"RoundLength (Blocks)", params.RoundLength.String()}, []string{"RoundLockAmount (%)", eth.FormatPerc(params.RoundLockAmount)}, []string{"UnbondingPeriod (Rounds)", strconv.Itoa(int(params.UnbondingPeriod))}, - []string{"VerificationRate (1 / # of segments)", strconv.Itoa(int(params.VerificationRate))}, - []string{"VerificationPeriod (Blocks)", params.VerificationPeriod.String()}, - []string{"SlashingPeriod (Blocks)", params.SlashingPeriod.String()}, - []string{"FailedVerificationSlashAmount (%)", eth.FormatPerc(params.FailedVerificationSlashAmount)}, - []string{"MissedVerificationSlashAmount (%)", eth.FormatPerc(params.MissedVerificationSlashAmount)}, - []string{"DoubleClaimSegmentSlashAmount (%)", eth.FormatPerc(params.DoubleClaimSegmentSlashAmount)}, - []string{"FinderFee (%)", eth.FormatPerc(params.FinderFee)}, []string{"Inflation (%)", eth.FormatPerc(params.Inflation)}, []string{"InflationChange (%)", eth.FormatPerc(params.InflationChange)}, []string{"TargetBondingRate (%)", eth.FormatPerc(params.TargetBondingRate)}, - []string{"VerificationCodeHash", params.VerificationCodeHash}, []string{"Total Bonded", eth.FormatUnits(params.TotalBonded, "LPT")}, []string{"Total Supply", eth.FormatUnits(params.TotalSupply, "LPT")}, []string{"Current Participation Rate (%)", currentParticipationRate.String()}, @@ -129,7 +121,6 @@ func (w *wizard) broadcastStats() { table := tablewriter.NewWriter(os.Stdout) data := [][]string{ - []string{"Deposit", w.getDeposit()}, []string{"Broadcast Price Per Segment in Wei", price.String()}, []string{"Broadcast Transcoding Options", transcodingOptions}, } @@ -197,7 +188,6 @@ func (w *wizard) orchestratorEventSubscriptions() { data := [][]string{ []string{"Watching for new rounds to initialize", strconv.FormatBool(subMap["RoundService"])}, []string{"Watching for initialized rounds to call reward", strconv.FormatBool(subMap["RewardService"])}, - []string{"Watching for new jobs", strconv.FormatBool(subMap["JobService"])}, } for _, v := range data { @@ -325,14 +315,6 @@ func (w *wizard) getEthBalance() string { return e } -func (w *wizard) getDeposit() string { - e := httpGet(fmt.Sprintf("http://%v:%v/broadcasterDeposit", w.host, w.httpPort)) - if e == "" { - e = "Unknown" - } - return e -} - func (w *wizard) getBroadcastConfig() (*big.Int, string) { resp, err := http.Get(fmt.Sprintf("http://%v:%v/getBroadcastConfig", w.host, w.httpPort)) if err != nil { diff --git a/common/db.go b/common/db.go index a433efd64..44162d4d6 100644 --- a/common/db.go +++ b/common/db.go @@ -6,12 +6,9 @@ import ( "errors" "math/big" "text/template" - "time" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/golang/glog" - lpTypes "github.com/livepeer/go-livepeer/eth/types" - "github.com/livepeer/lpms/ffmpeg" _ "github.com/mattn/go-sqlite3" ) @@ -20,50 +17,12 @@ type DB struct { // prepared statements updateKV *sql.Stmt - insertJob *sql.Stmt - selectJobs *sql.Stmt - getJob *sql.Stmt - stopReason *sql.Stmt - insertRec *sql.Stmt - checkRec *sql.Stmt - insertClaim *sql.Stmt - countClaims *sql.Stmt - setReceiptClaim *sql.Stmt - setClaimStatus *sql.Stmt - unclaimedReceipts *sql.Stmt - receiptsByClaim *sql.Stmt - insertBcast *sql.Stmt - selectBcasts *sql.Stmt - setSegmentCount *sql.Stmt insertUnbondingLock *sql.Stmt useUnbondingLock *sql.Stmt unbondingLocks *sql.Stmt withdrawableUnbondingLocks *sql.Stmt } -type DBJob struct { - ID int64 - streamID string - price int64 - profiles []ffmpeg.VideoProfile - broadcaster ethcommon.Address - Transcoder ethcommon.Address - startBlock int64 - endBlock int64 - StopReason sql.NullString - Segments int64 - Claims int64 -} - -type DBReceipt struct { - JobID int64 - SeqNo int64 - BcastFile string - BcastHash []byte - BcastSig []byte - TcodeHash []byte -} - type DBUnbondingLock struct { ID int64 Delegator ethcommon.Address @@ -84,68 +43,6 @@ var schema = ` INSERT OR IGNORE INTO kv(key, value) VALUES('dbVersion', '{{ . }}'); INSERT OR IGNORE INTO kv(key, value) VALUES('lastBlock', '0'); - CREATE TABLE IF NOT EXISTS jobs ( - id INTEGER PRIMARY KEY, - recordedAt STRING DEFAULT CURRENT_TIMESTAMP, - streamID STRING, - segmentPrice INTEGER, - transcodeOptions STRING, - broadcaster STRING, - transcoder STRING, - startBlock INTEGER, - endBlock INTEGER, - stopReason STRING DEFAULT NULL, - stoppedAt STRING DEFAULT NULL - ); - -- Index to avoid a full jobs table scan during recovery - CREATE INDEX IF NOT EXISTS idx_jobs_endblock_stopreason ON jobs(endBlock, stopReason); - - CREATE TABLE IF NOT EXISTS claims ( - id INTEGER, - jobID INTEGER, - claimRoot STRING, - claimBlock INTEGER, - claimedAt STRING DEFAULT CURRENT_TIMESTAMP, - updatedAt STRING DEFAULT CURRENT_TIMESTAMP, - status STRING DEFAULT 'Created', - PRIMARY KEY(id, jobID), - FOREIGN KEY(jobID) REFERENCES jobs(id) - ); - - CREATE TABLE IF NOT EXISTS receipts ( - jobID INTEGER NOT NULL, - claimID INTEGER, - seqNo INTEGER NOT NULL, - bcastFile STRING, - bcastHash STRING, - bcastSig STRING, - transcodedHash STRING, - transcodeStartedAt STRING, - transcodeEndedAt STRING, - errorMsg STRING DEFAULT NULL, - PRIMARY KEY(jobID, seqNo), - FOREIGN KEY(jobID) REFERENCES jobs(id), - FOREIGN KEY(claimID, jobID) REFERENCES claims(id, jobID) - ); - CREATE INDEX IF NOT EXISTS idx_receipts_claimid_errormsg ON receipts(claimID, errorMsg); - - CREATE TABLE IF NOT EXISTS broadcasts ( - id INTEGER PRIMARY KEY, - recordedAt STRING DEFAULT CURRENT_TIMESTAMP, - streamID STRING, - segmentPrice INTEGER, - segmentCount INTEGER DEFAULT 0, - transcodeOptions STRING, - broadcaster STRING, - transcoder STRING, - startBlock INTEGER, - endBlock INTEGER, - stopReason STRING DEFAULT NULL, - stoppedAt STRING DEFAULT NULL - ); - -- Index to avoid a full table scan - CREATE INDEX IF NOT EXISTS idx_broadcasts_endblock_stopreason ON broadcasts(endBlock, stopReason); - CREATE TABLE IF NOT EXISTS unbondingLocks ( id INTEGER NOT NULL, delegator STRING, @@ -158,32 +55,6 @@ var schema = ` CREATE INDEX IF NOT EXISTS idx_unbondinglocks_usedblock ON unbondingLocks(usedBlock); ` -func NewDBJob(id *big.Int, streamID string, - segmentPrice *big.Int, profiles []ffmpeg.VideoProfile, - broadcaster ethcommon.Address, transcoder ethcommon.Address, - startBlock *big.Int, endBlock *big.Int) *DBJob { - return &DBJob{ - ID: id.Int64(), streamID: streamID, profiles: profiles, - price: segmentPrice.Int64(), broadcaster: broadcaster, Transcoder: transcoder, - startBlock: startBlock.Int64(), endBlock: endBlock.Int64(), - } -} - -func DBJobToEthJob(j *DBJob) *lpTypes.Job { - return &lpTypes.Job{ - JobId: big.NewInt(j.ID), - StreamId: j.streamID, - MaxPricePerSegment: big.NewInt(j.price), - Profiles: j.profiles, - BroadcasterAddress: j.broadcaster, - TranscoderAddress: j.Transcoder, - CreationBlock: big.NewInt(j.startBlock), - EndBlock: big.NewInt(j.endBlock), - TotalClaims: big.NewInt(j.Claims), - FirstClaimSubmitted: j.Claims > 0, - } -} - func InitDB(dbPath string) (*DB, error) { // XXX need a way to ensure (via unit tests?) that all DB{} fields are // properly closed / cleaned up in the case of an error @@ -237,136 +108,6 @@ func InitDB(dbPath string) (*DB, error) { } d.updateKV = stmt - // insertJob prepared statement - stmt, err = db.Prepare("INSERT INTO jobs(id, streamID, segmentPrice, transcodeOptions, broadcaster, transcoder, startBlock, endBlock) VALUES(?, ?, ?, ?, ?, ?, ?, ?)") - if err != nil { - glog.Error("Unable to prepare insertjob stmt ", err) - d.Close() - return nil, err - } - d.insertJob = stmt - - // select all jobs since - stmt, err = db.Prepare("SELECT id, streamID, segmentPrice, transcodeOptions, broadcaster, transcoder, startBlock, endBlock FROM jobs WHERE endBlock > ? AND stopReason IS NULL") - if err != nil { - glog.Error("Unable to prepare selectjob stmt ", err) - d.Close() - return nil, err - } - d.selectJobs = stmt - - // get a single job - stmt, err = db.Prepare("SELECT id, streamID, segmentPrice, transcodeOptions, broadcaster, transcoder, startBlock, endBlock, stopReason FROM jobs WHERE id = ?") - if err != nil { - glog.Error("Unable to prepare getjob stmt ", err) - d.Close() - return nil, err - } - d.getJob = stmt - - // set reason for stopping a job - stmt, err = db.Prepare("UPDATE jobs SET stopReason=?, stoppedAt=datetime() WHERE id=?") - if err != nil { - glog.Error("Unable to prepare stop reason statement ", err) - d.Close() - return nil, err - } - d.stopReason = stmt - - // Insert receipt prepared statement - stmt, err = db.Prepare("INSERT INTO receipts(jobID, seqNo, bcastFile, bcastHash, bcastSig, transcodedHash, transcodeStartedAt, transcodeEndedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?)") - if err != nil { - glog.Error("Unable to prepare insert segment ", err) - d.Close() - return nil, err - } - d.insertRec = stmt - - // Check if receipt with the given seqno exists - stmt, err = db.Prepare("SELECT 1 FROM receipts WHERE jobID=? AND seqNo=?") - if err != nil { - glog.Error("Unable to prepare segment exists statement") - d.Close() - return nil, err - } - d.checkRec = stmt - - // Recover receipt prepared statement - stmt, err = db.Prepare("SELECT jobID, seqNo, bcastFile, bcastHash, bcastSig, transcodedHash FROM receipts WHERE claimID IS NULL and errorMsg IS NULL") - if err != nil { - glog.Error("Unable to prepare unclaimed receipts", err) - d.Close() - return nil, err - } - d.unclaimedReceipts = stmt - - // Receipts by claim for removing old segments - stmt, err = db.Prepare("SELECT bcastFile FROM receipts WHERE claimID = ? AND jobID = ?") - if err != nil { - glog.Error("Unable to prepare receipts by claim ", err) - d.Close() - return nil, err - } - d.receiptsByClaim = stmt - - // Claim related prepared statements - stmt, err = db.Prepare("INSERT INTO claims(id, jobID, claimRoot) VALUES(?, ?, ?)") - if err != nil { - glog.Error("Unable to prepare insert claims ", err) - d.Close() - return nil, err - } - d.insertClaim = stmt - stmt, err = db.Prepare("SELECT count(*) FROM claims WHERE jobID=?") - if err != nil { - glog.Error("Unable to prepare claim count ", err) - d.Close() - return nil, err - } - d.countClaims = stmt - stmt, err = db.Prepare("UPDATE receipts SET claimID = ? WHERE jobID = ? AND seqNo BETWEEN ? AND ?") - if err != nil { - glog.Error("Unable to prepare setclaimid ", err) - d.Close() - return nil, err - } - d.setReceiptClaim = stmt - - stmt, err = db.Prepare("UPDATE claims SET status=?, updatedAt=datetime() WHERE jobID=? AND id=?") - if err != nil { - glog.Error("Unable to prepare setclaimstatus ", err) - d.Close() - return nil, err - } - d.setClaimStatus = stmt - - // Broadcast related - stmt, err = db.Prepare("INSERT INTO broadcasts(id, streamID, segmentPrice, transcodeOptions, broadcaster, transcoder, startBlock, endBlock) VALUES(?, ?, ?, ?, ?, ?, ?, ?)") - if err != nil { - glog.Error("Unable to prepare broadcast insertion ", err) - d.Close() - return nil, err - } - d.insertBcast = stmt - - // select all broadcasts since - stmt, err = db.Prepare("SELECT id, streamID, segmentPrice, segmentCount, transcodeOptions, broadcaster, transcoder, startBlock, endBlock FROM broadcasts WHERE endBlock > ? AND stopReason IS NULL") - if err != nil { - glog.Error("Unable to prepare selectbroadcast stmt ", err) - d.Close() - return nil, err - } - d.selectBcasts = stmt - - // update segment count - stmt, err = db.Prepare("UPDATE broadcasts SET segmentCount = ? WHERE id = ?") - if err != nil { - glog.Error("Unable to prepare set segment count ", err) - d.Close() - return nil, err - } - d.setSegmentCount = stmt - // Unbonding locks prepared statements stmt, err = db.Prepare("INSERT INTO unbondingLocks(id, delegator, amount, withdrawRound) VALUES(?, ?, ?, ?)") if err != nil { @@ -406,48 +147,6 @@ func (db *DB) Close() { if db.updateKV != nil { db.updateKV.Close() } - if db.insertJob != nil { - db.insertJob.Close() - } - if db.selectJobs != nil { - db.selectJobs.Close() - } - if db.getJob != nil { - db.getJob.Close() - } - if db.stopReason != nil { - db.stopReason.Close() - } - if db.insertRec != nil { - db.insertRec.Close() - } - if db.checkRec != nil { - db.checkRec.Close() - } - if db.unclaimedReceipts != nil { - db.unclaimedReceipts.Close() - } - if db.receiptsByClaim != nil { - db.receiptsByClaim.Close() - } - if db.insertClaim != nil { - db.insertClaim.Close() - } - if db.setReceiptClaim != nil { - db.setReceiptClaim.Close() - } - if db.setClaimStatus != nil { - db.setClaimStatus.Close() - } - if db.insertBcast != nil { - db.insertBcast.Close() - } - if db.selectBcasts != nil { - db.selectBcasts.Close() - } - if db.setSegmentCount != nil { - db.setSegmentCount.Close() - } if db.insertUnbondingLock != nil { db.insertUnbondingLock.Close() } @@ -494,302 +193,6 @@ func (db *DB) LastSeenBlock() (*big.Int, error) { return big.NewInt(lastSeenBlock), nil } -func (db *DB) InsertJob(job *DBJob) error { - if db == nil { - return nil - } - options := ethcommon.ToHex(ProfilesToTranscodeOpts(job.profiles))[2:] - glog.V(DEBUG).Info("db: Inserting job ", job.ID) - _, err := db.insertJob.Exec(job.ID, job.streamID, job.price, options, - job.broadcaster.String(), job.Transcoder.String(), - job.startBlock, job.endBlock) - if err != nil { - glog.Error("db: Unable to insert job ", err) - } - return err -} - -func (db *DB) ActiveJobs(since *big.Int) ([]*DBJob, error) { - if db == nil { - return []*DBJob{}, nil - } - glog.V(DEBUG).Info("db: Querying active jobs since ", since) - rows, err := db.selectJobs.Query(since.Int64()) - if err != nil { - glog.Error("db: Unable to select jobs ", err) - return nil, err - } - defer rows.Close() - jobs := []*DBJob{} - for rows.Next() { - var job DBJob - var transcoder string - var broadcaster string - var options string - if err := rows.Scan(&job.ID, &job.streamID, &job.price, &options, &broadcaster, &transcoder, &job.startBlock, &job.endBlock); err != nil { - glog.Error("db: Unable to fetch job ", err) - continue - } - profiles, err := TxDataToVideoProfile(options) - if err != nil { - glog.Error("Unable to convert transcode options into ffmpeg profile ", err) - } - job.Transcoder = ethcommon.HexToAddress(transcoder) - job.broadcaster = ethcommon.HexToAddress(broadcaster) - job.profiles = profiles - jobs = append(jobs, &job) - } - return jobs, nil -} - -func (db *DB) GetJob(id int64) (*DBJob, error) { - if db == nil { - return nil, nil - } - glog.V(DEBUG).Info("db: Getting job for ", id) - var job DBJob - var transcoder string - var broadcaster string - var options string - if err := db.getJob.QueryRow(id).Scan(&job.ID, &job.streamID, &job.price, - &options, &broadcaster, &transcoder, &job.startBlock, &job.endBlock, &job.StopReason); err != nil { - // nonexistent job; this case will be fairly common - // don't need to print an error here - return nil, err - } - profiles, err := TxDataToVideoProfile(options) - if err != nil { - return nil, err - } - job.Transcoder = ethcommon.HexToAddress(transcoder) - job.broadcaster = ethcommon.HexToAddress(broadcaster) - job.profiles = profiles - - // The claim count is an approximation!! - // The count will be incorrect if a claim for this job was ever - // submitted outside this node - if err := db.countClaims.QueryRow(&id).Scan(&job.Claims); err != nil { - glog.Error("Unable to retrieve claim count for job ", id, err) - } - - return &job, nil -} - -func (db *DB) SetStopReason(id *big.Int, reason string) error { - if db == nil { - return nil - } - glog.V(DEBUG).Infof("db: Setting StopReason for job %v to %v", id, reason) - _, err := db.stopReason.Exec(reason, id.Int64()) - if err != nil { - glog.Error("db: Error setting stop reason ", id, err) - return err - } - return nil -} - -func (db *DB) ReceiptExists(jobID *big.Int, seqNo uint64) (bool, error) { - if db == nil { - return false, nil - } - glog.V(DEBUG).Infof("db: Checking receipt %v for job %v", seqNo, jobID) - var res int - err := db.checkRec.QueryRow(jobID.Int64(), seqNo).Scan(&res) - if err != nil && err == sql.ErrNoRows { - return false, nil - } - if err != nil { - glog.Error("Could not check receipt existence ", err) - return false, err - } - return true, nil -} - -func (db *DB) InsertReceipt(jobID *big.Int, seqNo int64, - bcastFile string, bcastHash []byte, bcastSig []byte, tcodeHash []byte, - tcodeStartedAt time.Time, tcodeEndedAt time.Time) error { - if db == nil { - return nil - } - glog.V(DEBUG).Infof("db: Inserting receipt for job %v - %v", jobID.String(), seqNo) - time2str := func(t time.Time) string { - return t.UTC().Format("2006-01-02 15:04:05.000") - } - _, err := db.insertRec.Exec(jobID.Int64(), seqNo, bcastFile, - ethcommon.ToHex(bcastHash), ethcommon.ToHex(bcastSig), - ethcommon.ToHex(tcodeHash), - time2str(tcodeStartedAt), time2str(tcodeEndedAt)) - if err != nil { - glog.Error("db: Error inserting segment ", jobID, err) - return err - } - return nil -} -func (db *DB) UnclaimedReceipts() (map[int64][]*DBReceipt, error) { - receipts := make(map[int64][]*DBReceipt) - glog.V(DEBUG).Info("db: Querying unclaimed receipts") - rows, err := db.unclaimedReceipts.Query() - defer rows.Close() - if err != nil { - glog.Error("db: Unable to select receipts ", err) - return receipts, err - } - for rows.Next() { - var r DBReceipt - var bh string - var bs string - var th string - if err := rows.Scan(&r.JobID, &r.SeqNo, &r.BcastFile, &bh, &bs, &th); err != nil { - glog.Error("db: Unable to fetch receipt ", err) - continue - } - r.BcastHash = ethcommon.FromHex(bh) - r.BcastSig = ethcommon.FromHex(bs) - r.TcodeHash = ethcommon.FromHex(th) - receipts[r.JobID] = append(receipts[r.JobID], &r) - } - return receipts, nil -} - -func (db *DB) ReceiptBCastFilesByClaim(claimID int64, jobID *big.Int) ([]string, error) { - glog.V(DEBUG).Info("db: Querying receipts by claim") - receipts := []string{} - rows, err := db.receiptsByClaim.Query(claimID, jobID.Int64()) - defer rows.Close() - if err != nil { - glog.Error("db: Unable to select receipts ", err) - return receipts, err - } - for rows.Next() { - var f string - if err := rows.Scan(&f); err != nil { - glog.Error("db: Unable to fetch receipt ", err) - continue - } - receipts = append(receipts, f) - } - return receipts, nil -} - -func (db *DB) InsertClaim(jobID *big.Int, segRange [2]int64, - root [32]byte) (*int64, error) { - glog.V(DEBUG).Infof("Inserting claim for job %v", jobID) - tx, err := db.dbh.Begin() - if err != nil { - glog.Error("Unable to begin tx ", err) - return nil, err - } - var claimID int64 - insert := tx.Stmt(db.insertClaim) - count := tx.Stmt(db.countClaims) - update := tx.Stmt(db.setReceiptClaim) - row := count.QueryRow(jobID.Int64()) - err = row.Scan(&claimID) - if err != nil { - glog.Error("Unable to count claims ", err) - tx.Rollback() - return nil, err - } - glog.V(DEBUG).Infof("Guessed claim ID to be %v for job %v", claimID, jobID) - _, err = insert.Exec(claimID, jobID.Int64(), ethcommon.ToHex(root[:])) - if err != nil { - glog.Error("Unable to insert claim ", err) - tx.Rollback() - return nil, err - } - _, err = update.Exec(claimID, jobID.Int64(), segRange[0], segRange[1]) - if err != nil { - glog.Error("Unable to update segments with claims ", err) - tx.Rollback() - return nil, err - } - err = tx.Commit() - if err != nil { - glog.Error("Unable to commit tx ", err) - tx.Rollback() - return nil, err - } - return &claimID, nil -} - -func (db *DB) CountClaims(jobID *big.Int) (int64, error) { - var count int64 - if err := db.countClaims.QueryRow(jobID.Int64()).Scan(&count); err != nil { - // no claims - return 0, err - } - return count, nil -} - -func (db *DB) SetClaimStatus(jobID *big.Int, id int64, status string) error { - glog.V(DEBUG).Infof("db: Setting ClaimStatus for job %v claim %v to %v", jobID, id, status) - _, err := db.setClaimStatus.Exec(status, jobID.Int64(), id) - if err != nil { - glog.Error("db: Error setting claim status ", id, err) - return err - } - return nil -} - -func (db *DB) InsertBroadcast(job *lpTypes.Job) error { - if db == nil { - return nil - } - options := ethcommon.ToHex(ProfilesToTranscodeOpts(job.Profiles))[2:] - glog.V(DEBUG).Info("db: Inserting broadcast ", job.JobId) - _, err := db.insertBcast.Exec(job.JobId.Int64(), job.StreamId, - job.MaxPricePerSegment.Int64(), options, - job.BroadcasterAddress.String(), job.TranscoderAddress.String(), - job.CreationBlock.Int64(), job.EndBlock.Int64()) - if err != nil { - glog.Error("db: Unable to insert job ", err) - } - return err -} - -func (db *DB) ActiveBroadcasts(since *big.Int) ([]*DBJob, error) { - if db == nil { - return []*DBJob{}, nil - } - glog.V(DEBUG).Info("db: Querying active broadcasts since ", since) - rows, err := db.selectBcasts.Query(since.Int64()) - if err != nil { - glog.Error("db: Unable to select jobs ", err) - return nil, err - } - defer rows.Close() - jobs := []*DBJob{} - for rows.Next() { - var job DBJob - var transcoder string - var broadcaster string - var options string - if err := rows.Scan(&job.ID, &job.streamID, &job.price, &job.Segments, &options, &broadcaster, &transcoder, &job.startBlock, &job.endBlock); err != nil { - glog.Error("db: Unable to fetch job ", err) - continue - } - profiles, err := TxDataToVideoProfile(options) - if err != nil { - glog.Error("Unable to convert transcode options into ffmpeg profile ", err) - } - job.Transcoder = ethcommon.HexToAddress(transcoder) - job.broadcaster = ethcommon.HexToAddress(broadcaster) - job.profiles = profiles - jobs = append(jobs, &job) - } - return jobs, nil -} - -func (db *DB) SetSegmentCount(jobID string, count int64) error { - glog.V(DEBUG).Infof("db: Setting segment count for job %v to %v", jobID, count) - _, err := db.setSegmentCount.Exec(count, jobID) - if err != nil { - glog.Errorf("db: Error setting segment count to %v for job %v: %vo status ", count, jobID, err) - return err - } - return nil -} - func (db *DB) InsertUnbondingLock(id *big.Int, delegator ethcommon.Address, amount, withdrawRound *big.Int) error { glog.V(DEBUG).Infof("db: Inserting unbonding lock %v for delegator %v", id, delegator.Hex()) _, err := db.insertUnbondingLock.Exec(id.Int64(), delegator.Hex(), amount.String(), withdrawRound.Int64()) diff --git a/common/db_test.go b/common/db_test.go index 800921418..95cdff6c5 100644 --- a/common/db_test.go +++ b/common/db_test.go @@ -1,11 +1,9 @@ package common import ( - "database/sql" "fmt" "math/big" "testing" - "time" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/livepeer/lpms/ffmpeg" @@ -103,18 +101,6 @@ func TestDBVersion(t *testing.T) { } } -func NewStubJob() *DBJob { - return &DBJob{ - ID: 0, streamID: "1", price: 0, - profiles: []ffmpeg.VideoProfile{ - ffmpeg.P720p60fps16x9, - ffmpeg.P360p30fps4x3, - ffmpeg.P144p30fps16x9, - }, broadcaster: ethcommon.Address{}, Transcoder: ethcommon.Address{}, - startBlock: 1, endBlock: 2, - } -} - func profilesMatch(j1 []ffmpeg.VideoProfile, j2 []ffmpeg.VideoProfile) bool { if len(j1) != len(j2) { return false @@ -127,292 +113,6 @@ func profilesMatch(j1 []ffmpeg.VideoProfile, j2 []ffmpeg.VideoProfile) bool { return true } -func TestDBJobs(t *testing.T) { - dbh, dbraw, err := TempDB(t) - defer dbh.Close() - defer dbraw.Close() - j := NewStubJob() - dbh.InsertJob(j) - j.ID = 1 - dbh.InsertJob(j) - endBlock := j.endBlock - j.ID = 2 - j.endBlock += 5 - dbh.InsertJob(j) - jobs, err := dbh.ActiveJobs(big.NewInt(0)) - if err != nil || len(jobs) != 3 { - t.Error("Unexpected error in active jobs ", err, len(jobs)) - return - } - jobs, err = dbh.ActiveJobs(big.NewInt(endBlock)) - if err != nil || len(jobs) != 1 || jobs[0].ID != 2 { - t.Error("Unexpected error in active jobs ", err, len(jobs)) - return - } - if !profilesMatch(jobs[0].profiles, j.profiles) { - t.Error("Mismatched profiles in query") - } - // check stop reason filter - dbh.SetStopReason(big.NewInt(j.ID), "insufficient lolz") - jobs, err = dbh.ActiveJobs(big.NewInt(0)) - if err != nil || len(jobs) != 2 { - t.Error("Unexpected error in active jobs ", err, len(jobs)) - } - - // test getting a job - dbjob, err := dbh.GetJob(j.ID) - if err != nil { - t.Error("Unexpected error when fetching job ", err) - } - if dbjob.ID != j.ID || dbjob.StopReason.String != "insufficient lolz" || - !profilesMatch(dbjob.profiles, j.profiles) || - dbjob.Transcoder != j.Transcoder || - dbjob.broadcaster != j.broadcaster || - dbjob.startBlock != j.startBlock || dbjob.endBlock != j.endBlock { - t.Error("Job mismatch ") - } - // should be a nonexistent job - dbjob, err = dbh.GetJob(100) - if err != sql.ErrNoRows { - t.Error("Missing error or unexpected error", err) - } - // job with a null stop reason - dbjob, err = dbh.GetJob(1) - if err != nil { - t.Error("Unexpected error ", err) - } - if dbjob.StopReason.Valid { - t.Error("Unexpected stop reason ", dbjob.StopReason.String) - } - - // should have an invalid profile - dbraw.Exec("UPDATE jobs SET transcodeOptions = 'invalid' WHERE id = 1") - _, err = dbh.GetJob(1) - if err != ErrProfile { - t.Error("Unexpected result from invalid profile ", err) - } -} - -func TestDBReceipts(t *testing.T) { - dbh, dbraw, err := TempDB(t) - defer dbh.Close() - defer dbraw.Close() - jid := big.NewInt(0) - ir := func(j *big.Int, seq int) error { - b := []byte("") - n := time.Now() - return dbh.InsertReceipt(j, int64(seq), "", b, b, b, n, n) - } - err = ir(jid, 1) - if err == nil { - t.Error("Expected foreign key constraint to fail; nonexistent job") - return - } - job := NewStubJob() - dbh.InsertJob(job) - err = ir(jid, 1) - if err != nil { - t.Error(err) - return - } - err = ir(jid, 1) - if err == nil { - t.Error("Expected constraint to fail; duplicate seq id") - return - } - err = ir(jid, 2) - if err != nil { - t.Error(err) - return - } - // insert receipt for a different job, but same seqid - job = NewStubJob() - job.ID = 1 - dbh.InsertJob(job) - err = ir(big.NewInt(job.ID), 1) - if err != nil { - t.Error(err) - return - } - // check unclaimed receipts - receipts, err := dbh.UnclaimedReceipts() - if err != nil { - t.Error(err) - return - } - if len(receipts) != 2 { - t.Error("Unxpected number of jobs in receipts") - return - } - if len(receipts[0]) != 2 || len(receipts[1]) != 1 { - t.Error("Unexpected number of receipts for job") - return - } - - // Receipt checking functions. - - // Ensure that the receipt we just inserted exists - exists, err := dbh.ReceiptExists(big.NewInt(job.ID), 1) - if err != nil { - t.Error(err) - return - } - if !exists { - t.Error("Expected segment to exist in DB") - return - } - // Ensure a nonexistent receipt does not exist: valid job, invalid seg - exists, err = dbh.ReceiptExists(big.NewInt(job.ID), 10) - if err != nil { - t.Error(err) - return - } - if exists { - t.Error("Did not expect a segment to exist") - return - } - // Ensure a nonexistent receipt does not exist: invalid job, seg exists elsewhere - exists, err = dbh.ReceiptExists(big.NewInt(10), 1) - if err != nil { - t.Error(err) - return - } - if exists { - t.Error("Did not expect a segment to exist") - return - } -} - -func TestDBClaims(t *testing.T) { - dbh, dbraw, err := TempDB(t) - defer dbh.Close() - defer dbraw.Close() - - ir := func(j int64, seq int) error { - b := []byte("") - n := time.Now() - return dbh.InsertReceipt(big.NewInt(j), int64(seq), "", b, b, b, n, n) - } - - job := NewStubJob() - dbh.InsertJob(job) - ir(job.ID, 0) - ir(job.ID, 1) - ir(job.ID, 4) - ir(job.ID, 5) - job.ID++ - dbh.InsertJob(job) - ir(job.ID, 1) - ir(job.ID, 2) - - cidp, err := dbh.InsertClaim(big.NewInt(0), [2]int64{0, 1}, [32]byte{}) - if err != nil || cidp == nil { - t.Errorf("Error inserting claim %v %v", err, cidp) - return - } - cidp, err = dbh.InsertClaim(big.NewInt(0), [2]int64{4, 5}, [32]byte{}) - if err != nil || cidp == nil { - t.Errorf("Error inserting claim %v %v", err, cidp) - return - } - cidp, err = dbh.InsertClaim(big.NewInt(1), [2]int64{1, 2}, [32]byte{}) - if err != nil || cidp == nil { - t.Errorf("Error inserting claim %v %v", err, cidp) - return - } - // check job 0 claim 0 - var nbreceipts int - row := dbraw.QueryRow("SELECT count(*) FROM receipts WHERE claimID = 0 AND jobID = 0") - err = row.Scan(&nbreceipts) - if err != nil { - t.Error(err) - return - } - if nbreceipts != 2 { - t.Errorf("Mismatched receipts for claim: expected 2 got %d", nbreceipts) - return - } - // check job 0 claim 1 - row = dbraw.QueryRow("SELECT count(*) FROM receipts WHERE claimID = 1 AND jobID = 0") - err = row.Scan(&nbreceipts) - if err != nil { - t.Error(err) - return - } - if nbreceipts != 2 { - t.Errorf("Mismatched receipts for claim: expected 2 got %d", nbreceipts) - return - } - // check job 1 claim 0 - row = dbraw.QueryRow("SELECT count(*) FROM receipts WHERE claimID = 0 AND jobID = 1") - err = row.Scan(&nbreceipts) - if err != nil { - t.Error(err) - return - } - if nbreceipts != 2 { - t.Errorf("Mismatched receipts for claim: expected 2 got %d", nbreceipts) - return - } - // Sanity check number of claims - var nbclaims int64 - row = dbraw.QueryRow("SELECT count(*) FROM claims") - err = row.Scan(&nbclaims) - if err != nil { - t.Error(err) - return - } - if nbclaims != 3 { - t.Error("Unexpected number of claims; expected 3 total, got ", nbclaims) - return - } - // check claim status - var status string - q := "SELECT status FROM claims WHERE jobID = 0 AND id = 1" - s := "over the moon" - row = dbraw.QueryRow(q) - err = row.Scan(&status) - if err != nil { - t.Error(err) - return - } - // sanity check value - if status == s { - t.Error("Expected some status value other than ", status) - return - } - err = dbh.SetClaimStatus(big.NewInt(0), 1, s) - if err != nil { - t.Error(err) - return - } - row = dbraw.QueryRow(q) - err = row.Scan(&status) - if err != nil || status != s { - t.Errorf("Unexpected: error %v, got %v but wanted %v", err, status, s) - return - } - - // Check count claims for a given job - nbclaims, err = dbh.CountClaims(big.NewInt(0)) - if err != nil || nbclaims != 2 { - t.Errorf("Unexpected number of claims; expected 2 got %v; error %v", nbclaims, err) - return - } - // Check count claims for a nonexistent job - nbclaims, err = dbh.CountClaims(big.NewInt(-1)) - if err != nil || nbclaims != 0 { - t.Errorf("Unexpected number of claims; expected 0 got %v; error %v", nbclaims, err) - } - // Check count claims for a job with no claims - job.ID++ - dbh.InsertJob(job) - nbclaims, err = dbh.CountClaims(big.NewInt(job.ID)) - if err != nil || nbclaims != 0 { - t.Errorf("Unexpected number of claims; expected 0 got %v; error %v", nbclaims, err) - } -} - func TestDBUnbondingLocks(t *testing.T) { dbh, dbraw, err := TempDB(t) defer dbh.Close() diff --git a/core/livepeernode.go b/core/livepeernode.go index f74d2685b..a83ea93ae 100644 --- a/core/livepeernode.go +++ b/core/livepeernode.go @@ -50,7 +50,6 @@ type LivepeerNode struct { Database *common.DB // Transcoder public fields - ClaimManagers map[int64]eth.ClaimManager SegmentChans map[ManifestID]SegmentChan OrchestratorPool net.OrchestratorPool Ipfs ipfs.IpfsApi @@ -59,7 +58,6 @@ type LivepeerNode struct { Transcoder Transcoder // Transcoder private fields - claimMutex *sync.Mutex segmentMutex *sync.Mutex tcoderMutex *sync.RWMutex taskMutex *sync.RWMutex @@ -71,17 +69,15 @@ type LivepeerNode struct { func NewLivepeerNode(e eth.LivepeerEthClient, wd string, dbh *common.DB) (*LivepeerNode, error) { rand.Seed(time.Now().UnixNano()) return &LivepeerNode{ - Eth: e, - WorkDir: wd, - Database: dbh, - EthServices: make(map[string]eth.EventService), - ClaimManagers: make(map[int64]eth.ClaimManager), - SegmentChans: make(map[ManifestID]SegmentChan), - claimMutex: &sync.Mutex{}, - segmentMutex: &sync.Mutex{}, - tcoderMutex: &sync.RWMutex{}, - taskMutex: &sync.RWMutex{}, - taskChans: make(map[int64]TranscoderChan), + Eth: e, + WorkDir: wd, + Database: dbh, + EthServices: make(map[string]eth.EventService), + SegmentChans: make(map[ManifestID]SegmentChan), + segmentMutex: &sync.Mutex{}, + tcoderMutex: &sync.RWMutex{}, + taskMutex: &sync.RWMutex{}, + taskChans: make(map[int64]TranscoderChan), }, nil } diff --git a/core/orchestrator.go b/core/orchestrator.go index 20ad95a81..f43ac4c86 100644 --- a/core/orchestrator.go +++ b/core/orchestrator.go @@ -18,7 +18,6 @@ import ( "github.com/livepeer/go-livepeer/common" "github.com/livepeer/go-livepeer/drivers" "github.com/livepeer/go-livepeer/eth" - ethTypes "github.com/livepeer/go-livepeer/eth/types" "github.com/livepeer/go-livepeer/monitor" "github.com/livepeer/go-livepeer/net" @@ -329,28 +328,6 @@ func (n *LivepeerNode) transcodeSegmentLoop(md *SegTranscodingMetadata, segChan return nil } -func (n *LivepeerNode) GetClaimManager(job *ethTypes.Job) (eth.ClaimManager, error) { - n.claimMutex.Lock() - defer n.claimMutex.Unlock() - if job == nil { - glog.Error("Nil job") - return nil, fmt.Errorf("Nil job") - } - jobId := job.JobId.Int64() - // XXX we should clear entries after some period of inactivity - if cm, ok := n.ClaimManagers[jobId]; ok { - return cm, nil - } - // no claimmanager exists yet; check if we're assigned the job - if n.Eth == nil { - return nil, nil - } - glog.Infof("Creating new claim manager for job %v", jobId) - cm := eth.NewBasicClaimManager(job, n.Eth, n.Ipfs, n.Database) - n.ClaimManagers[jobId] = cm - return cm, nil -} - func (n *LivepeerNode) serveTranscoder(stream net.Transcoder_RegisterTranscoderServer) { transcoder := NewRemoteTranscoder(n, stream) diff --git a/eth/claimmanager.go b/eth/claimmanager.go deleted file mode 100644 index 31e58e24c..000000000 --- a/eth/claimmanager.go +++ /dev/null @@ -1,539 +0,0 @@ -package eth - -import ( - "context" - "fmt" - "math/big" - "os" - "sort" - "sync" - "time" - - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/golang/glog" - "github.com/livepeer/go-livepeer/common" - ethTypes "github.com/livepeer/go-livepeer/eth/types" - "github.com/livepeer/go-livepeer/ipfs" - ffmpeg "github.com/livepeer/lpms/ffmpeg" -) - -var ( - RpcTimeout = 10 * time.Second -) - -type ClaimManager interface { - AddReceipt(seqNo int64, bDataFile string, bData []byte, bSig []byte, tData map[ffmpeg.VideoProfile][]byte, tStart time.Time, tEnd time.Time) ([]byte, error) - SufficientBroadcasterDeposit() (bool, error) - ClaimVerifyAndDistributeFees() error - CanClaim(*big.Int, *ethTypes.Job) (bool, error) - BroadcasterAddr() ethcommon.Address -} - -type claimData struct { - seqNo int64 - bFile string - dataHash []byte - bSig []byte - claimConcatTDatahash []byte - transcodeProof []byte -} - -//BasicClaimManager manages the claim process for a Livepeer transcoder. Check the Livepeer protocol for more details. -type BasicClaimManager struct { - client LivepeerEthClient - db *common.DB - ipfs ipfs.IpfsApi - - strmID string - jobID *big.Int - profiles []ffmpeg.VideoProfile - pLookup map[ffmpeg.VideoProfile]int - - segClaimMap map[int64]*claimData - unclaimedSegs map[int64]bool - cost *big.Int - - broadcasterAddr ethcommon.Address - pricePerSegment *big.Int - totalSegCost *big.Int - - claims int64 - claimsLock sync.Mutex -} - -//NewBasicClaimManager creates a new claim manager. -func NewBasicClaimManager(job *ethTypes.Job, c LivepeerEthClient, ipfs ipfs.IpfsApi, db *common.DB) *BasicClaimManager { - p := job.Profiles - seqNos := make([][]int64, len(p), len(p)) - rHashes := make([][]ethcommon.Hash, len(p), len(p)) - sd := make([][][]byte, len(p), len(p)) - dHashes := make([][]string, len(p), len(p)) - tHashes := make([][]string, len(p), len(p)) - sigs := make([][][]byte, len(p), len(p)) - pLookup := make(map[ffmpeg.VideoProfile]int) - - sort.Sort(ffmpeg.ByName(p)) - for i := 0; i < len(p); i++ { - sNo := make([]int64, 0) - seqNos[i] = sNo - rh := make([]ethcommon.Hash, 0) - rHashes[i] = rh - d := make([][]byte, 0) - sd[i] = d - dh := make([]string, 0) - dHashes[i] = dh - th := make([]string, 0) - tHashes[i] = th - s := make([][]byte, 0) - sigs[i] = s - pLookup[p[i]] = i - } - - return &BasicClaimManager{ - client: c, - db: db, - ipfs: ipfs, - strmID: job.StreamId, - jobID: job.JobId, - cost: big.NewInt(0), - totalSegCost: new(big.Int).Mul(job.MaxPricePerSegment, big.NewInt(int64(len(p)))), - broadcasterAddr: job.BroadcasterAddress, - pricePerSegment: job.MaxPricePerSegment, - profiles: p, - pLookup: pLookup, - segClaimMap: make(map[int64]*claimData), - unclaimedSegs: make(map[int64]bool), - claims: job.TotalClaims.Int64(), - } -} - -func RecoverClaims(c LivepeerEthClient, ipfs ipfs.IpfsApi, db *common.DB) error { - // XXX While this will recover claims for jobs that haven't submitted a - // claim yet, it doesn't attempt to recover if the node restarts mid-process - // eg, between the claim, verify and distributeFees calls. - glog.V(common.DEBUG).Info("Initialized DB node") - jobReceipts, err := db.UnclaimedReceipts() - if err != nil { - return err - } - for jid, receipts := range jobReceipts { - glog.V(common.DEBUG).Info("claimmanager: Fetching claims for job ", jid) - dbj, err := db.GetJob(jid) - if err != nil { - glog.Error("Unable to get job ", jid, err) - continue - } - j := common.DBJobToEthJob(dbj) - - cm := NewBasicClaimManager(j, c, ipfs, db) - for _, r := range receipts { - cm.unclaimedSegs[r.SeqNo] = true - cm.segClaimMap[r.SeqNo] = &claimData{ - seqNo: r.SeqNo, - bFile: r.BcastFile, - dataHash: r.BcastHash, - bSig: r.BcastSig, - claimConcatTDatahash: r.TcodeHash, - } - } - - lastSeenBlock, err := db.LastSeenBlock() - if err != nil { - glog.Error("Unable to get last seen block ", err) - continue - } - - canClaim, err := cm.CanClaim(lastSeenBlock, j) - if err != nil { - glog.Error("Unable to check if the transcoder can claim ", err) - continue - } - - if canClaim { - go func() { - glog.V(common.DEBUG).Info("claimmanager: Starting recovery for ", jid) - err := cm.ClaimVerifyAndDistributeFees() - if err != nil { - glog.Error("Unable to claim/verify/distribute: ", err) - } - }() - } - } - return nil -} - -func (c *BasicClaimManager) BroadcasterAddr() ethcommon.Address { - return c.broadcasterAddr -} - -func (c *BasicClaimManager) CanClaim(currentBlockNum *big.Int, job *ethTypes.Job) (bool, error) { - // A transcoder can claim if there are unclaimed segments - if len(c.unclaimedSegs) == 0 { - return false, nil - } - - // A transcoder can claim if the first claim for the job has been submitted or we are within the 256 blocks of the job creation block - if job.FirstClaimSubmitted || currentBlockNum.Cmp(new(big.Int).Add(job.CreationBlock, big.NewInt(256))) <= 0 { - return true, nil - } else { - return false, nil - } -} - -//AddReceipt adds a claim for a given video segment. -func (c *BasicClaimManager) AddReceipt(seqNo int64, - bDataFile string, bData []byte, bSig []byte, - tData map[ffmpeg.VideoProfile][]byte, tStart time.Time, tEnd time.Time) ([]byte, error) { - - _, ok := c.segClaimMap[seqNo] - if ok { - return []byte{}, fmt.Errorf("Receipt for %v:%v already exists", c.jobID.String(), seqNo) - } - - // ensure that all our profiles match up: check that lengths match - if len(c.pLookup) != len(tData) { - return []byte{}, fmt.Errorf("Job %v Mismatched profiles in segment; not claiming", c.jobID) - // XXX record error in db - } - - // ensure profiles match up, part 2: check for unknown profiles in the list - hashes := make([][]byte, len(tData)) - for profile, td := range tData { - i, ok := c.pLookup[profile] - if !ok { - return []byte{}, fmt.Errorf("Job %v cannot find profile: %v", c.jobID, profile) - // XXX record error in db - } - hashes[i] = crypto.Keccak256(td) // set index based on profile ordering - } - tHash := crypto.Keccak256(hashes...) - bHash := crypto.Keccak256(bData) - - cd := &claimData{ - seqNo: seqNo, - bFile: bDataFile, - dataHash: bHash, - bSig: bSig, - claimConcatTDatahash: tHash, - } - - if err := c.db.InsertReceipt(c.jobID, seqNo, bDataFile, bHash, bSig, tHash, tStart, tEnd); err != nil { - return []byte{}, err - } - - c.cost = new(big.Int).Add(c.cost, c.totalSegCost) - c.segClaimMap[seqNo] = cd - c.unclaimedSegs[seqNo] = true - // glog.Infof("Added %v. unclaimSegs: %v", seqNo, c.unclaimedSegs) - - return tHash, nil -} - -func (c *BasicClaimManager) SufficientBroadcasterDeposit() (bool, error) { - bDeposit, err := c.client.BroadcasterDeposit(c.broadcasterAddr) - if err != nil { - glog.Errorf("Error getting broadcaster deposit: %v", err) - return false, err - } - - //If broadcaster does not have enough for a segment, return false - //If broadcaster has enough for at least one transcoded segment, return true - currDeposit := new(big.Int).Sub(bDeposit, c.cost) - if new(big.Int).Sub(currDeposit, new(big.Int).Mul(big.NewInt(int64(len(c.profiles))), c.pricePerSegment)).Cmp(big.NewInt(0)) == -1 { - return false, nil - } else { - return true, nil - } -} - -type SortUint64 []int64 - -func (a SortUint64) Len() int { return len(a) } -func (a SortUint64) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a SortUint64) Less(i, j int) bool { return a[i] < a[j] } - -func (c *BasicClaimManager) makeRanges() [][2]int64 { - //Get seqNos, sort them - keys := []int64{} - for key := range c.unclaimedSegs { - keys = append(keys, key) - } - sort.Sort(SortUint64(keys)) - - //Iterate through, check to make sure all tHashes are present (otherwise break and start new range), - ranges := make([][2]int64, 0) - if len(keys) <= 0 { - glog.V(common.DEBUG).Info("Could not make range; empty keys") - return ranges - } - start := keys[0] - for i, _ := range keys { - startNewRange := false - - //If the next key is not 1 more than the current key, it's not contiguous - start a new range - if startNewRange == false && (i+1 == len(keys) || keys[i+1] != keys[i]+1) { - ranges = append(ranges, [2]int64{start, keys[i]}) - startNewRange = true - } - - if startNewRange { - if i+1 != len(keys) { - start = keys[i+1] - } - } - } - return ranges -} - -func (c *BasicClaimManager) markClaimedSegs(segRange [2]int64) { - for segNo := segRange[0]; segNo <= segRange[1]; segNo++ { - delete(c.unclaimedSegs, segNo) - } -} - -func (c *BasicClaimManager) setClaimStatus(id int64, status string) { - if c.db != nil { - c.db.SetClaimStatus(c.jobID, id, status) - } -} - -//Claim creates the onchain claim for all the claims added through AddReceipt -func (c *BasicClaimManager) ClaimVerifyAndDistributeFees() error { - segs := make([]int64, 0) - for k, _ := range c.unclaimedSegs { - segs = append(segs, k) - } - ranges := c.makeRanges() - glog.V(common.SHORT).Infof("Job %v Claiming for segs: %v ranges: %v", c.jobID, segs, ranges) - - for _, segRange := range ranges { - //create concat hashes for each seg - receiptHashes := make([]ethcommon.Hash, segRange[1]-segRange[0]+1) - for i := segRange[0]; i <= segRange[1]; i++ { - seg, _ := c.segClaimMap[i] - - receipt := ðTypes.TranscodeReceipt{ - StreamID: c.strmID, - SegmentSequenceNumber: big.NewInt(seg.seqNo), - DataHash: seg.dataHash, - ConcatTranscodedDataHash: seg.claimConcatTDatahash, - BroadcasterSig: seg.bSig, - } - - receiptHashes[i-segRange[0]] = receipt.Hash() - } - - //create merkle root for concat hashes - root, proofs, err := ethTypes.NewMerkleTree(receiptHashes) - if err != nil { - glog.Errorf("Job %v Error: %v - creating merkle root for %v", c.jobID, err, receiptHashes) - continue - } - - // Preemptively guess at the claim ID and confirm after the tx succeeds. - // If the ID check fails, we likely had concurrent claims in-flight. - claimID := c.claims - if c.db != nil { - // check db in case we had any concurrent claims - claimIDp, err := c.db.InsertClaim(c.jobID, segRange, root.Hash) - if err != nil { - glog.Errorf("Job %v Error: %v - inserting claim into DB", c.jobID, err) - continue - } - claimID = *claimIDp - } - - bigRange := [2]*big.Int{big.NewInt(segRange[0]), big.NewInt(segRange[1])} - tx, err := c.client.ClaimWork(c.jobID, bigRange, root.Hash) - if err != nil { - glog.Errorf("Job %v Could not claim work - error %v", c.jobID, err) - c.setClaimStatus(claimID, "FAIL submit") - return err - } - - err = c.client.CheckTx(tx) - if err != nil { - glog.Errorf("Job %v tx failed %v", c.jobID, tx) - c.setClaimStatus(claimID, "FAIL check tx") - return err - } - - glog.V(common.SHORT).Infof("Job %v Submitted transcode claim for segments %v - %v", c.jobID, segRange[0], segRange[1]) - - c.markClaimedSegs(segRange) - c.claims = claimID + 1 - c.setClaimStatus(claimID, "Submitted") - - claim, err := c.client.GetClaim(c.jobID, big.NewInt(claimID)) - if err != nil || claim == nil { - glog.Errorf("Could not get claim %v: %v", claimID, err) - c.setClaimStatus(claimID, "FAIL get claim") - return err - } - - // Confirm claim ranges and root matches the estimated ID - if segRange[0] != claim.SegmentRange[0].Int64() || - segRange[1] != claim.SegmentRange[1].Int64() || - root.Hash != claim.ClaimRoot { - err = fmt.Errorf("Job %v claim %v does not match! Expected segments %v ; got %v, expected root %v got %v", c.jobID, claimID, segRange, claim.SegmentRange, root.Hash, claim.ClaimRoot) - glog.Error(err.Error()) - // XXX fix; maybe the user can manually retry the tx for now. - c.setClaimStatus(claimID, "FAIL id mismatch") - return err - } - - //Record proofs for each segment in case the segment needs to be verified - for i := segRange[0]; i <= segRange[1]; i++ { - seg, _ := c.segClaimMap[i] - seg.transcodeProof = proofs[i-segRange[0]].Bytes() - } - - //Do the claim - go func(segRange [2]int64, claim *ethTypes.Claim) { - b, err := c.client.Backend() - if err != nil { - glog.Error(err) - c.setClaimStatus(claimID, "FAIL Unable to get backend: "+err.Error()) - return - } - - // Wait one block for claimBlock + 1 to be mined - if err := Wait(c.db, big.NewInt(1)); err != nil { - c.setClaimStatus(claimID, "FAIL Waiting for post claim block "+err.Error()) - return - } - - plusOneBlk, err := b.BlockByNumber(context.Background(), new(big.Int).Add(claim.ClaimBlock, big.NewInt(1))) - if err != nil { - c.setClaimStatus(claimID, "FAIL Getting post claim block "+err.Error()) - return - } - - // Submit for verification if necessary - c.verify(claim.ClaimId, claim.ClaimBlock.Int64(), plusOneBlk.Hash(), segRange) - // Distribute fees once verification is complete - c.distributeFees(claimID) - }(segRange, claim) - } - - return nil -} - -func (c *BasicClaimManager) verify(claimID *big.Int, claimBlkNum int64, plusOneBlkHash ethcommon.Hash, segRange [2]int64) error { - //Get verification rate - verifyRate, err := c.client.VerificationRate() - if err != nil { - glog.Errorf("Job %v Error getting verification rate: %v", c.jobID, err) - return err - } - - //Iterate through segments, determine which one needs to be verified. - for segNo := segRange[0]; segNo <= segRange[1]; segNo++ { - if c.shouldVerifySegment(segNo, segRange[0], segRange[1], claimBlkNum, plusOneBlkHash, verifyRate) { - glog.V(common.SHORT).Infof("Job %v Segment %v challenged for verification", c.jobID, segNo) - - seg := c.segClaimMap[segNo] - - file, err := os.Open(seg.bFile) - if err != nil { - glog.Error("Could not open file for verification! ", err) - continue - } - defer file.Close() - dataStorageHash, err := c.ipfs.Add(file) - if err != nil { - glog.Errorf("Job %v Error uploading segment data to IPFS: %v", c.jobID, err) - continue - } - - dataHashes := [2][32]byte{ethcommon.BytesToHash(seg.dataHash), ethcommon.BytesToHash(seg.claimConcatTDatahash)} - - tx, err := c.client.Verify(c.jobID, claimID, big.NewInt(segNo), dataStorageHash, dataHashes, seg.bSig, seg.transcodeProof) - if err != nil { - glog.Errorf("Job %v Error submitting segment %v for verification: %v", c.jobID, segNo, err) - continue - } - - err = c.client.CheckTx(tx) - if err != nil { - glog.Errorf("Job %v Failed to verify segment %v: %v", c.jobID, segNo, err) - continue - } - - glog.V(common.SHORT).Infof("Job %v Verified segment %v", c.jobID, segNo) - } - } - - return nil -} - -func (c *BasicClaimManager) distributeFees(claimID int64) error { - verificationPeriod, err := c.client.VerificationPeriod() - if err != nil { - c.setClaimStatus(claimID, "FAIL Verification period "+err.Error()) - return err - } - - slashingPeriod, err := c.client.VerificationSlashingPeriod() - if err != nil { - c.setClaimStatus(claimID, "FAIL Slashing period "+err.Error()) - return err - } - - if err := Wait(c.db, new(big.Int).Add(verificationPeriod, slashingPeriod)); err != nil { - c.setClaimStatus(claimID, "FAIL Wait through verification and slashing period "+err.Error()) - return err - } - - tx, err := c.client.DistributeFees(c.jobID, big.NewInt(claimID)) - if err != nil { - c.setClaimStatus(claimID, "FAIL Submit distribute "+err.Error()) - return err - } - - err = c.client.CheckTx(tx) - if err != nil { - c.setClaimStatus(claimID, "FAIL Check distribute txn "+err.Error()) - return err - } - - glog.V(common.SHORT).Infof("Distributed fees for job %v claim %v", c.jobID, claimID) - - if c.db != nil { - // Clean up segments. - // Note that if claiming fails for any reason before this point, - // the segments will remain disk until cleaned up manually. - // This gives users an opportunity to fix up those claims later. - segfiles, err := c.db.ReceiptBCastFilesByClaim(claimID, c.jobID) - if err != nil { - glog.Error("Unable to get receipts filenames by claim ", err) - } else { - for _, f := range segfiles { - os.Remove(f) - } - } - } - c.setClaimStatus(claimID, "Complete") - - return nil -} - -func (c *BasicClaimManager) shouldVerifySegment(seqNum int64, start int64, end int64, blkNum int64, plusOneBlkHash ethcommon.Hash, verifyRate uint64) bool { - if seqNum < start || seqNum > end { - return false - } - - bigSeqNumBytes := ethcommon.LeftPadBytes(new(big.Int).SetInt64(seqNum).Bytes(), 32) - bigBlkNumBytes := ethcommon.LeftPadBytes(new(big.Int).SetInt64(blkNum+1).Bytes(), 32) - - combH := crypto.Keccak256(bigBlkNumBytes, plusOneBlkHash.Bytes(), bigSeqNumBytes) - hashNum := new(big.Int).SetBytes(combH) - result := new(big.Int).Mod(hashNum, new(big.Int).SetInt64(int64(verifyRate))) - - if result.Cmp(new(big.Int).SetInt64(int64(0))) == 0 { - return true - } else { - return false - } -} diff --git a/eth/claimmanager_test.go b/eth/claimmanager_test.go deleted file mode 100644 index a693ff146..000000000 --- a/eth/claimmanager_test.go +++ /dev/null @@ -1,487 +0,0 @@ -package eth - -import ( - "bytes" - "fmt" - "io/ioutil" - "math/big" - "os" - "testing" - "time" - - "github.com/ethereum/go-ethereum/crypto" - - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/golang/glog" - "github.com/livepeer/go-livepeer/common" - ethTypes "github.com/livepeer/go-livepeer/eth/types" - "github.com/livepeer/go-livepeer/ipfs" - ffmpeg "github.com/livepeer/lpms/ffmpeg" -) - -func newJob() *ethTypes.Job { - ps := []ffmpeg.VideoProfile{ffmpeg.P240p30fps16x9, ffmpeg.P360p30fps4x3, ffmpeg.P720p30fps4x3} - return ðTypes.Job{ - JobId: big.NewInt(5), - StreamId: "strmID", - Profiles: ps, - MaxPricePerSegment: big.NewInt(1), - BroadcasterAddress: ethcommon.Address{}, - TotalClaims: big.NewInt(0), - CreationBlock: big.NewInt(100), - EndBlock: big.NewInt(200), - } -} - -func TestShouldVerify(t *testing.T) { - client := &StubClient{} - cm := NewBasicClaimManager(newJob(), client, &ipfs.StubIpfsApi{}, nil) - - blkHash := ethcommon.Hash([32]byte{0, 2, 4, 42, 2, 3, 4, 4, 4, 2, 21, 1, 1, 24, 134, 0, 02, 43}) - //Just make sure the results are different - same := true - var result bool - for i := int64(0); i < 10; i++ { - if tResult := cm.shouldVerifySegment(i, 0, 10, 100, blkHash, 5); result != tResult { - same = false - break - } else { - result = tResult - } - } - if same { - t.Errorf("Should give different results") - } -} - -func TestProfileOrder(t *testing.T) { - cm := NewBasicClaimManager(newJob(), &StubClient{}, &ipfs.StubIpfsApi{}, nil) - - if cm.profiles[0] != ffmpeg.P720p30fps4x3 || cm.profiles[1] != ffmpeg.P360p30fps4x3 || cm.profiles[2] != ffmpeg.P240p30fps16x9 { - t.Errorf("wrong ordering: %v", cm.profiles) - } -} - -func hashTData(order []ffmpeg.VideoProfile, td map[ffmpeg.VideoProfile][]byte) []byte { - hashes := make([][]byte, len(td)) - for i, p := range order { - hashes[i] = crypto.Keccak256(td[p]) - } - return crypto.Keccak256(hashes...) -} - -func TestAddReceipt(t *testing.T) { - db, _ := common.InitDB(fmt.Sprintf("file:%s?mode=memory&cache=shared", t.Name())) // NOTE foreign keys are disabled; enable if a test begins depending on them - ps := []ffmpeg.VideoProfile{ffmpeg.P240p30fps16x9, ffmpeg.P360p30fps4x3, ffmpeg.P720p30fps4x3} - cm := NewBasicClaimManager(newJob(), &StubClient{}, &ipfs.StubIpfsApi{}, db) - tStart := time.Now().UTC() - tEnd := tStart - defer db.Close() - - bcastFile, err := ioutil.TempFile("", "data") - if err != nil { - t.Error("Unable to open tempfile ", err) - } - bf := bcastFile.Name() - defer os.Remove(bf) - bd, err := ioutil.ReadAll(bcastFile) - if err != nil { - t.Error("Unable to read tempfile ", err) - } - bcastFile.Close() - - // Sanity check the file that is read hashes to what's expected - if bytes.Equal(crypto.Keccak256(bd), crypto.Keccak256([]byte("data"))) { - t.Error("File data hash did not match raw hash") - } - - //Should get error due to a length mismatch - td := map[ffmpeg.VideoProfile][]byte{ - ffmpeg.P360p30fps4x3: []byte("tdatahash"), - ffmpeg.P240p30fps16x9: []byte("tdatahash"), - } - if _, err := cm.AddReceipt(0, "", []byte("data"), []byte("sig"), td, tStart, tEnd); err == nil { - t.Error("Expecting an error for mismatched profile legnths.") - } - //Should get error for adding to a non-existing profile - td[ffmpeg.P144p30fps16x9] = []byte("tdatahash") - if _, err := cm.AddReceipt(0, "", []byte("data"), []byte("sig"), td, tStart, tEnd); err == nil { - t.Error("Expecting an error for adding to a non-existing profile.") - } - // Should pass - td = map[ffmpeg.VideoProfile][]byte{ - ffmpeg.P360p30fps4x3: []byte("tdatahash"), - ffmpeg.P240p30fps16x9: []byte("tdatahash"), - ffmpeg.P720p30fps4x3: []byte("tdatahash"), - } - if _, err := cm.AddReceipt(0, bf, []byte("data"), []byte("sig"), td, tStart, tEnd); err != nil { - t.Error("Unexpected error ", err) - } - // Should get an error due to an already existing receipt - if _, err := cm.AddReceipt(0, "", []byte("data"), []byte("sig"), td, tStart, tEnd); err == nil { - t.Error("Did not get an error where one was expected") - } - - if string(cm.segClaimMap[0].bFile) != bf { - t.Errorf("Expecting %v, got %v", cm.segClaimMap[0].bFile, bf) - } - - if string(cm.segClaimMap[0].dataHash) != string(crypto.Keccak256([]byte("data"))) { //appended by ipfs.StubIpfsApi - t.Errorf("Expecting %v, got %v", string(crypto.Keccak256([]byte("data"))), string(cm.segClaimMap[0].dataHash)) - } - - hash := hashTData(ps, td) - if string(cm.segClaimMap[0].claimConcatTDatahash) != string(hash) { - t.Errorf("Expecting %v, got %v", ethcommon.ToHex(hash), ethcommon.ToHex(cm.segClaimMap[0].claimConcatTDatahash)) - } - - if string(cm.segClaimMap[0].bSig) != "sig" { - t.Errorf("Expecting %v, got %v", "sig", string(cm.segClaimMap[0].bSig)) - } - - // Simulate recovery: insert a receipt in the DB then insert another with - // the same seqNo the normal way. Should fail due to double claims - - // Sanity check that the segment doesn't exist already - if _, ok := cm.unclaimedSegs[1]; ok { - t.Error("Expected segment 1 to be unclaimed") - } - // fake it with the db insertion - err = db.InsertReceipt(cm.jobID, 1, "", []byte{}, []byte{}, []byte{}, tStart, tEnd) - if err != nil { - t.Error(err) - } - // normal insertion - _, err = cm.AddReceipt(1, "", []byte{}, []byte{}, td, tStart, tEnd) - if err == nil { - t.Error("Expecting error; inserting duplicate claim!") - } - // ensure we don't have data inadvertedly sitting around our data structures - if _, ok := cm.unclaimedSegs[1]; ok { - t.Error("Expected segment 1 to be unclaimed") - } - if _, ok := cm.segClaimMap[1]; ok { - t.Error("Expected segment 1 to be unclaimed") - } -} - -//We add 6 ranges (0, 3-13, 15-18, 20-25, 27, 29) -func setupRanges(t *testing.T) *BasicClaimManager { - ethClient := &StubClient{ClaimStart: make([]*big.Int, 0), ClaimEnd: make([]*big.Int, 0), ClaimJid: make([]*big.Int, 0), ClaimRoot: make(map[[32]byte]bool)} - ps := []ffmpeg.VideoProfile{ffmpeg.P240p30fps16x9, ffmpeg.P360p30fps4x3, ffmpeg.P720p30fps4x3} - cm := NewBasicClaimManager(newJob(), ethClient, &ipfs.StubIpfsApi{}, nil) - tStart := time.Now().UTC() - tEnd := tStart - - for _, segRange := range [][2]int64{[2]int64{0, 0}, [2]int64{3, 13}, [2]int64{15, 18}, [2]int64{21, 25}, [2]int64{27, 27}, [2]int64{29, 29}} { - for i := segRange[0]; i <= segRange[1]; i++ { - td := map[ffmpeg.VideoProfile][]byte{} - for _, p := range ps { - td[p] = []byte(fmt.Sprintf("hash%v%v", p.Name, i)) - } - data := []byte(fmt.Sprintf("data%v", i)) - sig := []byte(fmt.Sprintf("sig%v", i)) - if _, err := cm.AddReceipt(int64(i), "", data, sig, td, tStart, tEnd); err != nil { - t.Errorf("Error: %v", err) - } - if i == 16 { - glog.Infof("data: %v", data) - } - } - } - - //Add invalid 19 out of order (invalid because it's only a single video profile) - i := 19 - p := ffmpeg.P360p30fps4x3 - data := []byte(fmt.Sprintf("data%v%v", p.Name, i)) - sig := []byte(fmt.Sprintf("sig%v%v", p.Name, i)) - td := map[ffmpeg.VideoProfile][]byte{ - p: []byte(fmt.Sprintf("hash%v%v", p, i)), - } - if _, err := cm.AddReceipt(int64(i), "", data, sig, td, tStart, tEnd); err == nil { - t.Errorf("Did not get an error when expecting one") - } - - return cm -} - -func TestRanges(t *testing.T) { - //We added 6 ranges (0, 3-13, 15-18, 20-25, 27, 29) - cm := setupRanges(t) - ranges := cm.makeRanges() - glog.Infof("ranges: %v", ranges) - if len(ranges) != 6 { - t.Errorf("Expecting 6 ranges, got %v", ranges) - } - - // No unclaimed segs; this crashed at one point. - cm.unclaimedSegs = map[int64]bool{} - ranges = cm.makeRanges() - if len(ranges) != 0 { - t.Error("Expected 0 ranges, got ", ranges) - } -} - -func TestClaimVerifyAndDistributeFees(t *testing.T) { - ethClient := &StubClient{ClaimStart: make([]*big.Int, 0), ClaimEnd: make([]*big.Int, 0), ClaimJid: make([]*big.Int, 0), ClaimRoot: make(map[[32]byte]bool), Claims: make(map[int]*ethTypes.Claim)} - ps := []ffmpeg.VideoProfile{ffmpeg.P240p30fps16x9, ffmpeg.P360p30fps4x3, ffmpeg.P720p30fps4x3} - cm := NewBasicClaimManager(newJob(), ethClient, &ipfs.StubIpfsApi{}, nil) - tStart := time.Now().UTC() - tEnd := tStart - - //Add some receipts(0-9) - receiptHashes1 := make([]ethcommon.Hash, 10) - for i := 0; i < 10; i++ { - td := make(map[ffmpeg.VideoProfile][]byte, len(ps)) - data := []byte(fmt.Sprintf("data%v", i)) - sig := []byte(fmt.Sprintf("sig%v", i)) - for _, p := range ps { - td[p] = []byte(fmt.Sprintf("tHash%v%v", ffmpeg.P240p30fps16x9.Name, i)) // ??? - } - if _, err := cm.AddReceipt(int64(i), "", data, sig, td, tStart, tEnd); err != nil { - t.Errorf("Error: %v", err) - } - - receipt := ðTypes.TranscodeReceipt{ - StreamID: "strmID", - SegmentSequenceNumber: big.NewInt(int64(i)), - DataHash: crypto.Keccak256(data), - ConcatTranscodedDataHash: hashTData(ps, td), - BroadcasterSig: []byte(sig), - } - receiptHashes1[i] = receipt.Hash() - } - - //Add some receipts(15-24) - receiptHashes2 := make([]ethcommon.Hash, 10) - for i := 15; i < 25; i++ { - td := map[ffmpeg.VideoProfile][]byte{} - data := []byte(fmt.Sprintf("data%v", i)) - sig := []byte(fmt.Sprintf("sig%v", i)) - for _, p := range ps { - td[p] = []byte(fmt.Sprintf("tHash%v%v", ffmpeg.P240p30fps16x9.Name, i)) // ??? - } - if _, err := cm.AddReceipt(int64(i), "", data, sig, td, tStart, tEnd); err != nil { - t.Errorf("Error: %v", err) - } - receipt := ðTypes.TranscodeReceipt{ - StreamID: "strmID", - SegmentSequenceNumber: big.NewInt(int64(i)), - DataHash: crypto.Keccak256(data), - ConcatTranscodedDataHash: hashTData(ps, td), - BroadcasterSig: []byte(sig), - } - receiptHashes2[i-15] = receipt.Hash() - } - - err := cm.ClaimVerifyAndDistributeFees() - if err != nil { - t.Fatal(err) - } - - //Make sure the roots are used for calling Claim - root1, _, err := ethTypes.NewMerkleTree(receiptHashes1) - if err != nil { - t.Errorf("Error: %v", err) - } - if _, ok := ethClient.ClaimRoot[[32]byte(root1.Hash)]; !ok { - t.Errorf("Expecting claim to have root %v, but got %v", [32]byte(root1.Hash), ethClient.ClaimRoot) - } - - root2, _, err := ethTypes.NewMerkleTree(receiptHashes2) - if err != nil { - t.Errorf("Error: %v", err) - } - if _, ok := ethClient.ClaimRoot[[32]byte(root2.Hash)]; !ok { - t.Errorf("Expecting claim to have root %v, but got %v", [32]byte(root2.Hash), ethClient.ClaimRoot) - } -} - -func TestRecoverClaims(t *testing.T) { - // this whole thing is timing sensitive; fix? - - sc := &StubClient{ClaimRoot: make(map[[32]byte]bool), Claims: make(map[int]*ethTypes.Claim)} - db, dbraw, err := common.TempDB(t) - if err != nil { - t.Error(t) - } - defer db.Close() - defer dbraw.Close() - - // empty db - err = RecoverClaims(sc, &ipfs.StubIpfsApi{}, db) - if err != nil { - t.Error(t) - } - - // claims are async so sleep for a bit - time.Sleep(1 * time.Second) - - var claims int - err = dbraw.QueryRow("SELECT count(*) FROM claims").Scan(&claims) - if err != nil || claims != 0 { - t.Errorf("Unexpected claims got %v error %v", claims, err) - } - - j := newJob() - jid := j.JobId - db.InsertJob(EthJobToDBJob(j)) - - db.InsertReceipt(jid, 1, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(jid, 2, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(jid, 3, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(jid, 8, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(jid, 9, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - - j.JobId = big.NewInt(0).Add(jid, jid) - db.InsertJob(EthJobToDBJob(j)) - - db.InsertReceipt(j.JobId, 1, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(j.JobId, 2, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - - // sanity check receipts and claims in db - receipts, err := db.UnclaimedReceipts() - if err != nil || (len(receipts) != 2 && len(receipts[0]) != 5 && len(receipts[1]) != 2) { - t.Error("Receipts ", err) - } - jc, err := db.CountClaims(jid) - if err != nil || jc != 0 { - t.Error("Claims ", err) - } - - // TODO Claims recovery is async for each job and thus timing sensitive - // Fails often on CI. Fix! - return - - err = RecoverClaims(sc, &ipfs.StubIpfsApi{}, db) - if err != nil { - t.Error(t) - } - - // claims are async so sleep for a bit - time.Sleep(1 * time.Second) - - dbraw.QueryRow("SELECT count(*) FROM claims").Scan(&claims) - jc1, _ := db.CountClaims(jid) - jc2, _ := db.CountClaims(j.JobId) - if claims != 3 || sc.ClaimCounter != 3 || jc1 != 2 || jc2 != 1 { - t.Error("Unexpected claims ", claims, sc.ClaimCounter, jc1, jc2) - } - - // all receipts should have been claimed - receipts, err = db.UnclaimedReceipts() - if err != nil || len(receipts) != 0 { - t.Error("Receipts ", err, len(receipts)) - } - - // ensure imdepotency - err = RecoverClaims(sc, &ipfs.StubIpfsApi{}, db) - if err != nil { - t.Error(t) - } - - // claims are async so sleep for a bit - time.Sleep(1 * time.Second) - - err = dbraw.QueryRow("SELECT count(*) FROM claims").Scan(&claims) - if err != nil || claims != 3 || sc.ClaimCounter != 3 { - t.Errorf("Unexpected claims got %v error %v", claims, err) - } - - // now move forward the block count and check if claims can be submitted - db.SetLastSeenBlock(big.NewInt(1000)) - - // existing job that has submitted a claim; can submit another - db.InsertReceipt(jid, 4, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - dbj, _ := db.GetJob(jid.Int64()) - j = common.DBJobToEthJob(dbj) - lsb, _ := db.LastSeenBlock() - if lsb.Int64()-j.CreationBlock.Int64() <= 256 { // sanity check - t.Error("Not > 256 blocks after creation") - } - - // new job, blocks > 256 and hasn't submitted a claim; can't claim anymore - j.JobId = big.NewInt(99) - db.InsertJob(EthJobToDBJob(j)) - db.InsertReceipt(j.JobId, 1, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - db.InsertReceipt(j.JobId, 2, "bcastfile", []byte("sig"), []byte("tcodehash"), []byte("bcasthash"), time.Now(), time.Now()) - - receipts, _ = db.UnclaimedReceipts() - if len(receipts) != 2 && len(receipts[0]) != 1 && len(receipts[1]) != 2 { - t.Error("Receipts after 256 blocks") - } - - err = RecoverClaims(sc, &ipfs.StubIpfsApi{}, db) - if err != nil { - t.Error(t) - } - - // claims are async so sleep for a bit - time.Sleep(1 * time.Second) - - dbraw.QueryRow("SELECT count(*) FROM claims").Scan(&claims) - jc1, _ = db.CountClaims(jid) - jc2, _ = db.CountClaims(j.JobId) - if claims != 4 || sc.ClaimCounter != 4 || jc1 != 3 || jc2 != 0 { - t.Error("Unexpected claims ", claims, sc.ClaimCounter, jc1, jc2) - } -} - -// func TestVerify(t *testing.T) { -// ethClient := &StubClient{VeriRate: 10} -// ps := []ffmpeg.VideoProfile{ffmpeg.P240p30fps16x9, ffmpeg.P360p30fps4x3, ffmpeg.P720p30fps4x3} -// cm := NewBasicClaimManager("strmID", big.NewInt(5), ethcommon.Address{}, big.NewInt(1), ps, ethClient, &ipfs.StubIpfsApi{}, nil) -// start := int64(0) -// end := int64(100) -// blkNum := int64(100) -// seqNum := int64(10) -// //Find a blkHash that will trigger verification -// var blkHash ethcommon.Hash -// for i := 0; i < 100; i++ { -// blkHash = ethcommon.HexToHash(fmt.Sprintf("0xDEADBEEF%v", i)) -// if cm.shouldVerifySegment(seqNum, start, end, blkNum, blkHash, 10) { -// break -// } -// } - -// //Add a seg that shouldn't trigger -// cm.AddReceipt(seqNum, []byte("data240"), []byte("tDataHash240"), []byte("bSig"), ffmpeg.P240p30fps16x9) -// cm.AddReceipt(seqNum, []byte("data360"), []byte("tDataHash360"), []byte("bSig"), ffmpeg.P360p30fps4x3) -// cm.AddReceipt(seqNum, []byte("data720"), []byte("tDataHash720"), []byte("bSig"), ffmpeg.P720p30fps4x3) -// seg, _ := cm.segClaimMap[seqNum] -// seg.claimStart = start -// seg.claimEnd = end -// seg.claimBlkNum = big.NewInt(blkNum) -// ethClient.BlockHashToReturn = ethcommon.Hash{} - -// if err := cm.Verify(); err != nil { -// t.Errorf("Error: %v", err) -// } -// if ethClient.VerifyCounter != 0 { -// t.Errorf("Expect verify to NOT be triggered") -// } - -// // //Add a seg that SHOULD trigger -// cm.AddReceipt(seqNum, []byte("data240"), []byte("tDataHash240"), []byte("bSig"), ffmpeg.P240p30fps16x9) -// cm.AddReceipt(seqNum, []byte("data360"), []byte("tDataHash360"), []byte("bSig"), ffmpeg.P360p30fps4x3) -// cm.AddReceipt(seqNum, []byte("data720"), []byte("tDataHash720"), []byte("bSig"), ffmpeg.P720p30fps4x3) -// seg, _ = cm.segClaimMap[seqNum] -// seg.claimStart = start -// seg.claimEnd = end -// seg.claimBlkNum = big.NewInt(blkNum) -// seg.claimProof = []byte("proof") -// ethClient.BlockHashToReturn = blkHash - -// if err := cm.Verify(); err != nil { -// t.Errorf("Error: %v", err) -// } -// lpCommon.WaitUntil(100*time.Millisecond, func() bool { -// return ethClient.VerifyCounter != 0 -// }) -// if ethClient.VerifyCounter != 1 { -// t.Errorf("Expect verify to be triggered") -// } -// if string(ethClient.Proof) != string(seg.claimProof) { -// t.Errorf("Expect proof to be %v, got %v", seg.claimProof, ethClient.Proof) -// } -// } diff --git a/eth/client.go b/eth/client.go index 15f72d9ce..c7ab8a845 100644 --- a/eth/client.go +++ b/eth/client.go @@ -7,7 +7,7 @@ package eth //go:generate abigen --abi protocol/abi/LivepeerToken.abi --pkg contracts --type LivepeerToken --out contracts/livepeerToken.go //go:generate abigen --abi protocol/abi/ServiceRegistry.abi --pkg contracts --type ServiceRegistry --out contracts/serviceRegistry.go //go:generate abigen --abi protocol/abi/BondingManager.abi --pkg contracts --type BondingManager --out contracts/bondingManager.go -//go:generate abigen --abi protocol/abi/JobsManager.abi --pkg contracts --type JobsManager --out contracts/jobsManager.go +//go:generate abigen --abi protocol/abi/LivepeerETHTicketBroker.abi --pkg contracts --type LivepeerETHTicketBroker --out contracts/livepeerETHTicketBroker.go //go:generate abigen --abi protocol/abi/RoundsManager.abi --pkg contracts --type RoundsManager --out contracts/roundsManager.go //go:generate abigen --abi protocol/abi/Minter.abi --pkg contracts --type Minter --out contracts/minter.go //go:generate abigen --abi protocol/abi/LivepeerVerifier.abi --pkg contracts --type LivepeerVerifier --out contracts/livepeerVerifier.go @@ -80,43 +80,19 @@ type LivepeerEthClient interface { GetTranscoderEarningsPoolForRound(addr ethcommon.Address, round *big.Int) (*lpTypes.TokenPools, error) RegisteredTranscoders() ([]*lpTypes.Transcoder, error) IsActiveTranscoder() (bool, error) - AssignedTranscoder(*lpTypes.Job) (ethcommon.Address, error) GetTotalBonded() (*big.Int, error) - // Jobs - Job(streamId string, transcodingOptions string, maxPricePerSegment *big.Int, endBlock *big.Int) (*types.Transaction, error) - ClaimWork(jobId *big.Int, segmentRange [2]*big.Int, claimRoot [32]byte) (*types.Transaction, error) - Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, dataStorageHash string, dataHashes [2][32]byte, broadcasterSig []byte, proof []byte) (*types.Transaction, error) - DistributeFees(jobId *big.Int, claimId *big.Int) (*types.Transaction, error) - Deposit(amount *big.Int) (*types.Transaction, error) - Withdraw() (*types.Transaction, error) - GetJob(jobID *big.Int) (*lpTypes.Job, error) - GetClaim(jobID *big.Int, claimID *big.Int) (*lpTypes.Claim, error) - BroadcasterDeposit(broadcaster ethcommon.Address) (*big.Int, error) - NumJobs() (*big.Int, error) - // Parameters NumActiveTranscoders() (*big.Int, error) RoundLength() (*big.Int, error) RoundLockAmount() (*big.Int, error) UnbondingPeriod() (uint64, error) - VerificationRate() (uint64, error) - VerificationPeriod() (*big.Int, error) - VerificationSlashingPeriod() (*big.Int, error) - FailedVerificationSlashAmount() (*big.Int, error) - MissedVerificationSlashAmount() (*big.Int, error) - DoubleClaimSegmentSlashAmount() (*big.Int, error) - FinderFee() (*big.Int, error) Inflation() (*big.Int, error) InflationChange() (*big.Int, error) TargetBondingRate() (*big.Int, error) - VerificationCodeHash() (string, error) Paused() (bool, error) // Events - WatchForJob(string) (*lpTypes.Job, error) - ProcessHistoricalNewJob(*big.Int, bool, func(*contracts.JobsManagerNewJob) error) error - WatchForNewJob(bool, chan *contracts.JobsManagerNewJob) (ethereum.Subscription, error) ProcessHistoricalUnbond(*big.Int, func(*contracts.BondingManagerUnbond) error) error WatchForUnbond(chan *contracts.BondingManagerUnbond) (ethereum.Subscription, error) ProcessHistoricalRebond(*big.Int, func(*contracts.BondingManagerRebond) error) error @@ -142,7 +118,7 @@ type client struct { tokenAddr ethcommon.Address serviceRegistryAddr ethcommon.Address bondingManagerAddr ethcommon.Address - jobsManagerAddr ethcommon.Address + ticketBrokerAddr ethcommon.Address roundsManagerAddr ethcommon.Address minterAddr ethcommon.Address verifierAddr ethcommon.Address @@ -153,7 +129,7 @@ type client struct { *contracts.LivepeerTokenSession *contracts.ServiceRegistrySession *contracts.BondingManagerSession - *contracts.JobsManagerSession + *contracts.LivepeerETHTicketBrokerSession *contracts.RoundsManagerSession *contracts.MinterSession *contracts.LivepeerVerifierSession @@ -291,26 +267,26 @@ func (c *client) setContracts(opts *bind.TransactOpts) error { glog.V(common.SHORT).Infof("BondingManager: %v", c.bondingManagerAddr.Hex()) - jobsManagerAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("JobsManager"))) + brokerAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("TicketBroker"))) if err != nil { - glog.Errorf("Error getting JobsManager address: %v", err) + glog.Errorf("Error getting TicketBroker address: %v", err) return err } - c.jobsManagerAddr = jobsManagerAddr + c.ticketBrokerAddr = brokerAddr - jobsManager, err := contracts.NewJobsManager(jobsManagerAddr, c.backend) + broker, err := contracts.NewLivepeerETHTicketBroker(brokerAddr, c.backend) if err != nil { - glog.Errorf("Error creating JobsManager binding: %v", err) + glog.Errorf("Error creating TicketBroker binding: %v", err) return err } - c.JobsManagerSession = &contracts.JobsManagerSession{ - Contract: jobsManager, + c.LivepeerETHTicketBrokerSession = &contracts.LivepeerETHTicketBrokerSession{ + Contract: broker, TransactOpts: *opts, } - glog.V(common.SHORT).Infof("JobsManager: %v", c.jobsManagerAddr.Hex()) + glog.V(common.SHORT).Infof("TicketBroker: %v", c.ticketBrokerAddr.Hex()) roundsManagerAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("RoundsManager"))) if err != nil { @@ -591,28 +567,6 @@ func (c *client) autoClaimEarnings(endRound *big.Int, allRounds bool) error { return nil } -func (c *client) Deposit(amount *big.Int) (*types.Transaction, error) { - c.JobsManagerSession.TransactOpts.Value = amount - - tx, err := c.JobsManagerSession.Deposit() - c.JobsManagerSession.TransactOpts.Value = nil - return tx, err -} - -// Disambiguate between the Verifiy method in JobsManager and in Verifier -func (c *client) Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, dataStorageHash string, dataHashes [2][32]byte, broadcasterSig []byte, proof []byte) (*types.Transaction, error) { - return c.JobsManagerSession.Verify(jobId, claimId, segmentNumber, dataStorageHash, dataHashes, broadcasterSig, proof) -} - -func (c *client) BroadcasterDeposit(addr ethcommon.Address) (*big.Int, error) { - b, err := c.Broadcasters(addr) - if err != nil { - return nil, err - } - - return b.Deposit, nil -} - func (c *client) IsActiveTranscoder() (bool, error) { r, err := c.CurrentRound() if err != nil { @@ -760,69 +714,6 @@ func (c *client) GetDelegatorUnbondingLock(addr ethcommon.Address, unbondingLock }, nil } -func (c *client) GetJob(jobID *big.Int) (*lpTypes.Job, error) { - jInfo, err := c.JobsManagerSession.GetJob(jobID) - if err != nil { - return nil, err - } - - jStatus, err := c.JobStatus(jobID) - if err != nil { - return nil, err - } - - status, err := lpTypes.ParseJobStatus(jStatus) - if err != nil { - return nil, err - } - - profiles, err := common.TxDataToVideoProfile(jInfo.TranscodingOptions) - if err != nil { - return nil, err - } - - return &lpTypes.Job{ - JobId: jobID, - StreamId: jInfo.StreamId, - Profiles: profiles, - MaxPricePerSegment: jInfo.MaxPricePerSegment, - BroadcasterAddress: jInfo.BroadcasterAddress, - TranscoderAddress: jInfo.TranscoderAddress, - CreationRound: jInfo.CreationRound, - CreationBlock: jInfo.CreationBlock, - EndBlock: jInfo.EndBlock, - Escrow: jInfo.Escrow, - TotalClaims: jInfo.TotalClaims, - Status: status, - // If the job returned from the contract does not have a transcoder address, - // the first claim has not been submitted by the assigned transcoder yet - FirstClaimSubmitted: jInfo.TranscoderAddress != ethcommon.Address{}, - }, nil -} - -func (c *client) GetClaim(jobID *big.Int, claimID *big.Int) (*lpTypes.Claim, error) { - cInfo, err := c.JobsManagerSession.GetClaim(jobID, claimID) - if err != nil { - return nil, err - } - - status, err := lpTypes.ParseClaimStatus(cInfo.Status) - if err != nil { - glog.V(common.SHORT).Infof("%v", cInfo) - return nil, err - } - - return &lpTypes.Claim{ - ClaimId: claimID, - SegmentRange: cInfo.SegmentRange, - ClaimRoot: cInfo.ClaimRoot, - ClaimBlock: cInfo.ClaimBlock, - EndVerificationBlock: cInfo.EndVerificationBlock, - EndVerificationSlashingBlock: cInfo.EndVerificationSlashingBlock, - Status: status, - }, nil -} - func (c *client) Paused() (bool, error) { return c.ControllerSession.Paused() } @@ -852,32 +743,6 @@ func (c *client) RegisteredTranscoders() ([]*lpTypes.Transcoder, error) { return transcoders, nil } -func (c *client) AssignedTranscoder(jInfo *lpTypes.Job) (ethcommon.Address, error) { - var blk *types.Block - getBlock := func() error { - var err error - blk, err = c.backend.BlockByNumber(context.Background(), jInfo.CreationBlock) - if err != nil { - glog.Errorf("Error getting block by number %v: %v. retrying...", jInfo.CreationBlock.String(), err) - return err - } - - return nil - } - if err := backoff.Retry(getBlock, backoff.WithMaxRetries(backoff.NewConstantBackOff(time.Second), SubscribeRetry)); err != nil { - glog.Errorf("BlockByNumber failed: %v", err) - return ethcommon.Address{}, err - } - - t, err := c.BondingManagerSession.ElectActiveTranscoder(jInfo.MaxPricePerSegment, blk.Hash(), jInfo.CreationRound) - if err != nil { - glog.Errorf("Error getting ElectActiveTranscoder: %v", err) - return ethcommon.Address{}, err - } - - return t, nil -} - // Helpers func (c *client) ContractAddresses() map[string]ethcommon.Address { @@ -885,11 +750,10 @@ func (c *client) ContractAddresses() map[string]ethcommon.Address { addrMap["Controller"] = c.controllerAddr addrMap["LivepeerToken"] = c.tokenAddr addrMap["LivepeerTokenFaucet"] = c.faucetAddr - addrMap["JobsManager"] = c.jobsManagerAddr + addrMap["TicketBroker"] = c.ticketBrokerAddr addrMap["RoundsManager"] = c.roundsManagerAddr addrMap["BondingManager"] = c.bondingManagerAddr addrMap["Minter"] = c.minterAddr - addrMap["Verifier"] = c.verifierAddr return addrMap } @@ -977,58 +841,6 @@ func (c *client) ReplaceTransaction(tx *types.Transaction, method string, gasPri return newSignedTx, err } -// Watch for a new job matching the given streamId. -// Since this job will be fresh, not all fields will be populated! -// After receiving the job, validate the fields that are expected. -func (c *client) WatchForJob(streamId string) (*lpTypes.Job, error) { - ctx, cancel := context.WithTimeout(context.Background(), c.txTimeout) - defer cancel() - var job *lpTypes.Job - jobWatcher := func() error { - sink := make(chan *contracts.JobsManagerNewJob) - sub, err := c.JobsManagerSession.Contract.JobsManagerFilterer.WatchNewJob(nil, sink, []ethcommon.Address{c.Account().Address}) - if err != nil { - glog.Error("Unable to start job watcher ", err) - return err - } - select { - case newJob := <-sink: - sub.Unsubscribe() - if newJob.StreamId == streamId { - // TODO reconstruct job locally once we have - // EndBlock and CreationRound as part of the event - getJob := func() error { - var err error - job, err = c.GetJob(newJob.JobId) - if job.MaxPricePerSegment.Int64() == 0 { - err = errors.New("EmptyJob") - } - if err != nil { - glog.Errorf("Could not get job %v because of %v; retrying ", newJob.JobId, err) - } - return err - } - return backoff.Retry(getJob, backoff.NewConstantBackOff(2*time.Second)) - } - // mismatched streamid; maybe we had concurrent listeners so retry - glog.Errorf("Watched for job; got mismatched stream Id %v; expecting %v", - newJob.StreamId, streamId) - return fmt.Errorf("MismatchedStreamId") - case errChan := <-sub.Err(): - sub.Unsubscribe() - glog.Errorf("Error subscribing to new job %v; retrying", errChan) - return fmt.Errorf("SubscribeError") - case <-ctx.Done(): - sub.Unsubscribe() - glog.Errorf("Job watcher timeout exceeded; stopping") - return fmt.Errorf("JobWatchTimeout") - } - } - - err := backoff.Retry(jobWatcher, backoff.NewConstantBackOff(time.Second*2)) - return job, err -} - func (c *client) getNonce() (uint64, error) { c.nonceLock.Lock() defer c.nonceLock.Unlock() @@ -1076,56 +888,6 @@ func (c *client) LatestBlockNum() (*big.Int, error) { return blk.Number, nil } -func (c *client) ProcessHistoricalNewJob(startBlock *big.Int, isTranscoder bool, cb func(*contracts.JobsManagerNewJob) error) error { - // Retrieve historical jobs starting from startBlock - // WatchForNewJob() will not emit past logs - filterOpts := &bind.FilterOpts{Start: startBlock.Uint64()} - - var broadcaster []ethcommon.Address - if !isTranscoder { - broadcaster = []ethcommon.Address{c.Account().Address} - } - - it, err := c.JobsManagerSession.Contract.JobsManagerFilterer.FilterNewJob(filterOpts, broadcaster) - if err != nil { - return err - } - - for it.Next() { - if err := cb(it.Event); err != nil { - return err - } - } - - return nil -} - -func (c *client) WatchForNewJob(isTranscoder bool, sink chan *contracts.JobsManagerNewJob) (ethereum.Subscription, error) { - var ( - sub ethereum.Subscription - err error - ) - - var broadcaster []ethcommon.Address - if !isTranscoder { - broadcaster = []ethcommon.Address{c.Account().Address} - } - - newJobWatcher := func() error { - sub, err = c.JobsManagerSession.Contract.JobsManagerFilterer.WatchNewJob(nil, sink, broadcaster) - if err != nil { - glog.Error("Unable to start NewJob watcher ", err) - return err - } - - return nil - } - - err = backoff.Retry(newJobWatcher, backoff.NewConstantBackOff(time.Second*2)) - - return sub, err -} - func (c *client) ProcessHistoricalUnbond(startBlock *big.Int, cb func(*contracts.BondingManagerUnbond) error) error { // Retrieve historical logs starting from startBlock // WatchForUnbond() will not emit past logs diff --git a/eth/contracts/bondingManager.go b/eth/contracts/bondingManager.go index 23e3c6af7..c0b8a937d 100644 --- a/eth/contracts/bondingManager.go +++ b/eth/contracts/bondingManager.go @@ -15,8 +15,20 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // BondingManagerABI is the input ABI used to generate the binding from. -const BondingManagerABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"maxEarningsClaimsRounds\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"isValidUnbondingLock\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"delegatorStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"reward\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_finder\",\"type\":\"address\"},{\"name\":\"_slashAmount\",\"type\":\"uint256\"},{\"name\":\"_finderFee\",\"type\":\"uint256\"}],\"name\":\"slashTranscoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getNextTranscoderInPool\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setActiveTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getTranscoderEarningsPoolForRound\",\"outputs\":[{\"name\":\"rewardPool\",\"type\":\"uint256\"},{\"name\":\"feePool\",\"type\":\"uint256\"},{\"name\":\"totalStake\",\"type\":\"uint256\"},{\"name\":\"claimableStake\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"claimEarnings\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"unbond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebondFromUnbonded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_fees\",\"type\":\"uint256\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"updateTranscoderWithFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"activeTranscoderSet\",\"outputs\":[{\"name\":\"totalStake\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"getDelegatorUnbondingLock\",\"outputs\":[{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdrawFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolMaxSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTotalBonded\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getTranscoder\",\"outputs\":[{\"name\":\"lastRewardRound\",\"type\":\"uint256\"},{\"name\":\"rewardCut\",\"type\":\"uint256\"},{\"name\":\"feeShare\",\"type\":\"uint256\"},{\"name\":\"pricePerSegment\",\"type\":\"uint256\"},{\"name\":\"pendingRewardCut\",\"type\":\"uint256\"},{\"name\":\"pendingFeeShare\",\"type\":\"uint256\"},{\"name\":\"pendingPricePerSegment\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_numTranscoders\",\"type\":\"uint256\"}],\"name\":\"setNumTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numActiveTranscoders\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_numActiveTranscoders\",\"type\":\"uint256\"}],\"name\":\"setNumActiveTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"isRegisteredTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"unbondingPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_maxEarningsClaimsRounds\",\"type\":\"uint256\"}],\"name\":\"setMaxEarningsClaimsRounds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getTotalActiveStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"isActiveTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_rewardCut\",\"type\":\"uint256\"},{\"name\":\"_feeShare\",\"type\":\"uint256\"},{\"name\":\"_pricePerSegment\",\"type\":\"uint256\"}],\"name\":\"transcoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getFirstTranscoderInPool\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_maxPricePerSegment\",\"type\":\"uint256\"},{\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"electActiveTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderTotalStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"getDelegator\",\"outputs\":[{\"name\":\"bondedAmount\",\"type\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\"},{\"name\":\"delegateAddress\",\"type\":\"address\"},{\"name\":\"delegatedAmount\",\"type\":\"uint256\"},{\"name\":\"startRound\",\"type\":\"uint256\"},{\"name\":\"lastClaimRound\",\"type\":\"uint256\"},{\"name\":\"nextUnbondingLockId\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"bond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingPeriod\",\"type\":\"uint64\"}],\"name\":\"setUnbondingPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"activeTranscoderTotalStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingFees\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"pendingRewardCut\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"pendingFeeShare\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"pendingPricePerSegment\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"registered\",\"type\":\"bool\"}],\"name\":\"TranscoderUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"}],\"name\":\"TranscoderEvicted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"}],\"name\":\"TranscoderResigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"finder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"penalty\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"finderReward\",\"type\":\"uint256\"}],\"name\":\"TranscoderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Reward\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"Bond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"Unbond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Rebond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"WithdrawStake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"WithdrawFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"}]" +const BondingManagerABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"maxEarningsClaimsRounds\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"activeTranscoderSet\",\"outputs\":[{\"name\":\"totalStake\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numActiveTranscoders\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"unbondingPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"pendingRewardCut\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"pendingFeeShare\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"pendingPricePerSegment\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"registered\",\"type\":\"bool\"}],\"name\":\"TranscoderUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"}],\"name\":\"TranscoderEvicted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"}],\"name\":\"TranscoderResigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"finder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"penalty\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"finderReward\",\"type\":\"uint256\"}],\"name\":\"TranscoderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Reward\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newDelegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"oldDelegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"additionalAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"bondedAmount\",\"type\":\"uint256\"}],\"name\":\"Bond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"Unbond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Rebond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"WithdrawStake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"WithdrawFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingPeriod\",\"type\":\"uint64\"}],\"name\":\"setUnbondingPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_numTranscoders\",\"type\":\"uint256\"}],\"name\":\"setNumTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_numActiveTranscoders\",\"type\":\"uint256\"}],\"name\":\"setNumActiveTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_maxEarningsClaimsRounds\",\"type\":\"uint256\"}],\"name\":\"setMaxEarningsClaimsRounds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_rewardCut\",\"type\":\"uint256\"},{\"name\":\"_feeShare\",\"type\":\"uint256\"},{\"name\":\"_pricePerSegment\",\"type\":\"uint256\"}],\"name\":\"transcoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"bond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"unbond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebondFromUnbonded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdrawFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setActiveTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"reward\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_fees\",\"type\":\"uint256\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"updateTranscoderWithFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_finder\",\"type\":\"address\"},{\"name\":\"_slashAmount\",\"type\":\"uint256\"},{\"name\":\"_finderFee\",\"type\":\"uint256\"}],\"name\":\"slashTranscoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_maxPricePerSegment\",\"type\":\"uint256\"},{\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"electActiveTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"claimEarnings\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingFees\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"activeTranscoderTotalStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderTotalStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"delegatorStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getTranscoder\",\"outputs\":[{\"name\":\"lastRewardRound\",\"type\":\"uint256\"},{\"name\":\"rewardCut\",\"type\":\"uint256\"},{\"name\":\"feeShare\",\"type\":\"uint256\"},{\"name\":\"pricePerSegment\",\"type\":\"uint256\"},{\"name\":\"pendingRewardCut\",\"type\":\"uint256\"},{\"name\":\"pendingFeeShare\",\"type\":\"uint256\"},{\"name\":\"pendingPricePerSegment\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getTranscoderEarningsPoolForRound\",\"outputs\":[{\"name\":\"rewardPool\",\"type\":\"uint256\"},{\"name\":\"feePool\",\"type\":\"uint256\"},{\"name\":\"totalStake\",\"type\":\"uint256\"},{\"name\":\"claimableStake\",\"type\":\"uint256\"},{\"name\":\"transcoderRewardCut\",\"type\":\"uint256\"},{\"name\":\"transcoderFeeShare\",\"type\":\"uint256\"},{\"name\":\"transcoderRewardPool\",\"type\":\"uint256\"},{\"name\":\"transcoderFeePool\",\"type\":\"uint256\"},{\"name\":\"hasTranscoderRewardFeePool\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"getDelegator\",\"outputs\":[{\"name\":\"bondedAmount\",\"type\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\"},{\"name\":\"delegateAddress\",\"type\":\"address\"},{\"name\":\"delegatedAmount\",\"type\":\"uint256\"},{\"name\":\"startRound\",\"type\":\"uint256\"},{\"name\":\"lastClaimRound\",\"type\":\"uint256\"},{\"name\":\"nextUnbondingLockId\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"getDelegatorUnbondingLock\",\"outputs\":[{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolMaxSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolSize\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getFirstTranscoderInPool\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getNextTranscoderInPool\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTotalBonded\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getTotalActiveStake\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"},{\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"isActiveTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"isRegisteredTranscoder\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_delegator\",\"type\":\"address\"},{\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"isValidUnbondingLock\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // BondingManager is an auto generated Go binding around an Ethereum contract. type BondingManager struct { @@ -162,7 +174,7 @@ func (_BondingManager *BondingManagerTransactorRaw) Transact(opts *bind.Transact // ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. // -// Solidity: function activeTranscoderSet( uint256) constant returns(totalStake uint256) +// Solidity: function activeTranscoderSet(uint256 ) constant returns(uint256 totalStake) func (_BondingManager *BondingManagerCaller) ActiveTranscoderSet(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -174,21 +186,21 @@ func (_BondingManager *BondingManagerCaller) ActiveTranscoderSet(opts *bind.Call // ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. // -// Solidity: function activeTranscoderSet( uint256) constant returns(totalStake uint256) +// Solidity: function activeTranscoderSet(uint256 ) constant returns(uint256 totalStake) func (_BondingManager *BondingManagerSession) ActiveTranscoderSet(arg0 *big.Int) (*big.Int, error) { return _BondingManager.Contract.ActiveTranscoderSet(&_BondingManager.CallOpts, arg0) } // ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. // -// Solidity: function activeTranscoderSet( uint256) constant returns(totalStake uint256) +// Solidity: function activeTranscoderSet(uint256 ) constant returns(uint256 totalStake) func (_BondingManager *BondingManagerCallerSession) ActiveTranscoderSet(arg0 *big.Int) (*big.Int, error) { return _BondingManager.Contract.ActiveTranscoderSet(&_BondingManager.CallOpts, arg0) } // ActiveTranscoderTotalStake is a free data retrieval call binding the contract method 0xf2083220. // -// Solidity: function activeTranscoderTotalStake(_transcoder address, _round uint256) constant returns(uint256) +// Solidity: function activeTranscoderTotalStake(address _transcoder, uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerCaller) ActiveTranscoderTotalStake(opts *bind.CallOpts, _transcoder common.Address, _round *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -200,14 +212,14 @@ func (_BondingManager *BondingManagerCaller) ActiveTranscoderTotalStake(opts *bi // ActiveTranscoderTotalStake is a free data retrieval call binding the contract method 0xf2083220. // -// Solidity: function activeTranscoderTotalStake(_transcoder address, _round uint256) constant returns(uint256) +// Solidity: function activeTranscoderTotalStake(address _transcoder, uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerSession) ActiveTranscoderTotalStake(_transcoder common.Address, _round *big.Int) (*big.Int, error) { return _BondingManager.Contract.ActiveTranscoderTotalStake(&_BondingManager.CallOpts, _transcoder, _round) } // ActiveTranscoderTotalStake is a free data retrieval call binding the contract method 0xf2083220. // -// Solidity: function activeTranscoderTotalStake(_transcoder address, _round uint256) constant returns(uint256) +// Solidity: function activeTranscoderTotalStake(address _transcoder, uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerCallerSession) ActiveTranscoderTotalStake(_transcoder common.Address, _round *big.Int) (*big.Int, error) { return _BondingManager.Contract.ActiveTranscoderTotalStake(&_BondingManager.CallOpts, _transcoder, _round) } @@ -240,7 +252,7 @@ func (_BondingManager *BondingManagerCallerSession) Controller() (common.Address // DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// Solidity: function delegatorStatus(_delegator address) constant returns(uint8) +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) func (_BondingManager *BondingManagerCaller) DelegatorStatus(opts *bind.CallOpts, _delegator common.Address) (uint8, error) { var ( ret0 = new(uint8) @@ -252,21 +264,21 @@ func (_BondingManager *BondingManagerCaller) DelegatorStatus(opts *bind.CallOpts // DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// Solidity: function delegatorStatus(_delegator address) constant returns(uint8) +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) func (_BondingManager *BondingManagerSession) DelegatorStatus(_delegator common.Address) (uint8, error) { return _BondingManager.Contract.DelegatorStatus(&_BondingManager.CallOpts, _delegator) } // DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// Solidity: function delegatorStatus(_delegator address) constant returns(uint8) +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) func (_BondingManager *BondingManagerCallerSession) DelegatorStatus(_delegator common.Address) (uint8, error) { return _BondingManager.Contract.DelegatorStatus(&_BondingManager.CallOpts, _delegator) } // ElectActiveTranscoder is a free data retrieval call binding the contract method 0x91fdf6b1. // -// Solidity: function electActiveTranscoder(_maxPricePerSegment uint256, _blockHash bytes32, _round uint256) constant returns(address) +// Solidity: function electActiveTranscoder(uint256 _maxPricePerSegment, bytes32 _blockHash, uint256 _round) constant returns(address) func (_BondingManager *BondingManagerCaller) ElectActiveTranscoder(opts *bind.CallOpts, _maxPricePerSegment *big.Int, _blockHash [32]byte, _round *big.Int) (common.Address, error) { var ( ret0 = new(common.Address) @@ -278,21 +290,21 @@ func (_BondingManager *BondingManagerCaller) ElectActiveTranscoder(opts *bind.Ca // ElectActiveTranscoder is a free data retrieval call binding the contract method 0x91fdf6b1. // -// Solidity: function electActiveTranscoder(_maxPricePerSegment uint256, _blockHash bytes32, _round uint256) constant returns(address) +// Solidity: function electActiveTranscoder(uint256 _maxPricePerSegment, bytes32 _blockHash, uint256 _round) constant returns(address) func (_BondingManager *BondingManagerSession) ElectActiveTranscoder(_maxPricePerSegment *big.Int, _blockHash [32]byte, _round *big.Int) (common.Address, error) { return _BondingManager.Contract.ElectActiveTranscoder(&_BondingManager.CallOpts, _maxPricePerSegment, _blockHash, _round) } // ElectActiveTranscoder is a free data retrieval call binding the contract method 0x91fdf6b1. // -// Solidity: function electActiveTranscoder(_maxPricePerSegment uint256, _blockHash bytes32, _round uint256) constant returns(address) +// Solidity: function electActiveTranscoder(uint256 _maxPricePerSegment, bytes32 _blockHash, uint256 _round) constant returns(address) func (_BondingManager *BondingManagerCallerSession) ElectActiveTranscoder(_maxPricePerSegment *big.Int, _blockHash [32]byte, _round *big.Int) (common.Address, error) { return _BondingManager.Contract.ElectActiveTranscoder(&_BondingManager.CallOpts, _maxPricePerSegment, _blockHash, _round) } // GetDelegator is a free data retrieval call binding the contract method 0xa64ad595. // -// Solidity: function getDelegator(_delegator address) constant returns(bondedAmount uint256, fees uint256, delegateAddress address, delegatedAmount uint256, startRound uint256, lastClaimRound uint256, nextUnbondingLockId uint256) +// Solidity: function getDelegator(address _delegator) constant returns(uint256 bondedAmount, uint256 fees, address delegateAddress, uint256 delegatedAmount, uint256 startRound, uint256 lastClaimRound, uint256 nextUnbondingLockId) func (_BondingManager *BondingManagerCaller) GetDelegator(opts *bind.CallOpts, _delegator common.Address) (struct { BondedAmount *big.Int Fees *big.Int @@ -318,7 +330,7 @@ func (_BondingManager *BondingManagerCaller) GetDelegator(opts *bind.CallOpts, _ // GetDelegator is a free data retrieval call binding the contract method 0xa64ad595. // -// Solidity: function getDelegator(_delegator address) constant returns(bondedAmount uint256, fees uint256, delegateAddress address, delegatedAmount uint256, startRound uint256, lastClaimRound uint256, nextUnbondingLockId uint256) +// Solidity: function getDelegator(address _delegator) constant returns(uint256 bondedAmount, uint256 fees, address delegateAddress, uint256 delegatedAmount, uint256 startRound, uint256 lastClaimRound, uint256 nextUnbondingLockId) func (_BondingManager *BondingManagerSession) GetDelegator(_delegator common.Address) (struct { BondedAmount *big.Int Fees *big.Int @@ -333,7 +345,7 @@ func (_BondingManager *BondingManagerSession) GetDelegator(_delegator common.Add // GetDelegator is a free data retrieval call binding the contract method 0xa64ad595. // -// Solidity: function getDelegator(_delegator address) constant returns(bondedAmount uint256, fees uint256, delegateAddress address, delegatedAmount uint256, startRound uint256, lastClaimRound uint256, nextUnbondingLockId uint256) +// Solidity: function getDelegator(address _delegator) constant returns(uint256 bondedAmount, uint256 fees, address delegateAddress, uint256 delegatedAmount, uint256 startRound, uint256 lastClaimRound, uint256 nextUnbondingLockId) func (_BondingManager *BondingManagerCallerSession) GetDelegator(_delegator common.Address) (struct { BondedAmount *big.Int Fees *big.Int @@ -348,7 +360,7 @@ func (_BondingManager *BondingManagerCallerSession) GetDelegator(_delegator comm // GetDelegatorUnbondingLock is a free data retrieval call binding the contract method 0x412f83b6. // -// Solidity: function getDelegatorUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(amount uint256, withdrawRound uint256) +// Solidity: function getDelegatorUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerCaller) GetDelegatorUnbondingLock(opts *bind.CallOpts, _delegator common.Address, _unbondingLockId *big.Int) (struct { Amount *big.Int WithdrawRound *big.Int @@ -364,7 +376,7 @@ func (_BondingManager *BondingManagerCaller) GetDelegatorUnbondingLock(opts *bin // GetDelegatorUnbondingLock is a free data retrieval call binding the contract method 0x412f83b6. // -// Solidity: function getDelegatorUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(amount uint256, withdrawRound uint256) +// Solidity: function getDelegatorUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerSession) GetDelegatorUnbondingLock(_delegator common.Address, _unbondingLockId *big.Int) (struct { Amount *big.Int WithdrawRound *big.Int @@ -374,7 +386,7 @@ func (_BondingManager *BondingManagerSession) GetDelegatorUnbondingLock(_delegat // GetDelegatorUnbondingLock is a free data retrieval call binding the contract method 0x412f83b6. // -// Solidity: function getDelegatorUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(amount uint256, withdrawRound uint256) +// Solidity: function getDelegatorUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerCallerSession) GetDelegatorUnbondingLock(_delegator common.Address, _unbondingLockId *big.Int) (struct { Amount *big.Int WithdrawRound *big.Int @@ -410,7 +422,7 @@ func (_BondingManager *BondingManagerCallerSession) GetFirstTranscoderInPool() ( // GetNextTranscoderInPool is a free data retrieval call binding the contract method 0x235c9603. // -// Solidity: function getNextTranscoderInPool(_transcoder address) constant returns(address) +// Solidity: function getNextTranscoderInPool(address _transcoder) constant returns(address) func (_BondingManager *BondingManagerCaller) GetNextTranscoderInPool(opts *bind.CallOpts, _transcoder common.Address) (common.Address, error) { var ( ret0 = new(common.Address) @@ -422,21 +434,21 @@ func (_BondingManager *BondingManagerCaller) GetNextTranscoderInPool(opts *bind. // GetNextTranscoderInPool is a free data retrieval call binding the contract method 0x235c9603. // -// Solidity: function getNextTranscoderInPool(_transcoder address) constant returns(address) +// Solidity: function getNextTranscoderInPool(address _transcoder) constant returns(address) func (_BondingManager *BondingManagerSession) GetNextTranscoderInPool(_transcoder common.Address) (common.Address, error) { return _BondingManager.Contract.GetNextTranscoderInPool(&_BondingManager.CallOpts, _transcoder) } // GetNextTranscoderInPool is a free data retrieval call binding the contract method 0x235c9603. // -// Solidity: function getNextTranscoderInPool(_transcoder address) constant returns(address) +// Solidity: function getNextTranscoderInPool(address _transcoder) constant returns(address) func (_BondingManager *BondingManagerCallerSession) GetNextTranscoderInPool(_transcoder common.Address) (common.Address, error) { return _BondingManager.Contract.GetNextTranscoderInPool(&_BondingManager.CallOpts, _transcoder) } // GetTotalActiveStake is a free data retrieval call binding the contract method 0x77517765. // -// Solidity: function getTotalActiveStake(_round uint256) constant returns(uint256) +// Solidity: function getTotalActiveStake(uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerCaller) GetTotalActiveStake(opts *bind.CallOpts, _round *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -448,14 +460,14 @@ func (_BondingManager *BondingManagerCaller) GetTotalActiveStake(opts *bind.Call // GetTotalActiveStake is a free data retrieval call binding the contract method 0x77517765. // -// Solidity: function getTotalActiveStake(_round uint256) constant returns(uint256) +// Solidity: function getTotalActiveStake(uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerSession) GetTotalActiveStake(_round *big.Int) (*big.Int, error) { return _BondingManager.Contract.GetTotalActiveStake(&_BondingManager.CallOpts, _round) } // GetTotalActiveStake is a free data retrieval call binding the contract method 0x77517765. // -// Solidity: function getTotalActiveStake(_round uint256) constant returns(uint256) +// Solidity: function getTotalActiveStake(uint256 _round) constant returns(uint256) func (_BondingManager *BondingManagerCallerSession) GetTotalActiveStake(_round *big.Int) (*big.Int, error) { return _BondingManager.Contract.GetTotalActiveStake(&_BondingManager.CallOpts, _round) } @@ -488,7 +500,7 @@ func (_BondingManager *BondingManagerCallerSession) GetTotalBonded() (*big.Int, // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(_transcoder address) constant returns(lastRewardRound uint256, rewardCut uint256, feeShare uint256, pricePerSegment uint256, pendingRewardCut uint256, pendingFeeShare uint256, pendingPricePerSegment uint256) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) func (_BondingManager *BondingManagerCaller) GetTranscoder(opts *bind.CallOpts, _transcoder common.Address) (struct { LastRewardRound *big.Int RewardCut *big.Int @@ -514,7 +526,7 @@ func (_BondingManager *BondingManagerCaller) GetTranscoder(opts *bind.CallOpts, // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(_transcoder address) constant returns(lastRewardRound uint256, rewardCut uint256, feeShare uint256, pricePerSegment uint256, pendingRewardCut uint256, pendingFeeShare uint256, pendingPricePerSegment uint256) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) func (_BondingManager *BondingManagerSession) GetTranscoder(_transcoder common.Address) (struct { LastRewardRound *big.Int RewardCut *big.Int @@ -529,7 +541,7 @@ func (_BondingManager *BondingManagerSession) GetTranscoder(_transcoder common.A // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(_transcoder address) constant returns(lastRewardRound uint256, rewardCut uint256, feeShare uint256, pricePerSegment uint256, pendingRewardCut uint256, pendingFeeShare uint256, pendingPricePerSegment uint256) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) func (_BondingManager *BondingManagerCallerSession) GetTranscoder(_transcoder common.Address) (struct { LastRewardRound *big.Int RewardCut *big.Int @@ -544,18 +556,28 @@ func (_BondingManager *BondingManagerCallerSession) GetTranscoder(_transcoder co // GetTranscoderEarningsPoolForRound is a free data retrieval call binding the contract method 0x24454fc4. // -// Solidity: function getTranscoderEarningsPoolForRound(_transcoder address, _round uint256) constant returns(rewardPool uint256, feePool uint256, totalStake uint256, claimableStake uint256) +// Solidity: function getTranscoderEarningsPoolForRound(address _transcoder, uint256 _round) constant returns(uint256 rewardPool, uint256 feePool, uint256 totalStake, uint256 claimableStake, uint256 transcoderRewardCut, uint256 transcoderFeeShare, uint256 transcoderRewardPool, uint256 transcoderFeePool, bool hasTranscoderRewardFeePool) func (_BondingManager *BondingManagerCaller) GetTranscoderEarningsPoolForRound(opts *bind.CallOpts, _transcoder common.Address, _round *big.Int) (struct { - RewardPool *big.Int - FeePool *big.Int - TotalStake *big.Int - ClaimableStake *big.Int + RewardPool *big.Int + FeePool *big.Int + TotalStake *big.Int + ClaimableStake *big.Int + TranscoderRewardCut *big.Int + TranscoderFeeShare *big.Int + TranscoderRewardPool *big.Int + TranscoderFeePool *big.Int + HasTranscoderRewardFeePool bool }, error) { ret := new(struct { - RewardPool *big.Int - FeePool *big.Int - TotalStake *big.Int - ClaimableStake *big.Int + RewardPool *big.Int + FeePool *big.Int + TotalStake *big.Int + ClaimableStake *big.Int + TranscoderRewardCut *big.Int + TranscoderFeeShare *big.Int + TranscoderRewardPool *big.Int + TranscoderFeePool *big.Int + HasTranscoderRewardFeePool bool }) out := ret err := _BondingManager.contract.Call(opts, out, "getTranscoderEarningsPoolForRound", _transcoder, _round) @@ -564,24 +586,34 @@ func (_BondingManager *BondingManagerCaller) GetTranscoderEarningsPoolForRound(o // GetTranscoderEarningsPoolForRound is a free data retrieval call binding the contract method 0x24454fc4. // -// Solidity: function getTranscoderEarningsPoolForRound(_transcoder address, _round uint256) constant returns(rewardPool uint256, feePool uint256, totalStake uint256, claimableStake uint256) +// Solidity: function getTranscoderEarningsPoolForRound(address _transcoder, uint256 _round) constant returns(uint256 rewardPool, uint256 feePool, uint256 totalStake, uint256 claimableStake, uint256 transcoderRewardCut, uint256 transcoderFeeShare, uint256 transcoderRewardPool, uint256 transcoderFeePool, bool hasTranscoderRewardFeePool) func (_BondingManager *BondingManagerSession) GetTranscoderEarningsPoolForRound(_transcoder common.Address, _round *big.Int) (struct { - RewardPool *big.Int - FeePool *big.Int - TotalStake *big.Int - ClaimableStake *big.Int + RewardPool *big.Int + FeePool *big.Int + TotalStake *big.Int + ClaimableStake *big.Int + TranscoderRewardCut *big.Int + TranscoderFeeShare *big.Int + TranscoderRewardPool *big.Int + TranscoderFeePool *big.Int + HasTranscoderRewardFeePool bool }, error) { return _BondingManager.Contract.GetTranscoderEarningsPoolForRound(&_BondingManager.CallOpts, _transcoder, _round) } // GetTranscoderEarningsPoolForRound is a free data retrieval call binding the contract method 0x24454fc4. // -// Solidity: function getTranscoderEarningsPoolForRound(_transcoder address, _round uint256) constant returns(rewardPool uint256, feePool uint256, totalStake uint256, claimableStake uint256) +// Solidity: function getTranscoderEarningsPoolForRound(address _transcoder, uint256 _round) constant returns(uint256 rewardPool, uint256 feePool, uint256 totalStake, uint256 claimableStake, uint256 transcoderRewardCut, uint256 transcoderFeeShare, uint256 transcoderRewardPool, uint256 transcoderFeePool, bool hasTranscoderRewardFeePool) func (_BondingManager *BondingManagerCallerSession) GetTranscoderEarningsPoolForRound(_transcoder common.Address, _round *big.Int) (struct { - RewardPool *big.Int - FeePool *big.Int - TotalStake *big.Int - ClaimableStake *big.Int + RewardPool *big.Int + FeePool *big.Int + TotalStake *big.Int + ClaimableStake *big.Int + TranscoderRewardCut *big.Int + TranscoderFeeShare *big.Int + TranscoderRewardPool *big.Int + TranscoderFeePool *big.Int + HasTranscoderRewardFeePool bool }, error) { return _BondingManager.Contract.GetTranscoderEarningsPoolForRound(&_BondingManager.CallOpts, _transcoder, _round) } @@ -640,7 +672,7 @@ func (_BondingManager *BondingManagerCallerSession) GetTranscoderPoolSize() (*bi // IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. // -// Solidity: function isActiveTranscoder(_transcoder address, _round uint256) constant returns(bool) +// Solidity: function isActiveTranscoder(address _transcoder, uint256 _round) constant returns(bool) func (_BondingManager *BondingManagerCaller) IsActiveTranscoder(opts *bind.CallOpts, _transcoder common.Address, _round *big.Int) (bool, error) { var ( ret0 = new(bool) @@ -652,21 +684,21 @@ func (_BondingManager *BondingManagerCaller) IsActiveTranscoder(opts *bind.CallO // IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. // -// Solidity: function isActiveTranscoder(_transcoder address, _round uint256) constant returns(bool) +// Solidity: function isActiveTranscoder(address _transcoder, uint256 _round) constant returns(bool) func (_BondingManager *BondingManagerSession) IsActiveTranscoder(_transcoder common.Address, _round *big.Int) (bool, error) { return _BondingManager.Contract.IsActiveTranscoder(&_BondingManager.CallOpts, _transcoder, _round) } // IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. // -// Solidity: function isActiveTranscoder(_transcoder address, _round uint256) constant returns(bool) +// Solidity: function isActiveTranscoder(address _transcoder, uint256 _round) constant returns(bool) func (_BondingManager *BondingManagerCallerSession) IsActiveTranscoder(_transcoder common.Address, _round *big.Int) (bool, error) { return _BondingManager.Contract.IsActiveTranscoder(&_BondingManager.CallOpts, _transcoder, _round) } // IsRegisteredTranscoder is a free data retrieval call binding the contract method 0x68ba170c. // -// Solidity: function isRegisteredTranscoder(_transcoder address) constant returns(bool) +// Solidity: function isRegisteredTranscoder(address _transcoder) constant returns(bool) func (_BondingManager *BondingManagerCaller) IsRegisteredTranscoder(opts *bind.CallOpts, _transcoder common.Address) (bool, error) { var ( ret0 = new(bool) @@ -678,21 +710,21 @@ func (_BondingManager *BondingManagerCaller) IsRegisteredTranscoder(opts *bind.C // IsRegisteredTranscoder is a free data retrieval call binding the contract method 0x68ba170c. // -// Solidity: function isRegisteredTranscoder(_transcoder address) constant returns(bool) +// Solidity: function isRegisteredTranscoder(address _transcoder) constant returns(bool) func (_BondingManager *BondingManagerSession) IsRegisteredTranscoder(_transcoder common.Address) (bool, error) { return _BondingManager.Contract.IsRegisteredTranscoder(&_BondingManager.CallOpts, _transcoder) } // IsRegisteredTranscoder is a free data retrieval call binding the contract method 0x68ba170c. // -// Solidity: function isRegisteredTranscoder(_transcoder address) constant returns(bool) +// Solidity: function isRegisteredTranscoder(address _transcoder) constant returns(bool) func (_BondingManager *BondingManagerCallerSession) IsRegisteredTranscoder(_transcoder common.Address) (bool, error) { return _BondingManager.Contract.IsRegisteredTranscoder(&_BondingManager.CallOpts, _transcoder) } // IsValidUnbondingLock is a free data retrieval call binding the contract method 0x0fd02fc1. // -// Solidity: function isValidUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(bool) +// Solidity: function isValidUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(bool) func (_BondingManager *BondingManagerCaller) IsValidUnbondingLock(opts *bind.CallOpts, _delegator common.Address, _unbondingLockId *big.Int) (bool, error) { var ( ret0 = new(bool) @@ -704,14 +736,14 @@ func (_BondingManager *BondingManagerCaller) IsValidUnbondingLock(opts *bind.Cal // IsValidUnbondingLock is a free data retrieval call binding the contract method 0x0fd02fc1. // -// Solidity: function isValidUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(bool) +// Solidity: function isValidUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(bool) func (_BondingManager *BondingManagerSession) IsValidUnbondingLock(_delegator common.Address, _unbondingLockId *big.Int) (bool, error) { return _BondingManager.Contract.IsValidUnbondingLock(&_BondingManager.CallOpts, _delegator, _unbondingLockId) } // IsValidUnbondingLock is a free data retrieval call binding the contract method 0x0fd02fc1. // -// Solidity: function isValidUnbondingLock(_delegator address, _unbondingLockId uint256) constant returns(bool) +// Solidity: function isValidUnbondingLock(address _delegator, uint256 _unbondingLockId) constant returns(bool) func (_BondingManager *BondingManagerCallerSession) IsValidUnbondingLock(_delegator common.Address, _unbondingLockId *big.Int) (bool, error) { return _BondingManager.Contract.IsValidUnbondingLock(&_BondingManager.CallOpts, _delegator, _unbondingLockId) } @@ -770,7 +802,7 @@ func (_BondingManager *BondingManagerCallerSession) NumActiveTranscoders() (*big // PendingFees is a free data retrieval call binding the contract method 0xf595f1cc. // -// Solidity: function pendingFees(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingFees(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerCaller) PendingFees(opts *bind.CallOpts, _delegator common.Address, _endRound *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -782,21 +814,21 @@ func (_BondingManager *BondingManagerCaller) PendingFees(opts *bind.CallOpts, _d // PendingFees is a free data retrieval call binding the contract method 0xf595f1cc. // -// Solidity: function pendingFees(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingFees(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerSession) PendingFees(_delegator common.Address, _endRound *big.Int) (*big.Int, error) { return _BondingManager.Contract.PendingFees(&_BondingManager.CallOpts, _delegator, _endRound) } // PendingFees is a free data retrieval call binding the contract method 0xf595f1cc. // -// Solidity: function pendingFees(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingFees(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerCallerSession) PendingFees(_delegator common.Address, _endRound *big.Int) (*big.Int, error) { return _BondingManager.Contract.PendingFees(&_BondingManager.CallOpts, _delegator, _endRound) } // PendingStake is a free data retrieval call binding the contract method 0x9d0b2c7a. // -// Solidity: function pendingStake(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingStake(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerCaller) PendingStake(opts *bind.CallOpts, _delegator common.Address, _endRound *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -808,14 +840,14 @@ func (_BondingManager *BondingManagerCaller) PendingStake(opts *bind.CallOpts, _ // PendingStake is a free data retrieval call binding the contract method 0x9d0b2c7a. // -// Solidity: function pendingStake(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingStake(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerSession) PendingStake(_delegator common.Address, _endRound *big.Int) (*big.Int, error) { return _BondingManager.Contract.PendingStake(&_BondingManager.CallOpts, _delegator, _endRound) } // PendingStake is a free data retrieval call binding the contract method 0x9d0b2c7a. // -// Solidity: function pendingStake(_delegator address, _endRound uint256) constant returns(uint256) +// Solidity: function pendingStake(address _delegator, uint256 _endRound) constant returns(uint256) func (_BondingManager *BondingManagerCallerSession) PendingStake(_delegator common.Address, _endRound *big.Int) (*big.Int, error) { return _BondingManager.Contract.PendingStake(&_BondingManager.CallOpts, _delegator, _endRound) } @@ -848,7 +880,7 @@ func (_BondingManager *BondingManagerCallerSession) TargetContractId() ([32]byte // TranscoderStatus is a free data retrieval call binding the contract method 0x8b2f1652. // -// Solidity: function transcoderStatus(_transcoder address) constant returns(uint8) +// Solidity: function transcoderStatus(address _transcoder) constant returns(uint8) func (_BondingManager *BondingManagerCaller) TranscoderStatus(opts *bind.CallOpts, _transcoder common.Address) (uint8, error) { var ( ret0 = new(uint8) @@ -860,21 +892,21 @@ func (_BondingManager *BondingManagerCaller) TranscoderStatus(opts *bind.CallOpt // TranscoderStatus is a free data retrieval call binding the contract method 0x8b2f1652. // -// Solidity: function transcoderStatus(_transcoder address) constant returns(uint8) +// Solidity: function transcoderStatus(address _transcoder) constant returns(uint8) func (_BondingManager *BondingManagerSession) TranscoderStatus(_transcoder common.Address) (uint8, error) { return _BondingManager.Contract.TranscoderStatus(&_BondingManager.CallOpts, _transcoder) } // TranscoderStatus is a free data retrieval call binding the contract method 0x8b2f1652. // -// Solidity: function transcoderStatus(_transcoder address) constant returns(uint8) +// Solidity: function transcoderStatus(address _transcoder) constant returns(uint8) func (_BondingManager *BondingManagerCallerSession) TranscoderStatus(_transcoder common.Address) (uint8, error) { return _BondingManager.Contract.TranscoderStatus(&_BondingManager.CallOpts, _transcoder) } // TranscoderTotalStake is a free data retrieval call binding the contract method 0x9ef9df94. // -// Solidity: function transcoderTotalStake(_transcoder address) constant returns(uint256) +// Solidity: function transcoderTotalStake(address _transcoder) constant returns(uint256) func (_BondingManager *BondingManagerCaller) TranscoderTotalStake(opts *bind.CallOpts, _transcoder common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -886,14 +918,14 @@ func (_BondingManager *BondingManagerCaller) TranscoderTotalStake(opts *bind.Cal // TranscoderTotalStake is a free data retrieval call binding the contract method 0x9ef9df94. // -// Solidity: function transcoderTotalStake(_transcoder address) constant returns(uint256) +// Solidity: function transcoderTotalStake(address _transcoder) constant returns(uint256) func (_BondingManager *BondingManagerSession) TranscoderTotalStake(_transcoder common.Address) (*big.Int, error) { return _BondingManager.Contract.TranscoderTotalStake(&_BondingManager.CallOpts, _transcoder) } // TranscoderTotalStake is a free data retrieval call binding the contract method 0x9ef9df94. // -// Solidity: function transcoderTotalStake(_transcoder address) constant returns(uint256) +// Solidity: function transcoderTotalStake(address _transcoder) constant returns(uint256) func (_BondingManager *BondingManagerCallerSession) TranscoderTotalStake(_transcoder common.Address) (*big.Int, error) { return _BondingManager.Contract.TranscoderTotalStake(&_BondingManager.CallOpts, _transcoder) } @@ -926,84 +958,84 @@ func (_BondingManager *BondingManagerCallerSession) UnbondingPeriod() (uint64, e // Bond is a paid mutator transaction binding the contract method 0xb78d27dc. // -// Solidity: function bond(_amount uint256, _to address) returns() +// Solidity: function bond(uint256 _amount, address _to) returns() func (_BondingManager *BondingManagerTransactor) Bond(opts *bind.TransactOpts, _amount *big.Int, _to common.Address) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "bond", _amount, _to) } // Bond is a paid mutator transaction binding the contract method 0xb78d27dc. // -// Solidity: function bond(_amount uint256, _to address) returns() +// Solidity: function bond(uint256 _amount, address _to) returns() func (_BondingManager *BondingManagerSession) Bond(_amount *big.Int, _to common.Address) (*types.Transaction, error) { return _BondingManager.Contract.Bond(&_BondingManager.TransactOpts, _amount, _to) } // Bond is a paid mutator transaction binding the contract method 0xb78d27dc. // -// Solidity: function bond(_amount uint256, _to address) returns() +// Solidity: function bond(uint256 _amount, address _to) returns() func (_BondingManager *BondingManagerTransactorSession) Bond(_amount *big.Int, _to common.Address) (*types.Transaction, error) { return _BondingManager.Contract.Bond(&_BondingManager.TransactOpts, _amount, _to) } // ClaimEarnings is a paid mutator transaction binding the contract method 0x24b1babf. // -// Solidity: function claimEarnings(_endRound uint256) returns() +// Solidity: function claimEarnings(uint256 _endRound) returns() func (_BondingManager *BondingManagerTransactor) ClaimEarnings(opts *bind.TransactOpts, _endRound *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "claimEarnings", _endRound) } // ClaimEarnings is a paid mutator transaction binding the contract method 0x24b1babf. // -// Solidity: function claimEarnings(_endRound uint256) returns() +// Solidity: function claimEarnings(uint256 _endRound) returns() func (_BondingManager *BondingManagerSession) ClaimEarnings(_endRound *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.ClaimEarnings(&_BondingManager.TransactOpts, _endRound) } // ClaimEarnings is a paid mutator transaction binding the contract method 0x24b1babf. // -// Solidity: function claimEarnings(_endRound uint256) returns() +// Solidity: function claimEarnings(uint256 _endRound) returns() func (_BondingManager *BondingManagerTransactorSession) ClaimEarnings(_endRound *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.ClaimEarnings(&_BondingManager.TransactOpts, _endRound) } // Rebond is a paid mutator transaction binding the contract method 0xeaffb3f9. // -// Solidity: function rebond(_unbondingLockId uint256) returns() +// Solidity: function rebond(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactor) Rebond(opts *bind.TransactOpts, _unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "rebond", _unbondingLockId) } // Rebond is a paid mutator transaction binding the contract method 0xeaffb3f9. // -// Solidity: function rebond(_unbondingLockId uint256) returns() +// Solidity: function rebond(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerSession) Rebond(_unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Rebond(&_BondingManager.TransactOpts, _unbondingLockId) } // Rebond is a paid mutator transaction binding the contract method 0xeaffb3f9. // -// Solidity: function rebond(_unbondingLockId uint256) returns() +// Solidity: function rebond(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactorSession) Rebond(_unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Rebond(&_BondingManager.TransactOpts, _unbondingLockId) } // RebondFromUnbonded is a paid mutator transaction binding the contract method 0x3a080e93. // -// Solidity: function rebondFromUnbonded(_to address, _unbondingLockId uint256) returns() +// Solidity: function rebondFromUnbonded(address _to, uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactor) RebondFromUnbonded(opts *bind.TransactOpts, _to common.Address, _unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "rebondFromUnbonded", _to, _unbondingLockId) } // RebondFromUnbonded is a paid mutator transaction binding the contract method 0x3a080e93. // -// Solidity: function rebondFromUnbonded(_to address, _unbondingLockId uint256) returns() +// Solidity: function rebondFromUnbonded(address _to, uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerSession) RebondFromUnbonded(_to common.Address, _unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.RebondFromUnbonded(&_BondingManager.TransactOpts, _to, _unbondingLockId) } // RebondFromUnbonded is a paid mutator transaction binding the contract method 0x3a080e93. // -// Solidity: function rebondFromUnbonded(_to address, _unbondingLockId uint256) returns() +// Solidity: function rebondFromUnbonded(address _to, uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactorSession) RebondFromUnbonded(_to common.Address, _unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.RebondFromUnbonded(&_BondingManager.TransactOpts, _to, _unbondingLockId) } @@ -1052,189 +1084,189 @@ func (_BondingManager *BondingManagerTransactorSession) SetActiveTranscoders() ( // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_BondingManager *BondingManagerTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "setController", _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_BondingManager *BondingManagerSession) SetController(_controller common.Address) (*types.Transaction, error) { return _BondingManager.Contract.SetController(&_BondingManager.TransactOpts, _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_BondingManager *BondingManagerTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { return _BondingManager.Contract.SetController(&_BondingManager.TransactOpts, _controller) } // SetMaxEarningsClaimsRounds is a paid mutator transaction binding the contract method 0x72d9f13d. // -// Solidity: function setMaxEarningsClaimsRounds(_maxEarningsClaimsRounds uint256) returns() +// Solidity: function setMaxEarningsClaimsRounds(uint256 _maxEarningsClaimsRounds) returns() func (_BondingManager *BondingManagerTransactor) SetMaxEarningsClaimsRounds(opts *bind.TransactOpts, _maxEarningsClaimsRounds *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "setMaxEarningsClaimsRounds", _maxEarningsClaimsRounds) } // SetMaxEarningsClaimsRounds is a paid mutator transaction binding the contract method 0x72d9f13d. // -// Solidity: function setMaxEarningsClaimsRounds(_maxEarningsClaimsRounds uint256) returns() +// Solidity: function setMaxEarningsClaimsRounds(uint256 _maxEarningsClaimsRounds) returns() func (_BondingManager *BondingManagerSession) SetMaxEarningsClaimsRounds(_maxEarningsClaimsRounds *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetMaxEarningsClaimsRounds(&_BondingManager.TransactOpts, _maxEarningsClaimsRounds) } // SetMaxEarningsClaimsRounds is a paid mutator transaction binding the contract method 0x72d9f13d. // -// Solidity: function setMaxEarningsClaimsRounds(_maxEarningsClaimsRounds uint256) returns() +// Solidity: function setMaxEarningsClaimsRounds(uint256 _maxEarningsClaimsRounds) returns() func (_BondingManager *BondingManagerTransactorSession) SetMaxEarningsClaimsRounds(_maxEarningsClaimsRounds *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetMaxEarningsClaimsRounds(&_BondingManager.TransactOpts, _maxEarningsClaimsRounds) } // SetNumActiveTranscoders is a paid mutator transaction binding the contract method 0x673a456b. // -// Solidity: function setNumActiveTranscoders(_numActiveTranscoders uint256) returns() +// Solidity: function setNumActiveTranscoders(uint256 _numActiveTranscoders) returns() func (_BondingManager *BondingManagerTransactor) SetNumActiveTranscoders(opts *bind.TransactOpts, _numActiveTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "setNumActiveTranscoders", _numActiveTranscoders) } // SetNumActiveTranscoders is a paid mutator transaction binding the contract method 0x673a456b. // -// Solidity: function setNumActiveTranscoders(_numActiveTranscoders uint256) returns() +// Solidity: function setNumActiveTranscoders(uint256 _numActiveTranscoders) returns() func (_BondingManager *BondingManagerSession) SetNumActiveTranscoders(_numActiveTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetNumActiveTranscoders(&_BondingManager.TransactOpts, _numActiveTranscoders) } // SetNumActiveTranscoders is a paid mutator transaction binding the contract method 0x673a456b. // -// Solidity: function setNumActiveTranscoders(_numActiveTranscoders uint256) returns() +// Solidity: function setNumActiveTranscoders(uint256 _numActiveTranscoders) returns() func (_BondingManager *BondingManagerTransactorSession) SetNumActiveTranscoders(_numActiveTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetNumActiveTranscoders(&_BondingManager.TransactOpts, _numActiveTranscoders) } // SetNumTranscoders is a paid mutator transaction binding the contract method 0x60c79d00. // -// Solidity: function setNumTranscoders(_numTranscoders uint256) returns() +// Solidity: function setNumTranscoders(uint256 _numTranscoders) returns() func (_BondingManager *BondingManagerTransactor) SetNumTranscoders(opts *bind.TransactOpts, _numTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "setNumTranscoders", _numTranscoders) } // SetNumTranscoders is a paid mutator transaction binding the contract method 0x60c79d00. // -// Solidity: function setNumTranscoders(_numTranscoders uint256) returns() +// Solidity: function setNumTranscoders(uint256 _numTranscoders) returns() func (_BondingManager *BondingManagerSession) SetNumTranscoders(_numTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetNumTranscoders(&_BondingManager.TransactOpts, _numTranscoders) } // SetNumTranscoders is a paid mutator transaction binding the contract method 0x60c79d00. // -// Solidity: function setNumTranscoders(_numTranscoders uint256) returns() +// Solidity: function setNumTranscoders(uint256 _numTranscoders) returns() func (_BondingManager *BondingManagerTransactorSession) SetNumTranscoders(_numTranscoders *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SetNumTranscoders(&_BondingManager.TransactOpts, _numTranscoders) } // SetUnbondingPeriod is a paid mutator transaction binding the contract method 0xf10d1de1. // -// Solidity: function setUnbondingPeriod(_unbondingPeriod uint64) returns() +// Solidity: function setUnbondingPeriod(uint64 _unbondingPeriod) returns() func (_BondingManager *BondingManagerTransactor) SetUnbondingPeriod(opts *bind.TransactOpts, _unbondingPeriod uint64) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "setUnbondingPeriod", _unbondingPeriod) } // SetUnbondingPeriod is a paid mutator transaction binding the contract method 0xf10d1de1. // -// Solidity: function setUnbondingPeriod(_unbondingPeriod uint64) returns() +// Solidity: function setUnbondingPeriod(uint64 _unbondingPeriod) returns() func (_BondingManager *BondingManagerSession) SetUnbondingPeriod(_unbondingPeriod uint64) (*types.Transaction, error) { return _BondingManager.Contract.SetUnbondingPeriod(&_BondingManager.TransactOpts, _unbondingPeriod) } // SetUnbondingPeriod is a paid mutator transaction binding the contract method 0xf10d1de1. // -// Solidity: function setUnbondingPeriod(_unbondingPeriod uint64) returns() +// Solidity: function setUnbondingPeriod(uint64 _unbondingPeriod) returns() func (_BondingManager *BondingManagerTransactorSession) SetUnbondingPeriod(_unbondingPeriod uint64) (*types.Transaction, error) { return _BondingManager.Contract.SetUnbondingPeriod(&_BondingManager.TransactOpts, _unbondingPeriod) } // SlashTranscoder is a paid mutator transaction binding the contract method 0x22bf9d7c. // -// Solidity: function slashTranscoder(_transcoder address, _finder address, _slashAmount uint256, _finderFee uint256) returns() +// Solidity: function slashTranscoder(address _transcoder, address _finder, uint256 _slashAmount, uint256 _finderFee) returns() func (_BondingManager *BondingManagerTransactor) SlashTranscoder(opts *bind.TransactOpts, _transcoder common.Address, _finder common.Address, _slashAmount *big.Int, _finderFee *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "slashTranscoder", _transcoder, _finder, _slashAmount, _finderFee) } // SlashTranscoder is a paid mutator transaction binding the contract method 0x22bf9d7c. // -// Solidity: function slashTranscoder(_transcoder address, _finder address, _slashAmount uint256, _finderFee uint256) returns() +// Solidity: function slashTranscoder(address _transcoder, address _finder, uint256 _slashAmount, uint256 _finderFee) returns() func (_BondingManager *BondingManagerSession) SlashTranscoder(_transcoder common.Address, _finder common.Address, _slashAmount *big.Int, _finderFee *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SlashTranscoder(&_BondingManager.TransactOpts, _transcoder, _finder, _slashAmount, _finderFee) } // SlashTranscoder is a paid mutator transaction binding the contract method 0x22bf9d7c. // -// Solidity: function slashTranscoder(_transcoder address, _finder address, _slashAmount uint256, _finderFee uint256) returns() +// Solidity: function slashTranscoder(address _transcoder, address _finder, uint256 _slashAmount, uint256 _finderFee) returns() func (_BondingManager *BondingManagerTransactorSession) SlashTranscoder(_transcoder common.Address, _finder common.Address, _slashAmount *big.Int, _finderFee *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.SlashTranscoder(&_BondingManager.TransactOpts, _transcoder, _finder, _slashAmount, _finderFee) } // Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. // -// Solidity: function transcoder(_rewardCut uint256, _feeShare uint256, _pricePerSegment uint256) returns() +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare, uint256 _pricePerSegment) returns() func (_BondingManager *BondingManagerTransactor) Transcoder(opts *bind.TransactOpts, _rewardCut *big.Int, _feeShare *big.Int, _pricePerSegment *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "transcoder", _rewardCut, _feeShare, _pricePerSegment) } // Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. // -// Solidity: function transcoder(_rewardCut uint256, _feeShare uint256, _pricePerSegment uint256) returns() +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare, uint256 _pricePerSegment) returns() func (_BondingManager *BondingManagerSession) Transcoder(_rewardCut *big.Int, _feeShare *big.Int, _pricePerSegment *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Transcoder(&_BondingManager.TransactOpts, _rewardCut, _feeShare, _pricePerSegment) } // Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. // -// Solidity: function transcoder(_rewardCut uint256, _feeShare uint256, _pricePerSegment uint256) returns() +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare, uint256 _pricePerSegment) returns() func (_BondingManager *BondingManagerTransactorSession) Transcoder(_rewardCut *big.Int, _feeShare *big.Int, _pricePerSegment *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Transcoder(&_BondingManager.TransactOpts, _rewardCut, _feeShare, _pricePerSegment) } // Unbond is a paid mutator transaction binding the contract method 0x27de9e32. // -// Solidity: function unbond(_amount uint256) returns() +// Solidity: function unbond(uint256 _amount) returns() func (_BondingManager *BondingManagerTransactor) Unbond(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "unbond", _amount) } // Unbond is a paid mutator transaction binding the contract method 0x27de9e32. // -// Solidity: function unbond(_amount uint256) returns() +// Solidity: function unbond(uint256 _amount) returns() func (_BondingManager *BondingManagerSession) Unbond(_amount *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Unbond(&_BondingManager.TransactOpts, _amount) } // Unbond is a paid mutator transaction binding the contract method 0x27de9e32. // -// Solidity: function unbond(_amount uint256) returns() +// Solidity: function unbond(uint256 _amount) returns() func (_BondingManager *BondingManagerTransactorSession) Unbond(_amount *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.Unbond(&_BondingManager.TransactOpts, _amount) } // UpdateTranscoderWithFees is a paid mutator transaction binding the contract method 0x3aeb512c. // -// Solidity: function updateTranscoderWithFees(_transcoder address, _fees uint256, _round uint256) returns() +// Solidity: function updateTranscoderWithFees(address _transcoder, uint256 _fees, uint256 _round) returns() func (_BondingManager *BondingManagerTransactor) UpdateTranscoderWithFees(opts *bind.TransactOpts, _transcoder common.Address, _fees *big.Int, _round *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "updateTranscoderWithFees", _transcoder, _fees, _round) } // UpdateTranscoderWithFees is a paid mutator transaction binding the contract method 0x3aeb512c. // -// Solidity: function updateTranscoderWithFees(_transcoder address, _fees uint256, _round uint256) returns() +// Solidity: function updateTranscoderWithFees(address _transcoder, uint256 _fees, uint256 _round) returns() func (_BondingManager *BondingManagerSession) UpdateTranscoderWithFees(_transcoder common.Address, _fees *big.Int, _round *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.UpdateTranscoderWithFees(&_BondingManager.TransactOpts, _transcoder, _fees, _round) } // UpdateTranscoderWithFees is a paid mutator transaction binding the contract method 0x3aeb512c. // -// Solidity: function updateTranscoderWithFees(_transcoder address, _fees uint256, _round uint256) returns() +// Solidity: function updateTranscoderWithFees(address _transcoder, uint256 _fees, uint256 _round) returns() func (_BondingManager *BondingManagerTransactorSession) UpdateTranscoderWithFees(_transcoder common.Address, _fees *big.Int, _round *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.UpdateTranscoderWithFees(&_BondingManager.TransactOpts, _transcoder, _fees, _round) } @@ -1262,21 +1294,21 @@ func (_BondingManager *BondingManagerTransactorSession) WithdrawFees() (*types.T // WithdrawStake is a paid mutator transaction binding the contract method 0x25d5971f. // -// Solidity: function withdrawStake(_unbondingLockId uint256) returns() +// Solidity: function withdrawStake(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactor) WithdrawStake(opts *bind.TransactOpts, _unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.contract.Transact(opts, "withdrawStake", _unbondingLockId) } // WithdrawStake is a paid mutator transaction binding the contract method 0x25d5971f. // -// Solidity: function withdrawStake(_unbondingLockId uint256) returns() +// Solidity: function withdrawStake(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerSession) WithdrawStake(_unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.WithdrawStake(&_BondingManager.TransactOpts, _unbondingLockId) } // WithdrawStake is a paid mutator transaction binding the contract method 0x25d5971f. // -// Solidity: function withdrawStake(_unbondingLockId uint256) returns() +// Solidity: function withdrawStake(uint256 _unbondingLockId) returns() func (_BondingManager *BondingManagerTransactorSession) WithdrawStake(_unbondingLockId *big.Int) (*types.Transaction, error) { return _BondingManager.Contract.WithdrawStake(&_BondingManager.TransactOpts, _unbondingLockId) } @@ -1350,47 +1382,58 @@ func (it *BondingManagerBondIterator) Close() error { // BondingManagerBond represents a Bond event raised by the BondingManager contract. type BondingManagerBond struct { - Delegate common.Address - Delegator common.Address - Raw types.Log // Blockchain specific contextual infos + NewDelegate common.Address + OldDelegate common.Address + Delegator common.Address + AdditionalAmount *big.Int + BondedAmount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterBond is a free log retrieval operation binding the contract event 0x926f98e4b543897a75b3e34b7494ba68a47829d3aa39ffd9c478ccc51bfbfb44. +// FilterBond is a free log retrieval operation binding the contract event 0xe5917769f276ddca9f2ee7c6b0b33e1d1e1b61008010ce622c632dd20d168a23. // -// Solidity: event Bond(delegate indexed address, delegator indexed address) -func (_BondingManager *BondingManagerFilterer) FilterBond(opts *bind.FilterOpts, delegate []common.Address, delegator []common.Address) (*BondingManagerBondIterator, error) { +// Solidity: event Bond(address indexed newDelegate, address indexed oldDelegate, address indexed delegator, uint256 additionalAmount, uint256 bondedAmount) +func (_BondingManager *BondingManagerFilterer) FilterBond(opts *bind.FilterOpts, newDelegate []common.Address, oldDelegate []common.Address, delegator []common.Address) (*BondingManagerBondIterator, error) { - var delegateRule []interface{} - for _, delegateItem := range delegate { - delegateRule = append(delegateRule, delegateItem) + var newDelegateRule []interface{} + for _, newDelegateItem := range newDelegate { + newDelegateRule = append(newDelegateRule, newDelegateItem) + } + var oldDelegateRule []interface{} + for _, oldDelegateItem := range oldDelegate { + oldDelegateRule = append(oldDelegateRule, oldDelegateItem) } var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } - logs, sub, err := _BondingManager.contract.FilterLogs(opts, "Bond", delegateRule, delegatorRule) + logs, sub, err := _BondingManager.contract.FilterLogs(opts, "Bond", newDelegateRule, oldDelegateRule, delegatorRule) if err != nil { return nil, err } return &BondingManagerBondIterator{contract: _BondingManager.contract, event: "Bond", logs: logs, sub: sub}, nil } -// WatchBond is a free log subscription operation binding the contract event 0x926f98e4b543897a75b3e34b7494ba68a47829d3aa39ffd9c478ccc51bfbfb44. +// WatchBond is a free log subscription operation binding the contract event 0xe5917769f276ddca9f2ee7c6b0b33e1d1e1b61008010ce622c632dd20d168a23. // -// Solidity: event Bond(delegate indexed address, delegator indexed address) -func (_BondingManager *BondingManagerFilterer) WatchBond(opts *bind.WatchOpts, sink chan<- *BondingManagerBond, delegate []common.Address, delegator []common.Address) (event.Subscription, error) { +// Solidity: event Bond(address indexed newDelegate, address indexed oldDelegate, address indexed delegator, uint256 additionalAmount, uint256 bondedAmount) +func (_BondingManager *BondingManagerFilterer) WatchBond(opts *bind.WatchOpts, sink chan<- *BondingManagerBond, newDelegate []common.Address, oldDelegate []common.Address, delegator []common.Address) (event.Subscription, error) { - var delegateRule []interface{} - for _, delegateItem := range delegate { - delegateRule = append(delegateRule, delegateItem) + var newDelegateRule []interface{} + for _, newDelegateItem := range newDelegate { + newDelegateRule = append(newDelegateRule, newDelegateItem) + } + var oldDelegateRule []interface{} + for _, oldDelegateItem := range oldDelegate { + oldDelegateRule = append(oldDelegateRule, oldDelegateItem) } var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } - logs, sub, err := _BondingManager.contract.WatchLogs(opts, "Bond", delegateRule, delegatorRule) + logs, sub, err := _BondingManager.contract.WatchLogs(opts, "Bond", newDelegateRule, oldDelegateRule, delegatorRule) if err != nil { return nil, err } @@ -1497,7 +1540,7 @@ type BondingManagerParameterUpdate struct { // FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_BondingManager *BondingManagerFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*BondingManagerParameterUpdateIterator, error) { logs, sub, err := _BondingManager.contract.FilterLogs(opts, "ParameterUpdate") @@ -1509,7 +1552,7 @@ func (_BondingManager *BondingManagerFilterer) FilterParameterUpdate(opts *bind. // WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_BondingManager *BondingManagerFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *BondingManagerParameterUpdate) (event.Subscription, error) { logs, sub, err := _BondingManager.contract.WatchLogs(opts, "ParameterUpdate") @@ -1622,7 +1665,7 @@ type BondingManagerRebond struct { // FilterRebond is a free log retrieval operation binding the contract event 0x9f5b64cc71e1e26ff178caaa7877a04d8ce66fde989251870e80e6fbee690c17. // -// Solidity: event Rebond(delegate indexed address, delegator indexed address, unbondingLockId uint256, amount uint256) +// Solidity: event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount) func (_BondingManager *BondingManagerFilterer) FilterRebond(opts *bind.FilterOpts, delegate []common.Address, delegator []common.Address) (*BondingManagerRebondIterator, error) { var delegateRule []interface{} @@ -1643,7 +1686,7 @@ func (_BondingManager *BondingManagerFilterer) FilterRebond(opts *bind.FilterOpt // WatchRebond is a free log subscription operation binding the contract event 0x9f5b64cc71e1e26ff178caaa7877a04d8ce66fde989251870e80e6fbee690c17. // -// Solidity: event Rebond(delegate indexed address, delegator indexed address, unbondingLockId uint256, amount uint256) +// Solidity: event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount) func (_BondingManager *BondingManagerFilterer) WatchRebond(opts *bind.WatchOpts, sink chan<- *BondingManagerRebond, delegate []common.Address, delegator []common.Address) (event.Subscription, error) { var delegateRule []interface{} @@ -1763,7 +1806,7 @@ type BondingManagerReward struct { // FilterReward is a free log retrieval operation binding the contract event 0x619caafabdd75649b302ba8419e48cccf64f37f1983ac4727cfb38b57703ffc9. // -// Solidity: event Reward(transcoder indexed address, amount uint256) +// Solidity: event Reward(address indexed transcoder, uint256 amount) func (_BondingManager *BondingManagerFilterer) FilterReward(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerRewardIterator, error) { var transcoderRule []interface{} @@ -1780,7 +1823,7 @@ func (_BondingManager *BondingManagerFilterer) FilterReward(opts *bind.FilterOpt // WatchReward is a free log subscription operation binding the contract event 0x619caafabdd75649b302ba8419e48cccf64f37f1983ac4727cfb38b57703ffc9. // -// Solidity: event Reward(transcoder indexed address, amount uint256) +// Solidity: event Reward(address indexed transcoder, uint256 amount) func (_BondingManager *BondingManagerFilterer) WatchReward(opts *bind.WatchOpts, sink chan<- *BondingManagerReward, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -1895,7 +1938,7 @@ type BondingManagerSetController struct { // FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_BondingManager *BondingManagerFilterer) FilterSetController(opts *bind.FilterOpts) (*BondingManagerSetControllerIterator, error) { logs, sub, err := _BondingManager.contract.FilterLogs(opts, "SetController") @@ -1907,7 +1950,7 @@ func (_BondingManager *BondingManagerFilterer) FilterSetController(opts *bind.Fi // WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_BondingManager *BondingManagerFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *BondingManagerSetController) (event.Subscription, error) { logs, sub, err := _BondingManager.contract.WatchLogs(opts, "SetController") @@ -2017,7 +2060,7 @@ type BondingManagerTranscoderEvicted struct { // FilterTranscoderEvicted is a free log retrieval operation binding the contract event 0x0005588101bf85a737dacb8be2233b33113aaa5c5743525cfbfe2f6a77c2f6ff. // -// Solidity: event TranscoderEvicted(transcoder indexed address) +// Solidity: event TranscoderEvicted(address indexed transcoder) func (_BondingManager *BondingManagerFilterer) FilterTranscoderEvicted(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderEvictedIterator, error) { var transcoderRule []interface{} @@ -2034,7 +2077,7 @@ func (_BondingManager *BondingManagerFilterer) FilterTranscoderEvicted(opts *bin // WatchTranscoderEvicted is a free log subscription operation binding the contract event 0x0005588101bf85a737dacb8be2233b33113aaa5c5743525cfbfe2f6a77c2f6ff. // -// Solidity: event TranscoderEvicted(transcoder indexed address) +// Solidity: event TranscoderEvicted(address indexed transcoder) func (_BondingManager *BondingManagerFilterer) WatchTranscoderEvicted(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderEvicted, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -2149,7 +2192,7 @@ type BondingManagerTranscoderResigned struct { // FilterTranscoderResigned is a free log retrieval operation binding the contract event 0xc6be59bdc33151833b6dbb6823a9bddecde3c685a1bf4d253d20b4a93fbae56c. // -// Solidity: event TranscoderResigned(transcoder indexed address) +// Solidity: event TranscoderResigned(address indexed transcoder) func (_BondingManager *BondingManagerFilterer) FilterTranscoderResigned(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderResignedIterator, error) { var transcoderRule []interface{} @@ -2166,7 +2209,7 @@ func (_BondingManager *BondingManagerFilterer) FilterTranscoderResigned(opts *bi // WatchTranscoderResigned is a free log subscription operation binding the contract event 0xc6be59bdc33151833b6dbb6823a9bddecde3c685a1bf4d253d20b4a93fbae56c. // -// Solidity: event TranscoderResigned(transcoder indexed address) +// Solidity: event TranscoderResigned(address indexed transcoder) func (_BondingManager *BondingManagerFilterer) WatchTranscoderResigned(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderResigned, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -2284,7 +2327,7 @@ type BondingManagerTranscoderSlashed struct { // FilterTranscoderSlashed is a free log retrieval operation binding the contract event 0xf4b71fed8e2c9a8c67c388bc6d35ad20b9368a24eed6d565459f2b277b6c0c22. // -// Solidity: event TranscoderSlashed(transcoder indexed address, finder address, penalty uint256, finderReward uint256) +// Solidity: event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward) func (_BondingManager *BondingManagerFilterer) FilterTranscoderSlashed(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderSlashedIterator, error) { var transcoderRule []interface{} @@ -2301,7 +2344,7 @@ func (_BondingManager *BondingManagerFilterer) FilterTranscoderSlashed(opts *bin // WatchTranscoderSlashed is a free log subscription operation binding the contract event 0xf4b71fed8e2c9a8c67c388bc6d35ad20b9368a24eed6d565459f2b277b6c0c22. // -// Solidity: event TranscoderSlashed(transcoder indexed address, finder address, penalty uint256, finderReward uint256) +// Solidity: event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward) func (_BondingManager *BondingManagerFilterer) WatchTranscoderSlashed(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderSlashed, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -2420,7 +2463,7 @@ type BondingManagerTranscoderUpdate struct { // FilterTranscoderUpdate is a free log retrieval operation binding the contract event 0xe01026d5db477d9ceaec44dc8efd731e76bcbc51256aecba7d28dd1cb4968be7. // -// Solidity: event TranscoderUpdate(transcoder indexed address, pendingRewardCut uint256, pendingFeeShare uint256, pendingPricePerSegment uint256, registered bool) +// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered) func (_BondingManager *BondingManagerFilterer) FilterTranscoderUpdate(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderUpdateIterator, error) { var transcoderRule []interface{} @@ -2437,7 +2480,7 @@ func (_BondingManager *BondingManagerFilterer) FilterTranscoderUpdate(opts *bind // WatchTranscoderUpdate is a free log subscription operation binding the contract event 0xe01026d5db477d9ceaec44dc8efd731e76bcbc51256aecba7d28dd1cb4968be7. // -// Solidity: event TranscoderUpdate(transcoder indexed address, pendingRewardCut uint256, pendingFeeShare uint256, pendingPricePerSegment uint256, registered bool) +// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered) func (_BondingManager *BondingManagerFilterer) WatchTranscoderUpdate(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderUpdate, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -2556,7 +2599,7 @@ type BondingManagerUnbond struct { // FilterUnbond is a free log retrieval operation binding the contract event 0x2d5d98d189bee5496a08db2a5948cb7e5e786f09d17d0c3f228eb41776c24a06. // -// Solidity: event Unbond(delegate indexed address, delegator indexed address, unbondingLockId uint256, amount uint256, withdrawRound uint256) +// Solidity: event Unbond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerFilterer) FilterUnbond(opts *bind.FilterOpts, delegate []common.Address, delegator []common.Address) (*BondingManagerUnbondIterator, error) { var delegateRule []interface{} @@ -2577,7 +2620,7 @@ func (_BondingManager *BondingManagerFilterer) FilterUnbond(opts *bind.FilterOpt // WatchUnbond is a free log subscription operation binding the contract event 0x2d5d98d189bee5496a08db2a5948cb7e5e786f09d17d0c3f228eb41776c24a06. // -// Solidity: event Unbond(delegate indexed address, delegator indexed address, unbondingLockId uint256, amount uint256, withdrawRound uint256) +// Solidity: event Unbond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerFilterer) WatchUnbond(opts *bind.WatchOpts, sink chan<- *BondingManagerUnbond, delegate []common.Address, delegator []common.Address) (event.Subscription, error) { var delegateRule []interface{} @@ -2696,7 +2739,7 @@ type BondingManagerWithdrawFees struct { // FilterWithdrawFees is a free log retrieval operation binding the contract event 0xd3719f04262b628e1d01a6ed24707f542cda51f144b5271149c7d0419436d00c. // -// Solidity: event WithdrawFees(delegator indexed address) +// Solidity: event WithdrawFees(address indexed delegator) func (_BondingManager *BondingManagerFilterer) FilterWithdrawFees(opts *bind.FilterOpts, delegator []common.Address) (*BondingManagerWithdrawFeesIterator, error) { var delegatorRule []interface{} @@ -2713,7 +2756,7 @@ func (_BondingManager *BondingManagerFilterer) FilterWithdrawFees(opts *bind.Fil // WatchWithdrawFees is a free log subscription operation binding the contract event 0xd3719f04262b628e1d01a6ed24707f542cda51f144b5271149c7d0419436d00c. // -// Solidity: event WithdrawFees(delegator indexed address) +// Solidity: event WithdrawFees(address indexed delegator) func (_BondingManager *BondingManagerFilterer) WatchWithdrawFees(opts *bind.WatchOpts, sink chan<- *BondingManagerWithdrawFees, delegator []common.Address) (event.Subscription, error) { var delegatorRule []interface{} @@ -2831,7 +2874,7 @@ type BondingManagerWithdrawStake struct { // FilterWithdrawStake is a free log retrieval operation binding the contract event 0x1340f1a8f3d456a649e1a12071dfa15655e3d09252131d0f980c3b405cc8dd2e. // -// Solidity: event WithdrawStake(delegator indexed address, unbondingLockId uint256, amount uint256, withdrawRound uint256) +// Solidity: event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerFilterer) FilterWithdrawStake(opts *bind.FilterOpts, delegator []common.Address) (*BondingManagerWithdrawStakeIterator, error) { var delegatorRule []interface{} @@ -2848,7 +2891,7 @@ func (_BondingManager *BondingManagerFilterer) FilterWithdrawStake(opts *bind.Fi // WatchWithdrawStake is a free log subscription operation binding the contract event 0x1340f1a8f3d456a649e1a12071dfa15655e3d09252131d0f980c3b405cc8dd2e. // -// Solidity: event WithdrawStake(delegator indexed address, unbondingLockId uint256, amount uint256, withdrawRound uint256) +// Solidity: event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) func (_BondingManager *BondingManagerFilterer) WatchWithdrawStake(opts *bind.WatchOpts, sink chan<- *BondingManagerWithdrawStake, delegator []common.Address) (event.Subscription, error) { var delegatorRule []interface{} diff --git a/eth/contracts/controller.go b/eth/contracts/controller.go index 60e58edaa..f09721d31 100644 --- a/eth/contracts/controller.go +++ b/eth/contracts/controller.go @@ -4,6 +4,7 @@ package contracts import ( + "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" @@ -14,6 +15,18 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // ControllerABI is the input ABI used to generate the binding from. const ControllerABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"gitCommitHash\",\"type\":\"bytes20\"}],\"name\":\"SetContractInfo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Pause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_id\",\"type\":\"bytes32\"},{\"name\":\"_contractAddress\",\"type\":\"address\"},{\"name\":\"_gitCommitHash\",\"type\":\"bytes20\"}],\"name\":\"setContractInfo\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_id\",\"type\":\"bytes32\"},{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"updateController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"getContractInfo\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"bytes20\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"getContract\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" @@ -161,7 +174,7 @@ func (_Controller *ControllerTransactorRaw) Transact(opts *bind.TransactOpts, me // GetContract is a free data retrieval call binding the contract method 0xe16c7d98. // -// Solidity: function getContract(_id bytes32) constant returns(address) +// Solidity: function getContract(bytes32 _id) constant returns(address) func (_Controller *ControllerCaller) GetContract(opts *bind.CallOpts, _id [32]byte) (common.Address, error) { var ( ret0 = new(common.Address) @@ -173,21 +186,21 @@ func (_Controller *ControllerCaller) GetContract(opts *bind.CallOpts, _id [32]by // GetContract is a free data retrieval call binding the contract method 0xe16c7d98. // -// Solidity: function getContract(_id bytes32) constant returns(address) +// Solidity: function getContract(bytes32 _id) constant returns(address) func (_Controller *ControllerSession) GetContract(_id [32]byte) (common.Address, error) { return _Controller.Contract.GetContract(&_Controller.CallOpts, _id) } // GetContract is a free data retrieval call binding the contract method 0xe16c7d98. // -// Solidity: function getContract(_id bytes32) constant returns(address) +// Solidity: function getContract(bytes32 _id) constant returns(address) func (_Controller *ControllerCallerSession) GetContract(_id [32]byte) (common.Address, error) { return _Controller.Contract.GetContract(&_Controller.CallOpts, _id) } // GetContractInfo is a free data retrieval call binding the contract method 0x613e2de2. // -// Solidity: function getContractInfo(_id bytes32) constant returns(address, bytes20) +// Solidity: function getContractInfo(bytes32 _id) constant returns(address, bytes20) func (_Controller *ControllerCaller) GetContractInfo(opts *bind.CallOpts, _id [32]byte) (common.Address, [20]byte, error) { var ( ret0 = new(common.Address) @@ -203,14 +216,14 @@ func (_Controller *ControllerCaller) GetContractInfo(opts *bind.CallOpts, _id [3 // GetContractInfo is a free data retrieval call binding the contract method 0x613e2de2. // -// Solidity: function getContractInfo(_id bytes32) constant returns(address, bytes20) +// Solidity: function getContractInfo(bytes32 _id) constant returns(address, bytes20) func (_Controller *ControllerSession) GetContractInfo(_id [32]byte) (common.Address, [20]byte, error) { return _Controller.Contract.GetContractInfo(&_Controller.CallOpts, _id) } // GetContractInfo is a free data retrieval call binding the contract method 0x613e2de2. // -// Solidity: function getContractInfo(_id bytes32) constant returns(address, bytes20) +// Solidity: function getContractInfo(bytes32 _id) constant returns(address, bytes20) func (_Controller *ControllerCallerSession) GetContractInfo(_id [32]byte) (common.Address, [20]byte, error) { return _Controller.Contract.GetContractInfo(&_Controller.CallOpts, _id) } @@ -290,42 +303,42 @@ func (_Controller *ControllerTransactorSession) Pause() (*types.Transaction, err // SetContractInfo is a paid mutator transaction binding the contract method 0xd737c2b0. // -// Solidity: function setContractInfo(_id bytes32, _contractAddress address, _gitCommitHash bytes20) returns() +// Solidity: function setContractInfo(bytes32 _id, address _contractAddress, bytes20 _gitCommitHash) returns() func (_Controller *ControllerTransactor) SetContractInfo(opts *bind.TransactOpts, _id [32]byte, _contractAddress common.Address, _gitCommitHash [20]byte) (*types.Transaction, error) { return _Controller.contract.Transact(opts, "setContractInfo", _id, _contractAddress, _gitCommitHash) } // SetContractInfo is a paid mutator transaction binding the contract method 0xd737c2b0. // -// Solidity: function setContractInfo(_id bytes32, _contractAddress address, _gitCommitHash bytes20) returns() +// Solidity: function setContractInfo(bytes32 _id, address _contractAddress, bytes20 _gitCommitHash) returns() func (_Controller *ControllerSession) SetContractInfo(_id [32]byte, _contractAddress common.Address, _gitCommitHash [20]byte) (*types.Transaction, error) { return _Controller.Contract.SetContractInfo(&_Controller.TransactOpts, _id, _contractAddress, _gitCommitHash) } // SetContractInfo is a paid mutator transaction binding the contract method 0xd737c2b0. // -// Solidity: function setContractInfo(_id bytes32, _contractAddress address, _gitCommitHash bytes20) returns() +// Solidity: function setContractInfo(bytes32 _id, address _contractAddress, bytes20 _gitCommitHash) returns() func (_Controller *ControllerTransactorSession) SetContractInfo(_id [32]byte, _contractAddress common.Address, _gitCommitHash [20]byte) (*types.Transaction, error) { return _Controller.Contract.SetContractInfo(&_Controller.TransactOpts, _id, _contractAddress, _gitCommitHash) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_Controller *ControllerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _Controller.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_Controller *ControllerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Controller.Contract.TransferOwnership(&_Controller.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_Controller *ControllerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _Controller.Contract.TransferOwnership(&_Controller.TransactOpts, newOwner) } @@ -353,21 +366,21 @@ func (_Controller *ControllerTransactorSession) Unpause() (*types.Transaction, e // UpdateController is a paid mutator transaction binding the contract method 0xeb5dd94f. // -// Solidity: function updateController(_id bytes32, _controller address) returns() +// Solidity: function updateController(bytes32 _id, address _controller) returns() func (_Controller *ControllerTransactor) UpdateController(opts *bind.TransactOpts, _id [32]byte, _controller common.Address) (*types.Transaction, error) { return _Controller.contract.Transact(opts, "updateController", _id, _controller) } // UpdateController is a paid mutator transaction binding the contract method 0xeb5dd94f. // -// Solidity: function updateController(_id bytes32, _controller address) returns() +// Solidity: function updateController(bytes32 _id, address _controller) returns() func (_Controller *ControllerSession) UpdateController(_id [32]byte, _controller common.Address) (*types.Transaction, error) { return _Controller.Contract.UpdateController(&_Controller.TransactOpts, _id, _controller) } // UpdateController is a paid mutator transaction binding the contract method 0xeb5dd94f. // -// Solidity: function updateController(_id bytes32, _controller address) returns() +// Solidity: function updateController(bytes32 _id, address _controller) returns() func (_Controller *ControllerTransactorSession) UpdateController(_id [32]byte, _controller common.Address) (*types.Transaction, error) { return _Controller.Contract.UpdateController(&_Controller.TransactOpts, _id, _controller) } @@ -448,7 +461,7 @@ type ControllerOwnershipTransferred struct { // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Controller *ControllerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*ControllerOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} @@ -469,7 +482,7 @@ func (_Controller *ControllerFilterer) FilterOwnershipTransferred(opts *bind.Fil // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_Controller *ControllerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *ControllerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} @@ -711,7 +724,7 @@ type ControllerSetContractInfo struct { // FilterSetContractInfo is a free log retrieval operation binding the contract event 0xf9a6cf519167d81bc5cb3d26c60c0c9a19704aa908c148e82a861b570f4cd2d7. // -// Solidity: event SetContractInfo(id bytes32, contractAddress address, gitCommitHash bytes20) +// Solidity: event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash) func (_Controller *ControllerFilterer) FilterSetContractInfo(opts *bind.FilterOpts) (*ControllerSetContractInfoIterator, error) { logs, sub, err := _Controller.contract.FilterLogs(opts, "SetContractInfo") @@ -723,7 +736,7 @@ func (_Controller *ControllerFilterer) FilterSetContractInfo(opts *bind.FilterOp // WatchSetContractInfo is a free log subscription operation binding the contract event 0xf9a6cf519167d81bc5cb3d26c60c0c9a19704aa908c148e82a861b570f4cd2d7. // -// Solidity: event SetContractInfo(id bytes32, contractAddress address, gitCommitHash bytes20) +// Solidity: event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash) func (_Controller *ControllerFilterer) WatchSetContractInfo(opts *bind.WatchOpts, sink chan<- *ControllerSetContractInfo) (event.Subscription, error) { logs, sub, err := _Controller.contract.WatchLogs(opts, "SetContractInfo") diff --git a/eth/contracts/jobsManager.go b/eth/contracts/jobsManager.go deleted file mode 100644 index c85bf5011..000000000 --- a/eth/contracts/jobsManager.go +++ /dev/null @@ -1,2467 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package contracts - -import ( - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// JobsManagerABI is the input ABI used to generate the binding from. -const JobsManagerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"jobs\",\"outputs\":[{\"name\":\"jobId\",\"type\":\"uint256\"},{\"name\":\"streamId\",\"type\":\"string\"},{\"name\":\"transcodingOptions\",\"type\":\"string\"},{\"name\":\"maxPricePerSegment\",\"type\":\"uint256\"},{\"name\":\"broadcasterAddress\",\"type\":\"address\"},{\"name\":\"transcoderAddress\",\"type\":\"address\"},{\"name\":\"creationRound\",\"type\":\"uint256\"},{\"name\":\"creationBlock\",\"type\":\"uint256\"},{\"name\":\"endBlock\",\"type\":\"uint256\"},{\"name\":\"escrow\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"finderFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"missedVerificationSlashAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"doubleClaimSegmentSlashAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"verificationRate\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"broadcasters\",\"outputs\":[{\"name\":\"deposit\",\"type\":\"uint256\"},{\"name\":\"withdrawBlock\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numJobs\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"verificationSlashingPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"verificationPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"failedVerificationSlashAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"broadcaster\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"broadcaster\",\"type\":\"address\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"broadcaster\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"streamId\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"transcodingOptions\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"maxPricePerSegment\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"creationBlock\",\"type\":\"uint256\"}],\"name\":\"NewJob\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"claimId\",\"type\":\"uint256\"}],\"name\":\"NewClaim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"}],\"name\":\"Verify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"fees\",\"type\":\"uint256\"}],\"name\":\"DistributeFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"}],\"name\":\"PassedVerification\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"}],\"name\":\"FailedVerification\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_verificationRate\",\"type\":\"uint64\"}],\"name\":\"setVerificationRate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_verificationPeriod\",\"type\":\"uint256\"}],\"name\":\"setVerificationPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_verificationSlashingPeriod\",\"type\":\"uint256\"}],\"name\":\"setVerificationSlashingPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_failedVerificationSlashAmount\",\"type\":\"uint256\"}],\"name\":\"setFailedVerificationSlashAmount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_missedVerificationSlashAmount\",\"type\":\"uint256\"}],\"name\":\"setMissedVerificationSlashAmount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_doubleClaimSegmentSlashAmount\",\"type\":\"uint256\"}],\"name\":\"setDoubleClaimSegmentSlashAmount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_finderFee\",\"type\":\"uint256\"}],\"name\":\"setFinderFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_streamId\",\"type\":\"string\"},{\"name\":\"_transcodingOptions\",\"type\":\"string\"},{\"name\":\"_maxPricePerSegment\",\"type\":\"uint256\"},{\"name\":\"_endBlock\",\"type\":\"uint256\"}],\"name\":\"job\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_segmentRange\",\"type\":\"uint256[2]\"},{\"name\":\"_claimRoot\",\"type\":\"bytes32\"}],\"name\":\"claimWork\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"},{\"name\":\"_dataStorageHash\",\"type\":\"string\"},{\"name\":\"_dataHashes\",\"type\":\"bytes32[2]\"},{\"name\":\"_broadcasterSig\",\"type\":\"bytes\"},{\"name\":\"_proof\",\"type\":\"bytes\"}],\"name\":\"verify\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"},{\"name\":\"_result\",\"type\":\"bool\"}],\"name\":\"receiveVerification\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimIds\",\"type\":\"uint256[]\"}],\"name\":\"batchDistributeFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"}],\"name\":\"missedVerificationSlash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId1\",\"type\":\"uint256\"},{\"name\":\"_claimId2\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"}],\"name\":\"doubleClaimSegmentSlash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"}],\"name\":\"distributeFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"}],\"name\":\"jobStatus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"}],\"name\":\"getJob\",\"outputs\":[{\"name\":\"streamId\",\"type\":\"string\"},{\"name\":\"transcodingOptions\",\"type\":\"string\"},{\"name\":\"maxPricePerSegment\",\"type\":\"uint256\"},{\"name\":\"broadcasterAddress\",\"type\":\"address\"},{\"name\":\"transcoderAddress\",\"type\":\"address\"},{\"name\":\"creationRound\",\"type\":\"uint256\"},{\"name\":\"creationBlock\",\"type\":\"uint256\"},{\"name\":\"endBlock\",\"type\":\"uint256\"},{\"name\":\"escrow\",\"type\":\"uint256\"},{\"name\":\"totalClaims\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"}],\"name\":\"getClaim\",\"outputs\":[{\"name\":\"segmentRange\",\"type\":\"uint256[2]\"},{\"name\":\"claimRoot\",\"type\":\"bytes32\"},{\"name\":\"claimBlock\",\"type\":\"uint256\"},{\"name\":\"endVerificationBlock\",\"type\":\"uint256\"},{\"name\":\"endVerificationSlashingBlock\",\"type\":\"uint256\"},{\"name\":\"status\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"}],\"name\":\"isClaimSegmentVerified\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// JobsManager is an auto generated Go binding around an Ethereum contract. -type JobsManager struct { - JobsManagerCaller // Read-only binding to the contract - JobsManagerTransactor // Write-only binding to the contract - JobsManagerFilterer // Log filterer for contract events -} - -// JobsManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type JobsManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// JobsManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type JobsManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// JobsManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type JobsManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// JobsManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type JobsManagerSession struct { - Contract *JobsManager // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// JobsManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type JobsManagerCallerSession struct { - Contract *JobsManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// JobsManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type JobsManagerTransactorSession struct { - Contract *JobsManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// JobsManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type JobsManagerRaw struct { - Contract *JobsManager // Generic contract binding to access the raw methods on -} - -// JobsManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type JobsManagerCallerRaw struct { - Contract *JobsManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// JobsManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type JobsManagerTransactorRaw struct { - Contract *JobsManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewJobsManager creates a new instance of JobsManager, bound to a specific deployed contract. -func NewJobsManager(address common.Address, backend bind.ContractBackend) (*JobsManager, error) { - contract, err := bindJobsManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &JobsManager{JobsManagerCaller: JobsManagerCaller{contract: contract}, JobsManagerTransactor: JobsManagerTransactor{contract: contract}, JobsManagerFilterer: JobsManagerFilterer{contract: contract}}, nil -} - -// NewJobsManagerCaller creates a new read-only instance of JobsManager, bound to a specific deployed contract. -func NewJobsManagerCaller(address common.Address, caller bind.ContractCaller) (*JobsManagerCaller, error) { - contract, err := bindJobsManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &JobsManagerCaller{contract: contract}, nil -} - -// NewJobsManagerTransactor creates a new write-only instance of JobsManager, bound to a specific deployed contract. -func NewJobsManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*JobsManagerTransactor, error) { - contract, err := bindJobsManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &JobsManagerTransactor{contract: contract}, nil -} - -// NewJobsManagerFilterer creates a new log filterer instance of JobsManager, bound to a specific deployed contract. -func NewJobsManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*JobsManagerFilterer, error) { - contract, err := bindJobsManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &JobsManagerFilterer{contract: contract}, nil -} - -// bindJobsManager binds a generic wrapper to an already deployed contract. -func bindJobsManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(JobsManagerABI)) - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_JobsManager *JobsManagerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _JobsManager.Contract.JobsManagerCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_JobsManager *JobsManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _JobsManager.Contract.JobsManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_JobsManager *JobsManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _JobsManager.Contract.JobsManagerTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_JobsManager *JobsManagerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _JobsManager.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_JobsManager *JobsManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _JobsManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_JobsManager *JobsManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _JobsManager.Contract.contract.Transact(opts, method, params...) -} - -// Broadcasters is a free data retrieval call binding the contract method 0x88cc1093. -// -// Solidity: function broadcasters( address) constant returns(deposit uint256, withdrawBlock uint256) -func (_JobsManager *JobsManagerCaller) Broadcasters(opts *bind.CallOpts, arg0 common.Address) (struct { - Deposit *big.Int - WithdrawBlock *big.Int -}, error) { - ret := new(struct { - Deposit *big.Int - WithdrawBlock *big.Int - }) - out := ret - err := _JobsManager.contract.Call(opts, out, "broadcasters", arg0) - return *ret, err -} - -// Broadcasters is a free data retrieval call binding the contract method 0x88cc1093. -// -// Solidity: function broadcasters( address) constant returns(deposit uint256, withdrawBlock uint256) -func (_JobsManager *JobsManagerSession) Broadcasters(arg0 common.Address) (struct { - Deposit *big.Int - WithdrawBlock *big.Int -}, error) { - return _JobsManager.Contract.Broadcasters(&_JobsManager.CallOpts, arg0) -} - -// Broadcasters is a free data retrieval call binding the contract method 0x88cc1093. -// -// Solidity: function broadcasters( address) constant returns(deposit uint256, withdrawBlock uint256) -func (_JobsManager *JobsManagerCallerSession) Broadcasters(arg0 common.Address) (struct { - Deposit *big.Int - WithdrawBlock *big.Int -}, error) { - return _JobsManager.Contract.Broadcasters(&_JobsManager.CallOpts, arg0) -} - -// Controller is a free data retrieval call binding the contract method 0xf77c4791. -// -// Solidity: function controller() constant returns(address) -func (_JobsManager *JobsManagerCaller) Controller(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "controller") - return *ret0, err -} - -// Controller is a free data retrieval call binding the contract method 0xf77c4791. -// -// Solidity: function controller() constant returns(address) -func (_JobsManager *JobsManagerSession) Controller() (common.Address, error) { - return _JobsManager.Contract.Controller(&_JobsManager.CallOpts) -} - -// Controller is a free data retrieval call binding the contract method 0xf77c4791. -// -// Solidity: function controller() constant returns(address) -func (_JobsManager *JobsManagerCallerSession) Controller() (common.Address, error) { - return _JobsManager.Contract.Controller(&_JobsManager.CallOpts) -} - -// DoubleClaimSegmentSlashAmount is a free data retrieval call binding the contract method 0x6d7221d5. -// -// Solidity: function doubleClaimSegmentSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) DoubleClaimSegmentSlashAmount(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "doubleClaimSegmentSlashAmount") - return *ret0, err -} - -// DoubleClaimSegmentSlashAmount is a free data retrieval call binding the contract method 0x6d7221d5. -// -// Solidity: function doubleClaimSegmentSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerSession) DoubleClaimSegmentSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.DoubleClaimSegmentSlashAmount(&_JobsManager.CallOpts) -} - -// DoubleClaimSegmentSlashAmount is a free data retrieval call binding the contract method 0x6d7221d5. -// -// Solidity: function doubleClaimSegmentSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) DoubleClaimSegmentSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.DoubleClaimSegmentSlashAmount(&_JobsManager.CallOpts) -} - -// FailedVerificationSlashAmount is a free data retrieval call binding the contract method 0xbe5c2423. -// -// Solidity: function failedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) FailedVerificationSlashAmount(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "failedVerificationSlashAmount") - return *ret0, err -} - -// FailedVerificationSlashAmount is a free data retrieval call binding the contract method 0xbe5c2423. -// -// Solidity: function failedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerSession) FailedVerificationSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.FailedVerificationSlashAmount(&_JobsManager.CallOpts) -} - -// FailedVerificationSlashAmount is a free data retrieval call binding the contract method 0xbe5c2423. -// -// Solidity: function failedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) FailedVerificationSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.FailedVerificationSlashAmount(&_JobsManager.CallOpts) -} - -// FinderFee is a free data retrieval call binding the contract method 0x1e6b0e44. -// -// Solidity: function finderFee() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) FinderFee(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "finderFee") - return *ret0, err -} - -// FinderFee is a free data retrieval call binding the contract method 0x1e6b0e44. -// -// Solidity: function finderFee() constant returns(uint256) -func (_JobsManager *JobsManagerSession) FinderFee() (*big.Int, error) { - return _JobsManager.Contract.FinderFee(&_JobsManager.CallOpts) -} - -// FinderFee is a free data retrieval call binding the contract method 0x1e6b0e44. -// -// Solidity: function finderFee() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) FinderFee() (*big.Int, error) { - return _JobsManager.Contract.FinderFee(&_JobsManager.CallOpts) -} - -// GetClaim is a free data retrieval call binding the contract method 0x427a2fc2. -// -// Solidity: function getClaim(_jobId uint256, _claimId uint256) constant returns(segmentRange uint256[2], claimRoot bytes32, claimBlock uint256, endVerificationBlock uint256, endVerificationSlashingBlock uint256, status uint8) -func (_JobsManager *JobsManagerCaller) GetClaim(opts *bind.CallOpts, _jobId *big.Int, _claimId *big.Int) (struct { - SegmentRange [2]*big.Int - ClaimRoot [32]byte - ClaimBlock *big.Int - EndVerificationBlock *big.Int - EndVerificationSlashingBlock *big.Int - Status uint8 -}, error) { - ret := new(struct { - SegmentRange [2]*big.Int - ClaimRoot [32]byte - ClaimBlock *big.Int - EndVerificationBlock *big.Int - EndVerificationSlashingBlock *big.Int - Status uint8 - }) - out := ret - err := _JobsManager.contract.Call(opts, out, "getClaim", _jobId, _claimId) - return *ret, err -} - -// GetClaim is a free data retrieval call binding the contract method 0x427a2fc2. -// -// Solidity: function getClaim(_jobId uint256, _claimId uint256) constant returns(segmentRange uint256[2], claimRoot bytes32, claimBlock uint256, endVerificationBlock uint256, endVerificationSlashingBlock uint256, status uint8) -func (_JobsManager *JobsManagerSession) GetClaim(_jobId *big.Int, _claimId *big.Int) (struct { - SegmentRange [2]*big.Int - ClaimRoot [32]byte - ClaimBlock *big.Int - EndVerificationBlock *big.Int - EndVerificationSlashingBlock *big.Int - Status uint8 -}, error) { - return _JobsManager.Contract.GetClaim(&_JobsManager.CallOpts, _jobId, _claimId) -} - -// GetClaim is a free data retrieval call binding the contract method 0x427a2fc2. -// -// Solidity: function getClaim(_jobId uint256, _claimId uint256) constant returns(segmentRange uint256[2], claimRoot bytes32, claimBlock uint256, endVerificationBlock uint256, endVerificationSlashingBlock uint256, status uint8) -func (_JobsManager *JobsManagerCallerSession) GetClaim(_jobId *big.Int, _claimId *big.Int) (struct { - SegmentRange [2]*big.Int - ClaimRoot [32]byte - ClaimBlock *big.Int - EndVerificationBlock *big.Int - EndVerificationSlashingBlock *big.Int - Status uint8 -}, error) { - return _JobsManager.Contract.GetClaim(&_JobsManager.CallOpts, _jobId, _claimId) -} - -// GetJob is a free data retrieval call binding the contract method 0xbf22c457. -// -// Solidity: function getJob(_jobId uint256) constant returns(streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256, totalClaims uint256) -func (_JobsManager *JobsManagerCaller) GetJob(opts *bind.CallOpts, _jobId *big.Int) (struct { - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - TotalClaims *big.Int -}, error) { - ret := new(struct { - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - TotalClaims *big.Int - }) - out := ret - err := _JobsManager.contract.Call(opts, out, "getJob", _jobId) - return *ret, err -} - -// GetJob is a free data retrieval call binding the contract method 0xbf22c457. -// -// Solidity: function getJob(_jobId uint256) constant returns(streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256, totalClaims uint256) -func (_JobsManager *JobsManagerSession) GetJob(_jobId *big.Int) (struct { - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - TotalClaims *big.Int -}, error) { - return _JobsManager.Contract.GetJob(&_JobsManager.CallOpts, _jobId) -} - -// GetJob is a free data retrieval call binding the contract method 0xbf22c457. -// -// Solidity: function getJob(_jobId uint256) constant returns(streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256, totalClaims uint256) -func (_JobsManager *JobsManagerCallerSession) GetJob(_jobId *big.Int) (struct { - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - TotalClaims *big.Int -}, error) { - return _JobsManager.Contract.GetJob(&_JobsManager.CallOpts, _jobId) -} - -// IsClaimSegmentVerified is a free data retrieval call binding the contract method 0x71d6dbe1. -// -// Solidity: function isClaimSegmentVerified(_jobId uint256, _claimId uint256, _segmentNumber uint256) constant returns(bool) -func (_JobsManager *JobsManagerCaller) IsClaimSegmentVerified(opts *bind.CallOpts, _jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "isClaimSegmentVerified", _jobId, _claimId, _segmentNumber) - return *ret0, err -} - -// IsClaimSegmentVerified is a free data retrieval call binding the contract method 0x71d6dbe1. -// -// Solidity: function isClaimSegmentVerified(_jobId uint256, _claimId uint256, _segmentNumber uint256) constant returns(bool) -func (_JobsManager *JobsManagerSession) IsClaimSegmentVerified(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (bool, error) { - return _JobsManager.Contract.IsClaimSegmentVerified(&_JobsManager.CallOpts, _jobId, _claimId, _segmentNumber) -} - -// IsClaimSegmentVerified is a free data retrieval call binding the contract method 0x71d6dbe1. -// -// Solidity: function isClaimSegmentVerified(_jobId uint256, _claimId uint256, _segmentNumber uint256) constant returns(bool) -func (_JobsManager *JobsManagerCallerSession) IsClaimSegmentVerified(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (bool, error) { - return _JobsManager.Contract.IsClaimSegmentVerified(&_JobsManager.CallOpts, _jobId, _claimId, _segmentNumber) -} - -// JobStatus is a free data retrieval call binding the contract method 0xa8e5e219. -// -// Solidity: function jobStatus(_jobId uint256) constant returns(uint8) -func (_JobsManager *JobsManagerCaller) JobStatus(opts *bind.CallOpts, _jobId *big.Int) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "jobStatus", _jobId) - return *ret0, err -} - -// JobStatus is a free data retrieval call binding the contract method 0xa8e5e219. -// -// Solidity: function jobStatus(_jobId uint256) constant returns(uint8) -func (_JobsManager *JobsManagerSession) JobStatus(_jobId *big.Int) (uint8, error) { - return _JobsManager.Contract.JobStatus(&_JobsManager.CallOpts, _jobId) -} - -// JobStatus is a free data retrieval call binding the contract method 0xa8e5e219. -// -// Solidity: function jobStatus(_jobId uint256) constant returns(uint8) -func (_JobsManager *JobsManagerCallerSession) JobStatus(_jobId *big.Int) (uint8, error) { - return _JobsManager.Contract.JobStatus(&_JobsManager.CallOpts, _jobId) -} - -// Jobs is a free data retrieval call binding the contract method 0x180aedf3. -// -// Solidity: function jobs( uint256) constant returns(jobId uint256, streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256) -func (_JobsManager *JobsManagerCaller) Jobs(opts *bind.CallOpts, arg0 *big.Int) (struct { - JobId *big.Int - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int -}, error) { - ret := new(struct { - JobId *big.Int - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - }) - out := ret - err := _JobsManager.contract.Call(opts, out, "jobs", arg0) - return *ret, err -} - -// Jobs is a free data retrieval call binding the contract method 0x180aedf3. -// -// Solidity: function jobs( uint256) constant returns(jobId uint256, streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256) -func (_JobsManager *JobsManagerSession) Jobs(arg0 *big.Int) (struct { - JobId *big.Int - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int -}, error) { - return _JobsManager.Contract.Jobs(&_JobsManager.CallOpts, arg0) -} - -// Jobs is a free data retrieval call binding the contract method 0x180aedf3. -// -// Solidity: function jobs( uint256) constant returns(jobId uint256, streamId string, transcodingOptions string, maxPricePerSegment uint256, broadcasterAddress address, transcoderAddress address, creationRound uint256, creationBlock uint256, endBlock uint256, escrow uint256) -func (_JobsManager *JobsManagerCallerSession) Jobs(arg0 *big.Int) (struct { - JobId *big.Int - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int -}, error) { - return _JobsManager.Contract.Jobs(&_JobsManager.CallOpts, arg0) -} - -// MissedVerificationSlashAmount is a free data retrieval call binding the contract method 0x32b5b2d1. -// -// Solidity: function missedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) MissedVerificationSlashAmount(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "missedVerificationSlashAmount") - return *ret0, err -} - -// MissedVerificationSlashAmount is a free data retrieval call binding the contract method 0x32b5b2d1. -// -// Solidity: function missedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerSession) MissedVerificationSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.MissedVerificationSlashAmount(&_JobsManager.CallOpts) -} - -// MissedVerificationSlashAmount is a free data retrieval call binding the contract method 0x32b5b2d1. -// -// Solidity: function missedVerificationSlashAmount() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) MissedVerificationSlashAmount() (*big.Int, error) { - return _JobsManager.Contract.MissedVerificationSlashAmount(&_JobsManager.CallOpts) -} - -// NumJobs is a free data retrieval call binding the contract method 0x9212051c. -// -// Solidity: function numJobs() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) NumJobs(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "numJobs") - return *ret0, err -} - -// NumJobs is a free data retrieval call binding the contract method 0x9212051c. -// -// Solidity: function numJobs() constant returns(uint256) -func (_JobsManager *JobsManagerSession) NumJobs() (*big.Int, error) { - return _JobsManager.Contract.NumJobs(&_JobsManager.CallOpts) -} - -// NumJobs is a free data retrieval call binding the contract method 0x9212051c. -// -// Solidity: function numJobs() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) NumJobs() (*big.Int, error) { - return _JobsManager.Contract.NumJobs(&_JobsManager.CallOpts) -} - -// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. -// -// Solidity: function targetContractId() constant returns(bytes32) -func (_JobsManager *JobsManagerCaller) TargetContractId(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "targetContractId") - return *ret0, err -} - -// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. -// -// Solidity: function targetContractId() constant returns(bytes32) -func (_JobsManager *JobsManagerSession) TargetContractId() ([32]byte, error) { - return _JobsManager.Contract.TargetContractId(&_JobsManager.CallOpts) -} - -// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. -// -// Solidity: function targetContractId() constant returns(bytes32) -func (_JobsManager *JobsManagerCallerSession) TargetContractId() ([32]byte, error) { - return _JobsManager.Contract.TargetContractId(&_JobsManager.CallOpts) -} - -// VerificationPeriod is a free data retrieval call binding the contract method 0xb1bb7e0f. -// -// Solidity: function verificationPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) VerificationPeriod(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "verificationPeriod") - return *ret0, err -} - -// VerificationPeriod is a free data retrieval call binding the contract method 0xb1bb7e0f. -// -// Solidity: function verificationPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerSession) VerificationPeriod() (*big.Int, error) { - return _JobsManager.Contract.VerificationPeriod(&_JobsManager.CallOpts) -} - -// VerificationPeriod is a free data retrieval call binding the contract method 0xb1bb7e0f. -// -// Solidity: function verificationPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) VerificationPeriod() (*big.Int, error) { - return _JobsManager.Contract.VerificationPeriod(&_JobsManager.CallOpts) -} - -// VerificationRate is a free data retrieval call binding the contract method 0x7af8b87d. -// -// Solidity: function verificationRate() constant returns(uint64) -func (_JobsManager *JobsManagerCaller) VerificationRate(opts *bind.CallOpts) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "verificationRate") - return *ret0, err -} - -// VerificationRate is a free data retrieval call binding the contract method 0x7af8b87d. -// -// Solidity: function verificationRate() constant returns(uint64) -func (_JobsManager *JobsManagerSession) VerificationRate() (uint64, error) { - return _JobsManager.Contract.VerificationRate(&_JobsManager.CallOpts) -} - -// VerificationRate is a free data retrieval call binding the contract method 0x7af8b87d. -// -// Solidity: function verificationRate() constant returns(uint64) -func (_JobsManager *JobsManagerCallerSession) VerificationRate() (uint64, error) { - return _JobsManager.Contract.VerificationRate(&_JobsManager.CallOpts) -} - -// VerificationSlashingPeriod is a free data retrieval call binding the contract method 0x9f37b53f. -// -// Solidity: function verificationSlashingPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerCaller) VerificationSlashingPeriod(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _JobsManager.contract.Call(opts, out, "verificationSlashingPeriod") - return *ret0, err -} - -// VerificationSlashingPeriod is a free data retrieval call binding the contract method 0x9f37b53f. -// -// Solidity: function verificationSlashingPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerSession) VerificationSlashingPeriod() (*big.Int, error) { - return _JobsManager.Contract.VerificationSlashingPeriod(&_JobsManager.CallOpts) -} - -// VerificationSlashingPeriod is a free data retrieval call binding the contract method 0x9f37b53f. -// -// Solidity: function verificationSlashingPeriod() constant returns(uint256) -func (_JobsManager *JobsManagerCallerSession) VerificationSlashingPeriod() (*big.Int, error) { - return _JobsManager.Contract.VerificationSlashingPeriod(&_JobsManager.CallOpts) -} - -// BatchDistributeFees is a paid mutator transaction binding the contract method 0x8978fc79. -// -// Solidity: function batchDistributeFees(_jobId uint256, _claimIds uint256[]) returns() -func (_JobsManager *JobsManagerTransactor) BatchDistributeFees(opts *bind.TransactOpts, _jobId *big.Int, _claimIds []*big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "batchDistributeFees", _jobId, _claimIds) -} - -// BatchDistributeFees is a paid mutator transaction binding the contract method 0x8978fc79. -// -// Solidity: function batchDistributeFees(_jobId uint256, _claimIds uint256[]) returns() -func (_JobsManager *JobsManagerSession) BatchDistributeFees(_jobId *big.Int, _claimIds []*big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.BatchDistributeFees(&_JobsManager.TransactOpts, _jobId, _claimIds) -} - -// BatchDistributeFees is a paid mutator transaction binding the contract method 0x8978fc79. -// -// Solidity: function batchDistributeFees(_jobId uint256, _claimIds uint256[]) returns() -func (_JobsManager *JobsManagerTransactorSession) BatchDistributeFees(_jobId *big.Int, _claimIds []*big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.BatchDistributeFees(&_JobsManager.TransactOpts, _jobId, _claimIds) -} - -// ClaimWork is a paid mutator transaction binding the contract method 0x3ffe5eb7. -// -// Solidity: function claimWork(_jobId uint256, _segmentRange uint256[2], _claimRoot bytes32) returns() -func (_JobsManager *JobsManagerTransactor) ClaimWork(opts *bind.TransactOpts, _jobId *big.Int, _segmentRange [2]*big.Int, _claimRoot [32]byte) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "claimWork", _jobId, _segmentRange, _claimRoot) -} - -// ClaimWork is a paid mutator transaction binding the contract method 0x3ffe5eb7. -// -// Solidity: function claimWork(_jobId uint256, _segmentRange uint256[2], _claimRoot bytes32) returns() -func (_JobsManager *JobsManagerSession) ClaimWork(_jobId *big.Int, _segmentRange [2]*big.Int, _claimRoot [32]byte) (*types.Transaction, error) { - return _JobsManager.Contract.ClaimWork(&_JobsManager.TransactOpts, _jobId, _segmentRange, _claimRoot) -} - -// ClaimWork is a paid mutator transaction binding the contract method 0x3ffe5eb7. -// -// Solidity: function claimWork(_jobId uint256, _segmentRange uint256[2], _claimRoot bytes32) returns() -func (_JobsManager *JobsManagerTransactorSession) ClaimWork(_jobId *big.Int, _segmentRange [2]*big.Int, _claimRoot [32]byte) (*types.Transaction, error) { - return _JobsManager.Contract.ClaimWork(&_JobsManager.TransactOpts, _jobId, _segmentRange, _claimRoot) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() returns() -func (_JobsManager *JobsManagerTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "deposit") -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() returns() -func (_JobsManager *JobsManagerSession) Deposit() (*types.Transaction, error) { - return _JobsManager.Contract.Deposit(&_JobsManager.TransactOpts) -} - -// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. -// -// Solidity: function deposit() returns() -func (_JobsManager *JobsManagerTransactorSession) Deposit() (*types.Transaction, error) { - return _JobsManager.Contract.Deposit(&_JobsManager.TransactOpts) -} - -// DistributeFees is a paid mutator transaction binding the contract method 0x7e69671a. -// -// Solidity: function distributeFees(_jobId uint256, _claimId uint256) returns() -func (_JobsManager *JobsManagerTransactor) DistributeFees(opts *bind.TransactOpts, _jobId *big.Int, _claimId *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "distributeFees", _jobId, _claimId) -} - -// DistributeFees is a paid mutator transaction binding the contract method 0x7e69671a. -// -// Solidity: function distributeFees(_jobId uint256, _claimId uint256) returns() -func (_JobsManager *JobsManagerSession) DistributeFees(_jobId *big.Int, _claimId *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.DistributeFees(&_JobsManager.TransactOpts, _jobId, _claimId) -} - -// DistributeFees is a paid mutator transaction binding the contract method 0x7e69671a. -// -// Solidity: function distributeFees(_jobId uint256, _claimId uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) DistributeFees(_jobId *big.Int, _claimId *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.DistributeFees(&_JobsManager.TransactOpts, _jobId, _claimId) -} - -// DoubleClaimSegmentSlash is a paid mutator transaction binding the contract method 0x64d563f1. -// -// Solidity: function doubleClaimSegmentSlash(_jobId uint256, _claimId1 uint256, _claimId2 uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerTransactor) DoubleClaimSegmentSlash(opts *bind.TransactOpts, _jobId *big.Int, _claimId1 *big.Int, _claimId2 *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "doubleClaimSegmentSlash", _jobId, _claimId1, _claimId2, _segmentNumber) -} - -// DoubleClaimSegmentSlash is a paid mutator transaction binding the contract method 0x64d563f1. -// -// Solidity: function doubleClaimSegmentSlash(_jobId uint256, _claimId1 uint256, _claimId2 uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerSession) DoubleClaimSegmentSlash(_jobId *big.Int, _claimId1 *big.Int, _claimId2 *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.DoubleClaimSegmentSlash(&_JobsManager.TransactOpts, _jobId, _claimId1, _claimId2, _segmentNumber) -} - -// DoubleClaimSegmentSlash is a paid mutator transaction binding the contract method 0x64d563f1. -// -// Solidity: function doubleClaimSegmentSlash(_jobId uint256, _claimId1 uint256, _claimId2 uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) DoubleClaimSegmentSlash(_jobId *big.Int, _claimId1 *big.Int, _claimId2 *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.DoubleClaimSegmentSlash(&_JobsManager.TransactOpts, _jobId, _claimId1, _claimId2, _segmentNumber) -} - -// Job is a paid mutator transaction binding the contract method 0x307c6f8e. -// -// Solidity: function job(_streamId string, _transcodingOptions string, _maxPricePerSegment uint256, _endBlock uint256) returns() -func (_JobsManager *JobsManagerTransactor) Job(opts *bind.TransactOpts, _streamId string, _transcodingOptions string, _maxPricePerSegment *big.Int, _endBlock *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "job", _streamId, _transcodingOptions, _maxPricePerSegment, _endBlock) -} - -// Job is a paid mutator transaction binding the contract method 0x307c6f8e. -// -// Solidity: function job(_streamId string, _transcodingOptions string, _maxPricePerSegment uint256, _endBlock uint256) returns() -func (_JobsManager *JobsManagerSession) Job(_streamId string, _transcodingOptions string, _maxPricePerSegment *big.Int, _endBlock *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.Job(&_JobsManager.TransactOpts, _streamId, _transcodingOptions, _maxPricePerSegment, _endBlock) -} - -// Job is a paid mutator transaction binding the contract method 0x307c6f8e. -// -// Solidity: function job(_streamId string, _transcodingOptions string, _maxPricePerSegment uint256, _endBlock uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) Job(_streamId string, _transcodingOptions string, _maxPricePerSegment *big.Int, _endBlock *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.Job(&_JobsManager.TransactOpts, _streamId, _transcodingOptions, _maxPricePerSegment, _endBlock) -} - -// MissedVerificationSlash is a paid mutator transaction binding the contract method 0xc8e8f487. -// -// Solidity: function missedVerificationSlash(_jobId uint256, _claimId uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerTransactor) MissedVerificationSlash(opts *bind.TransactOpts, _jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "missedVerificationSlash", _jobId, _claimId, _segmentNumber) -} - -// MissedVerificationSlash is a paid mutator transaction binding the contract method 0xc8e8f487. -// -// Solidity: function missedVerificationSlash(_jobId uint256, _claimId uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerSession) MissedVerificationSlash(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.MissedVerificationSlash(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber) -} - -// MissedVerificationSlash is a paid mutator transaction binding the contract method 0xc8e8f487. -// -// Solidity: function missedVerificationSlash(_jobId uint256, _claimId uint256, _segmentNumber uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) MissedVerificationSlash(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.MissedVerificationSlash(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber) -} - -// ReceiveVerification is a paid mutator transaction binding the contract method 0x1e0976f3. -// -// Solidity: function receiveVerification(_jobId uint256, _claimId uint256, _segmentNumber uint256, _result bool) returns() -func (_JobsManager *JobsManagerTransactor) ReceiveVerification(opts *bind.TransactOpts, _jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _result bool) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "receiveVerification", _jobId, _claimId, _segmentNumber, _result) -} - -// ReceiveVerification is a paid mutator transaction binding the contract method 0x1e0976f3. -// -// Solidity: function receiveVerification(_jobId uint256, _claimId uint256, _segmentNumber uint256, _result bool) returns() -func (_JobsManager *JobsManagerSession) ReceiveVerification(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _result bool) (*types.Transaction, error) { - return _JobsManager.Contract.ReceiveVerification(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber, _result) -} - -// ReceiveVerification is a paid mutator transaction binding the contract method 0x1e0976f3. -// -// Solidity: function receiveVerification(_jobId uint256, _claimId uint256, _segmentNumber uint256, _result bool) returns() -func (_JobsManager *JobsManagerTransactorSession) ReceiveVerification(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _result bool) (*types.Transaction, error) { - return _JobsManager.Contract.ReceiveVerification(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber, _result) -} - -// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. -// -// Solidity: function setController(_controller address) returns() -func (_JobsManager *JobsManagerTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setController", _controller) -} - -// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. -// -// Solidity: function setController(_controller address) returns() -func (_JobsManager *JobsManagerSession) SetController(_controller common.Address) (*types.Transaction, error) { - return _JobsManager.Contract.SetController(&_JobsManager.TransactOpts, _controller) -} - -// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. -// -// Solidity: function setController(_controller address) returns() -func (_JobsManager *JobsManagerTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { - return _JobsManager.Contract.SetController(&_JobsManager.TransactOpts, _controller) -} - -// SetDoubleClaimSegmentSlashAmount is a paid mutator transaction binding the contract method 0x7d6ebe94. -// -// Solidity: function setDoubleClaimSegmentSlashAmount(_doubleClaimSegmentSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetDoubleClaimSegmentSlashAmount(opts *bind.TransactOpts, _doubleClaimSegmentSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setDoubleClaimSegmentSlashAmount", _doubleClaimSegmentSlashAmount) -} - -// SetDoubleClaimSegmentSlashAmount is a paid mutator transaction binding the contract method 0x7d6ebe94. -// -// Solidity: function setDoubleClaimSegmentSlashAmount(_doubleClaimSegmentSlashAmount uint256) returns() -func (_JobsManager *JobsManagerSession) SetDoubleClaimSegmentSlashAmount(_doubleClaimSegmentSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetDoubleClaimSegmentSlashAmount(&_JobsManager.TransactOpts, _doubleClaimSegmentSlashAmount) -} - -// SetDoubleClaimSegmentSlashAmount is a paid mutator transaction binding the contract method 0x7d6ebe94. -// -// Solidity: function setDoubleClaimSegmentSlashAmount(_doubleClaimSegmentSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetDoubleClaimSegmentSlashAmount(_doubleClaimSegmentSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetDoubleClaimSegmentSlashAmount(&_JobsManager.TransactOpts, _doubleClaimSegmentSlashAmount) -} - -// SetFailedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x71af5d0e. -// -// Solidity: function setFailedVerificationSlashAmount(_failedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetFailedVerificationSlashAmount(opts *bind.TransactOpts, _failedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setFailedVerificationSlashAmount", _failedVerificationSlashAmount) -} - -// SetFailedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x71af5d0e. -// -// Solidity: function setFailedVerificationSlashAmount(_failedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerSession) SetFailedVerificationSlashAmount(_failedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetFailedVerificationSlashAmount(&_JobsManager.TransactOpts, _failedVerificationSlashAmount) -} - -// SetFailedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x71af5d0e. -// -// Solidity: function setFailedVerificationSlashAmount(_failedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetFailedVerificationSlashAmount(_failedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetFailedVerificationSlashAmount(&_JobsManager.TransactOpts, _failedVerificationSlashAmount) -} - -// SetFinderFee is a paid mutator transaction binding the contract method 0xbe427b1c. -// -// Solidity: function setFinderFee(_finderFee uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetFinderFee(opts *bind.TransactOpts, _finderFee *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setFinderFee", _finderFee) -} - -// SetFinderFee is a paid mutator transaction binding the contract method 0xbe427b1c. -// -// Solidity: function setFinderFee(_finderFee uint256) returns() -func (_JobsManager *JobsManagerSession) SetFinderFee(_finderFee *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetFinderFee(&_JobsManager.TransactOpts, _finderFee) -} - -// SetFinderFee is a paid mutator transaction binding the contract method 0xbe427b1c. -// -// Solidity: function setFinderFee(_finderFee uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetFinderFee(_finderFee *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetFinderFee(&_JobsManager.TransactOpts, _finderFee) -} - -// SetMissedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x0cb335c4. -// -// Solidity: function setMissedVerificationSlashAmount(_missedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetMissedVerificationSlashAmount(opts *bind.TransactOpts, _missedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setMissedVerificationSlashAmount", _missedVerificationSlashAmount) -} - -// SetMissedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x0cb335c4. -// -// Solidity: function setMissedVerificationSlashAmount(_missedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerSession) SetMissedVerificationSlashAmount(_missedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetMissedVerificationSlashAmount(&_JobsManager.TransactOpts, _missedVerificationSlashAmount) -} - -// SetMissedVerificationSlashAmount is a paid mutator transaction binding the contract method 0x0cb335c4. -// -// Solidity: function setMissedVerificationSlashAmount(_missedVerificationSlashAmount uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetMissedVerificationSlashAmount(_missedVerificationSlashAmount *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetMissedVerificationSlashAmount(&_JobsManager.TransactOpts, _missedVerificationSlashAmount) -} - -// SetVerificationPeriod is a paid mutator transaction binding the contract method 0x09bc1812. -// -// Solidity: function setVerificationPeriod(_verificationPeriod uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetVerificationPeriod(opts *bind.TransactOpts, _verificationPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setVerificationPeriod", _verificationPeriod) -} - -// SetVerificationPeriod is a paid mutator transaction binding the contract method 0x09bc1812. -// -// Solidity: function setVerificationPeriod(_verificationPeriod uint256) returns() -func (_JobsManager *JobsManagerSession) SetVerificationPeriod(_verificationPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationPeriod(&_JobsManager.TransactOpts, _verificationPeriod) -} - -// SetVerificationPeriod is a paid mutator transaction binding the contract method 0x09bc1812. -// -// Solidity: function setVerificationPeriod(_verificationPeriod uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetVerificationPeriod(_verificationPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationPeriod(&_JobsManager.TransactOpts, _verificationPeriod) -} - -// SetVerificationRate is a paid mutator transaction binding the contract method 0x15fa168a. -// -// Solidity: function setVerificationRate(_verificationRate uint64) returns() -func (_JobsManager *JobsManagerTransactor) SetVerificationRate(opts *bind.TransactOpts, _verificationRate uint64) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setVerificationRate", _verificationRate) -} - -// SetVerificationRate is a paid mutator transaction binding the contract method 0x15fa168a. -// -// Solidity: function setVerificationRate(_verificationRate uint64) returns() -func (_JobsManager *JobsManagerSession) SetVerificationRate(_verificationRate uint64) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationRate(&_JobsManager.TransactOpts, _verificationRate) -} - -// SetVerificationRate is a paid mutator transaction binding the contract method 0x15fa168a. -// -// Solidity: function setVerificationRate(_verificationRate uint64) returns() -func (_JobsManager *JobsManagerTransactorSession) SetVerificationRate(_verificationRate uint64) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationRate(&_JobsManager.TransactOpts, _verificationRate) -} - -// SetVerificationSlashingPeriod is a paid mutator transaction binding the contract method 0x4e78e0c2. -// -// Solidity: function setVerificationSlashingPeriod(_verificationSlashingPeriod uint256) returns() -func (_JobsManager *JobsManagerTransactor) SetVerificationSlashingPeriod(opts *bind.TransactOpts, _verificationSlashingPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "setVerificationSlashingPeriod", _verificationSlashingPeriod) -} - -// SetVerificationSlashingPeriod is a paid mutator transaction binding the contract method 0x4e78e0c2. -// -// Solidity: function setVerificationSlashingPeriod(_verificationSlashingPeriod uint256) returns() -func (_JobsManager *JobsManagerSession) SetVerificationSlashingPeriod(_verificationSlashingPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationSlashingPeriod(&_JobsManager.TransactOpts, _verificationSlashingPeriod) -} - -// SetVerificationSlashingPeriod is a paid mutator transaction binding the contract method 0x4e78e0c2. -// -// Solidity: function setVerificationSlashingPeriod(_verificationSlashingPeriod uint256) returns() -func (_JobsManager *JobsManagerTransactorSession) SetVerificationSlashingPeriod(_verificationSlashingPeriod *big.Int) (*types.Transaction, error) { - return _JobsManager.Contract.SetVerificationSlashingPeriod(&_JobsManager.TransactOpts, _verificationSlashingPeriod) -} - -// Verify is a paid mutator transaction binding the contract method 0x5a40ec7e. -// -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _dataStorageHash string, _dataHashes bytes32[2], _broadcasterSig bytes, _proof bytes) returns() -func (_JobsManager *JobsManagerTransactor) Verify(opts *bind.TransactOpts, _jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _dataStorageHash string, _dataHashes [2][32]byte, _broadcasterSig []byte, _proof []byte) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "verify", _jobId, _claimId, _segmentNumber, _dataStorageHash, _dataHashes, _broadcasterSig, _proof) -} - -// Verify is a paid mutator transaction binding the contract method 0x5a40ec7e. -// -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _dataStorageHash string, _dataHashes bytes32[2], _broadcasterSig bytes, _proof bytes) returns() -func (_JobsManager *JobsManagerSession) Verify(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _dataStorageHash string, _dataHashes [2][32]byte, _broadcasterSig []byte, _proof []byte) (*types.Transaction, error) { - return _JobsManager.Contract.Verify(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber, _dataStorageHash, _dataHashes, _broadcasterSig, _proof) -} - -// Verify is a paid mutator transaction binding the contract method 0x5a40ec7e. -// -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _dataStorageHash string, _dataHashes bytes32[2], _broadcasterSig bytes, _proof bytes) returns() -func (_JobsManager *JobsManagerTransactorSession) Verify(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _dataStorageHash string, _dataHashes [2][32]byte, _broadcasterSig []byte, _proof []byte) (*types.Transaction, error) { - return _JobsManager.Contract.Verify(&_JobsManager.TransactOpts, _jobId, _claimId, _segmentNumber, _dataStorageHash, _dataHashes, _broadcasterSig, _proof) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_JobsManager *JobsManagerTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _JobsManager.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_JobsManager *JobsManagerSession) Withdraw() (*types.Transaction, error) { - return _JobsManager.Contract.Withdraw(&_JobsManager.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_JobsManager *JobsManagerTransactorSession) Withdraw() (*types.Transaction, error) { - return _JobsManager.Contract.Withdraw(&_JobsManager.TransactOpts) -} - -// JobsManagerDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the JobsManager contract. -type JobsManagerDepositIterator struct { - Event *JobsManagerDeposit // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerDepositIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerDeposit) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerDeposit represents a Deposit event raised by the JobsManager contract. -type JobsManagerDeposit struct { - Broadcaster common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(broadcaster indexed address, amount uint256) -func (_JobsManager *JobsManagerFilterer) FilterDeposit(opts *bind.FilterOpts, broadcaster []common.Address) (*JobsManagerDepositIterator, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "Deposit", broadcasterRule) - if err != nil { - return nil, err - } - return &JobsManagerDepositIterator{contract: _JobsManager.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c. -// -// Solidity: event Deposit(broadcaster indexed address, amount uint256) -func (_JobsManager *JobsManagerFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *JobsManagerDeposit, broadcaster []common.Address) (event.Subscription, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "Deposit", broadcasterRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerDeposit) - if err := _JobsManager.contract.UnpackLog(event, "Deposit", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerDistributeFeesIterator is returned from FilterDistributeFees and is used to iterate over the raw logs and unpacked data for DistributeFees events raised by the JobsManager contract. -type JobsManagerDistributeFeesIterator struct { - Event *JobsManagerDistributeFees // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerDistributeFeesIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerDistributeFees) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerDistributeFees) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerDistributeFeesIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerDistributeFeesIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerDistributeFees represents a DistributeFees event raised by the JobsManager contract. -type JobsManagerDistributeFees struct { - Transcoder common.Address - JobId *big.Int - ClaimId *big.Int - Fees *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDistributeFees is a free log retrieval operation binding the contract event 0xa9fda9546b61eac5990fddef170f356f0f70c0f75dc7a6821b430218f3d04264. -// -// Solidity: event DistributeFees(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, fees uint256) -func (_JobsManager *JobsManagerFilterer) FilterDistributeFees(opts *bind.FilterOpts, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (*JobsManagerDistributeFeesIterator, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "DistributeFees", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &JobsManagerDistributeFeesIterator{contract: _JobsManager.contract, event: "DistributeFees", logs: logs, sub: sub}, nil -} - -// WatchDistributeFees is a free log subscription operation binding the contract event 0xa9fda9546b61eac5990fddef170f356f0f70c0f75dc7a6821b430218f3d04264. -// -// Solidity: event DistributeFees(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, fees uint256) -func (_JobsManager *JobsManagerFilterer) WatchDistributeFees(opts *bind.WatchOpts, sink chan<- *JobsManagerDistributeFees, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "DistributeFees", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerDistributeFees) - if err := _JobsManager.contract.UnpackLog(event, "DistributeFees", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerFailedVerificationIterator is returned from FilterFailedVerification and is used to iterate over the raw logs and unpacked data for FailedVerification events raised by the JobsManager contract. -type JobsManagerFailedVerificationIterator struct { - Event *JobsManagerFailedVerification // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerFailedVerificationIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerFailedVerification) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerFailedVerification) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerFailedVerificationIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerFailedVerificationIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerFailedVerification represents a FailedVerification event raised by the JobsManager contract. -type JobsManagerFailedVerification struct { - Transcoder common.Address - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFailedVerification is a free log retrieval operation binding the contract event 0x325eefe220fe85167c5d95dfbfc58fd8c17a709a9dda3df44784d7ba83669816. -// -// Solidity: event FailedVerification(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) FilterFailedVerification(opts *bind.FilterOpts, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (*JobsManagerFailedVerificationIterator, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "FailedVerification", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &JobsManagerFailedVerificationIterator{contract: _JobsManager.contract, event: "FailedVerification", logs: logs, sub: sub}, nil -} - -// WatchFailedVerification is a free log subscription operation binding the contract event 0x325eefe220fe85167c5d95dfbfc58fd8c17a709a9dda3df44784d7ba83669816. -// -// Solidity: event FailedVerification(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) WatchFailedVerification(opts *bind.WatchOpts, sink chan<- *JobsManagerFailedVerification, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "FailedVerification", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerFailedVerification) - if err := _JobsManager.contract.UnpackLog(event, "FailedVerification", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerNewClaimIterator is returned from FilterNewClaim and is used to iterate over the raw logs and unpacked data for NewClaim events raised by the JobsManager contract. -type JobsManagerNewClaimIterator struct { - Event *JobsManagerNewClaim // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerNewClaimIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerNewClaim) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerNewClaim) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerNewClaimIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerNewClaimIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerNewClaim represents a NewClaim event raised by the JobsManager contract. -type JobsManagerNewClaim struct { - Transcoder common.Address - JobId *big.Int - ClaimId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNewClaim is a free log retrieval operation binding the contract event 0x83bd61fdfc2d435598c85b87527fb51d01971ab4904c8d41410f6d7b2ffb29de. -// -// Solidity: event NewClaim(transcoder indexed address, jobId indexed uint256, claimId uint256) -func (_JobsManager *JobsManagerFilterer) FilterNewClaim(opts *bind.FilterOpts, transcoder []common.Address, jobId []*big.Int) (*JobsManagerNewClaimIterator, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "NewClaim", transcoderRule, jobIdRule) - if err != nil { - return nil, err - } - return &JobsManagerNewClaimIterator{contract: _JobsManager.contract, event: "NewClaim", logs: logs, sub: sub}, nil -} - -// WatchNewClaim is a free log subscription operation binding the contract event 0x83bd61fdfc2d435598c85b87527fb51d01971ab4904c8d41410f6d7b2ffb29de. -// -// Solidity: event NewClaim(transcoder indexed address, jobId indexed uint256, claimId uint256) -func (_JobsManager *JobsManagerFilterer) WatchNewClaim(opts *bind.WatchOpts, sink chan<- *JobsManagerNewClaim, transcoder []common.Address, jobId []*big.Int) (event.Subscription, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "NewClaim", transcoderRule, jobIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerNewClaim) - if err := _JobsManager.contract.UnpackLog(event, "NewClaim", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerNewJobIterator is returned from FilterNewJob and is used to iterate over the raw logs and unpacked data for NewJob events raised by the JobsManager contract. -type JobsManagerNewJobIterator struct { - Event *JobsManagerNewJob // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerNewJobIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerNewJob) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerNewJob) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerNewJobIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerNewJobIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerNewJob represents a NewJob event raised by the JobsManager contract. -type JobsManagerNewJob struct { - Broadcaster common.Address - JobId *big.Int - StreamId string - TranscodingOptions string - MaxPricePerSegment *big.Int - CreationBlock *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterNewJob is a free log retrieval operation binding the contract event 0x167f465188f71efa9880c291714e13242987d056e8148687871fae51457ae6e2. -// -// Solidity: event NewJob(broadcaster indexed address, jobId uint256, streamId string, transcodingOptions string, maxPricePerSegment uint256, creationBlock uint256) -func (_JobsManager *JobsManagerFilterer) FilterNewJob(opts *bind.FilterOpts, broadcaster []common.Address) (*JobsManagerNewJobIterator, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "NewJob", broadcasterRule) - if err != nil { - return nil, err - } - return &JobsManagerNewJobIterator{contract: _JobsManager.contract, event: "NewJob", logs: logs, sub: sub}, nil -} - -// WatchNewJob is a free log subscription operation binding the contract event 0x167f465188f71efa9880c291714e13242987d056e8148687871fae51457ae6e2. -// -// Solidity: event NewJob(broadcaster indexed address, jobId uint256, streamId string, transcodingOptions string, maxPricePerSegment uint256, creationBlock uint256) -func (_JobsManager *JobsManagerFilterer) WatchNewJob(opts *bind.WatchOpts, sink chan<- *JobsManagerNewJob, broadcaster []common.Address) (event.Subscription, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "NewJob", broadcasterRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerNewJob) - if err := _JobsManager.contract.UnpackLog(event, "NewJob", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the JobsManager contract. -type JobsManagerParameterUpdateIterator struct { - Event *JobsManagerParameterUpdate // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerParameterUpdateIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerParameterUpdate) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerParameterUpdate) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerParameterUpdateIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerParameterUpdateIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerParameterUpdate represents a ParameterUpdate event raised by the JobsManager contract. -type JobsManagerParameterUpdate struct { - Param string - Raw types.Log // Blockchain specific contextual infos -} - -// FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. -// -// Solidity: event ParameterUpdate(param string) -func (_JobsManager *JobsManagerFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*JobsManagerParameterUpdateIterator, error) { - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "ParameterUpdate") - if err != nil { - return nil, err - } - return &JobsManagerParameterUpdateIterator{contract: _JobsManager.contract, event: "ParameterUpdate", logs: logs, sub: sub}, nil -} - -// WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. -// -// Solidity: event ParameterUpdate(param string) -func (_JobsManager *JobsManagerFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *JobsManagerParameterUpdate) (event.Subscription, error) { - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "ParameterUpdate") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerParameterUpdate) - if err := _JobsManager.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerPassedVerificationIterator is returned from FilterPassedVerification and is used to iterate over the raw logs and unpacked data for PassedVerification events raised by the JobsManager contract. -type JobsManagerPassedVerificationIterator struct { - Event *JobsManagerPassedVerification // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerPassedVerificationIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerPassedVerification) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerPassedVerification) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerPassedVerificationIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerPassedVerificationIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerPassedVerification represents a PassedVerification event raised by the JobsManager contract. -type JobsManagerPassedVerification struct { - Transcoder common.Address - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPassedVerification is a free log retrieval operation binding the contract event 0x18d2d655e3f8d4b44ce95ed671c3f12339b2863d065ef91e970ac87826f45d8e. -// -// Solidity: event PassedVerification(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) FilterPassedVerification(opts *bind.FilterOpts, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (*JobsManagerPassedVerificationIterator, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "PassedVerification", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &JobsManagerPassedVerificationIterator{contract: _JobsManager.contract, event: "PassedVerification", logs: logs, sub: sub}, nil -} - -// WatchPassedVerification is a free log subscription operation binding the contract event 0x18d2d655e3f8d4b44ce95ed671c3f12339b2863d065ef91e970ac87826f45d8e. -// -// Solidity: event PassedVerification(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) WatchPassedVerification(opts *bind.WatchOpts, sink chan<- *JobsManagerPassedVerification, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "PassedVerification", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerPassedVerification) - if err := _JobsManager.contract.UnpackLog(event, "PassedVerification", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the JobsManager contract. -type JobsManagerSetControllerIterator struct { - Event *JobsManagerSetController // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerSetControllerIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerSetController) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerSetController) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerSetControllerIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerSetControllerIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerSetController represents a SetController event raised by the JobsManager contract. -type JobsManagerSetController struct { - Controller common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. -// -// Solidity: event SetController(controller address) -func (_JobsManager *JobsManagerFilterer) FilterSetController(opts *bind.FilterOpts) (*JobsManagerSetControllerIterator, error) { - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "SetController") - if err != nil { - return nil, err - } - return &JobsManagerSetControllerIterator{contract: _JobsManager.contract, event: "SetController", logs: logs, sub: sub}, nil -} - -// WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. -// -// Solidity: event SetController(controller address) -func (_JobsManager *JobsManagerFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *JobsManagerSetController) (event.Subscription, error) { - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "SetController") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerSetController) - if err := _JobsManager.contract.UnpackLog(event, "SetController", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerVerifyIterator is returned from FilterVerify and is used to iterate over the raw logs and unpacked data for Verify events raised by the JobsManager contract. -type JobsManagerVerifyIterator struct { - Event *JobsManagerVerify // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerVerifyIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerVerify) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerVerify) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerVerifyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerVerifyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerVerify represents a Verify event raised by the JobsManager contract. -type JobsManagerVerify struct { - Transcoder common.Address - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterVerify is a free log retrieval operation binding the contract event 0x31e97f52032376a943c45aefa03fa9c7467b54ba1d66b85e54686424108209e3. -// -// Solidity: event Verify(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) FilterVerify(opts *bind.FilterOpts, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (*JobsManagerVerifyIterator, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "Verify", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &JobsManagerVerifyIterator{contract: _JobsManager.contract, event: "Verify", logs: logs, sub: sub}, nil -} - -// WatchVerify is a free log subscription operation binding the contract event 0x31e97f52032376a943c45aefa03fa9c7467b54ba1d66b85e54686424108209e3. -// -// Solidity: event Verify(transcoder indexed address, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256) -func (_JobsManager *JobsManagerFilterer) WatchVerify(opts *bind.WatchOpts, sink chan<- *JobsManagerVerify, transcoder []common.Address, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { - - var transcoderRule []interface{} - for _, transcoderItem := range transcoder { - transcoderRule = append(transcoderRule, transcoderItem) - } - var jobIdRule []interface{} - for _, jobIdItem := range jobId { - jobIdRule = append(jobIdRule, jobIdItem) - } - var claimIdRule []interface{} - for _, claimIdItem := range claimId { - claimIdRule = append(claimIdRule, claimIdItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "Verify", transcoderRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerVerify) - if err := _JobsManager.contract.UnpackLog(event, "Verify", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// JobsManagerWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the JobsManager contract. -type JobsManagerWithdrawIterator struct { - Event *JobsManagerWithdraw // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *JobsManagerWithdrawIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(JobsManagerWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(JobsManagerWithdraw) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *JobsManagerWithdrawIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *JobsManagerWithdrawIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// JobsManagerWithdraw represents a Withdraw event raised by the JobsManager contract. -type JobsManagerWithdraw struct { - Broadcaster common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterWithdraw is a free log retrieval operation binding the contract event 0xf67611512e0a2d90c96fd3f08dca4971bc45fba9dc679eabe839a32abbe58a8e. -// -// Solidity: event Withdraw(broadcaster indexed address) -func (_JobsManager *JobsManagerFilterer) FilterWithdraw(opts *bind.FilterOpts, broadcaster []common.Address) (*JobsManagerWithdrawIterator, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.FilterLogs(opts, "Withdraw", broadcasterRule) - if err != nil { - return nil, err - } - return &JobsManagerWithdrawIterator{contract: _JobsManager.contract, event: "Withdraw", logs: logs, sub: sub}, nil -} - -// WatchWithdraw is a free log subscription operation binding the contract event 0xf67611512e0a2d90c96fd3f08dca4971bc45fba9dc679eabe839a32abbe58a8e. -// -// Solidity: event Withdraw(broadcaster indexed address) -func (_JobsManager *JobsManagerFilterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *JobsManagerWithdraw, broadcaster []common.Address) (event.Subscription, error) { - - var broadcasterRule []interface{} - for _, broadcasterItem := range broadcaster { - broadcasterRule = append(broadcasterRule, broadcasterItem) - } - - logs, sub, err := _JobsManager.contract.WatchLogs(opts, "Withdraw", broadcasterRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(JobsManagerWithdraw) - if err := _JobsManager.contract.UnpackLog(event, "Withdraw", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} diff --git a/eth/contracts/livepeerETHTicketBroker.go b/eth/contracts/livepeerETHTicketBroker.go new file mode 100644 index 000000000..3e7cbc43c --- /dev/null +++ b/eth/contracts/livepeerETHTicketBroker.go @@ -0,0 +1,2301 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contracts + +import ( + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// LivepeerETHTicketBrokerABI is the input ABI used to generate the binding from. +const LivepeerETHTicketBrokerABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isUnlockInProgress\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"unlockPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundPenaltyEscrow\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedTickets\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_signers\",\"type\":\"address[]\"}],\"name\":\"approveSigners\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_signers\",\"type\":\"address[]\"}],\"name\":\"requestSignersRevocation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_depositAmount\",\"type\":\"uint256\"},{\"name\":\"_penaltyEscrowAmount\",\"type\":\"uint256\"},{\"name\":\"_signers\",\"type\":\"address[]\"}],\"name\":\"fundAndApproveSigners\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_recipient\",\"type\":\"address\"},{\"name\":\"_sender\",\"type\":\"address\"},{\"name\":\"_faceValue\",\"type\":\"uint256\"},{\"name\":\"_winProb\",\"type\":\"uint256\"},{\"name\":\"_senderNonce\",\"type\":\"uint256\"},{\"name\":\"_recipientRandHash\",\"type\":\"bytes32\"},{\"name\":\"_auxData\",\"type\":\"bytes\"},{\"name\":\"_sig\",\"type\":\"bytes\"},{\"name\":\"_recipientRand\",\"type\":\"uint256\"}],\"name\":\"redeemWinningTicket\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"signerRevocationPeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minPenaltyEscrow\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"senders\",\"outputs\":[{\"name\":\"deposit\",\"type\":\"uint256\"},{\"name\":\"penaltyEscrow\",\"type\":\"uint256\"},{\"name\":\"withdrawBlock\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"unlock\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"cancelUnlock\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_sender\",\"type\":\"address\"},{\"name\":\"_signer\",\"type\":\"address\"}],\"name\":\"isApprovedSigner\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"},{\"name\":\"_minPenaltyEscrow\",\"type\":\"uint256\"},{\"name\":\"_unlockPeriod\",\"type\":\"uint256\"},{\"name\":\"_signerRevocationPeriod\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DepositFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"PenaltyEscrowFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"approvedSigners\",\"type\":\"address[]\"}],\"name\":\"SignersApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"signers\",\"type\":\"address[]\"},{\"indexed\":false,\"name\":\"revocationBlock\",\"type\":\"uint256\"}],\"name\":\"SignersRevocationRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"faceValue\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"winProb\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"recipientRand\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"auxData\",\"type\":\"bytes\"}],\"name\":\"WinningTicketRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WinningTicketTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"PenaltyEscrowSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"startBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"endBlock\",\"type\":\"uint256\"}],\"name\":\"Unlock\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"UnlockCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"deposit\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"penaltyEscrow\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_minPenaltyEscrow\",\"type\":\"uint256\"}],\"name\":\"setMinPenaltyEscrow\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_unlockPeriod\",\"type\":\"uint256\"}],\"name\":\"setUnlockPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_signerRevocationPeriod\",\"type\":\"uint256\"}],\"name\":\"setSignerRevocationPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// LivepeerETHTicketBroker is an auto generated Go binding around an Ethereum contract. +type LivepeerETHTicketBroker struct { + LivepeerETHTicketBrokerCaller // Read-only binding to the contract + LivepeerETHTicketBrokerTransactor // Write-only binding to the contract + LivepeerETHTicketBrokerFilterer // Log filterer for contract events +} + +// LivepeerETHTicketBrokerCaller is an auto generated read-only Go binding around an Ethereum contract. +type LivepeerETHTicketBrokerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LivepeerETHTicketBrokerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type LivepeerETHTicketBrokerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LivepeerETHTicketBrokerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type LivepeerETHTicketBrokerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// LivepeerETHTicketBrokerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type LivepeerETHTicketBrokerSession struct { + Contract *LivepeerETHTicketBroker // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LivepeerETHTicketBrokerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type LivepeerETHTicketBrokerCallerSession struct { + Contract *LivepeerETHTicketBrokerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// LivepeerETHTicketBrokerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type LivepeerETHTicketBrokerTransactorSession struct { + Contract *LivepeerETHTicketBrokerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// LivepeerETHTicketBrokerRaw is an auto generated low-level Go binding around an Ethereum contract. +type LivepeerETHTicketBrokerRaw struct { + Contract *LivepeerETHTicketBroker // Generic contract binding to access the raw methods on +} + +// LivepeerETHTicketBrokerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type LivepeerETHTicketBrokerCallerRaw struct { + Contract *LivepeerETHTicketBrokerCaller // Generic read-only contract binding to access the raw methods on +} + +// LivepeerETHTicketBrokerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type LivepeerETHTicketBrokerTransactorRaw struct { + Contract *LivepeerETHTicketBrokerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewLivepeerETHTicketBroker creates a new instance of LivepeerETHTicketBroker, bound to a specific deployed contract. +func NewLivepeerETHTicketBroker(address common.Address, backend bind.ContractBackend) (*LivepeerETHTicketBroker, error) { + contract, err := bindLivepeerETHTicketBroker(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBroker{LivepeerETHTicketBrokerCaller: LivepeerETHTicketBrokerCaller{contract: contract}, LivepeerETHTicketBrokerTransactor: LivepeerETHTicketBrokerTransactor{contract: contract}, LivepeerETHTicketBrokerFilterer: LivepeerETHTicketBrokerFilterer{contract: contract}}, nil +} + +// NewLivepeerETHTicketBrokerCaller creates a new read-only instance of LivepeerETHTicketBroker, bound to a specific deployed contract. +func NewLivepeerETHTicketBrokerCaller(address common.Address, caller bind.ContractCaller) (*LivepeerETHTicketBrokerCaller, error) { + contract, err := bindLivepeerETHTicketBroker(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerCaller{contract: contract}, nil +} + +// NewLivepeerETHTicketBrokerTransactor creates a new write-only instance of LivepeerETHTicketBroker, bound to a specific deployed contract. +func NewLivepeerETHTicketBrokerTransactor(address common.Address, transactor bind.ContractTransactor) (*LivepeerETHTicketBrokerTransactor, error) { + contract, err := bindLivepeerETHTicketBroker(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerTransactor{contract: contract}, nil +} + +// NewLivepeerETHTicketBrokerFilterer creates a new log filterer instance of LivepeerETHTicketBroker, bound to a specific deployed contract. +func NewLivepeerETHTicketBrokerFilterer(address common.Address, filterer bind.ContractFilterer) (*LivepeerETHTicketBrokerFilterer, error) { + contract, err := bindLivepeerETHTicketBroker(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerFilterer{contract: contract}, nil +} + +// bindLivepeerETHTicketBroker binds a generic wrapper to an already deployed contract. +func bindLivepeerETHTicketBroker(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(LivepeerETHTicketBrokerABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _LivepeerETHTicketBroker.Contract.LivepeerETHTicketBrokerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.LivepeerETHTicketBrokerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.LivepeerETHTicketBrokerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _LivepeerETHTicketBroker.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.contract.Transact(opts, method, params...) +} + +// Controller is a free data retrieval call binding the contract method 0xf77c4791. +// +// Solidity: function controller() constant returns(address) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) Controller(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "controller") + return *ret0, err +} + +// Controller is a free data retrieval call binding the contract method 0xf77c4791. +// +// Solidity: function controller() constant returns(address) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) Controller() (common.Address, error) { + return _LivepeerETHTicketBroker.Contract.Controller(&_LivepeerETHTicketBroker.CallOpts) +} + +// Controller is a free data retrieval call binding the contract method 0xf77c4791. +// +// Solidity: function controller() constant returns(address) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) Controller() (common.Address, error) { + return _LivepeerETHTicketBroker.Contract.Controller(&_LivepeerETHTicketBroker.CallOpts) +} + +// IsApprovedSigner is a free data retrieval call binding the contract method 0xd6904109. +// +// Solidity: function isApprovedSigner(address _sender, address _signer) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) IsApprovedSigner(opts *bind.CallOpts, _sender common.Address, _signer common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "isApprovedSigner", _sender, _signer) + return *ret0, err +} + +// IsApprovedSigner is a free data retrieval call binding the contract method 0xd6904109. +// +// Solidity: function isApprovedSigner(address _sender, address _signer) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) IsApprovedSigner(_sender common.Address, _signer common.Address) (bool, error) { + return _LivepeerETHTicketBroker.Contract.IsApprovedSigner(&_LivepeerETHTicketBroker.CallOpts, _sender, _signer) +} + +// IsApprovedSigner is a free data retrieval call binding the contract method 0xd6904109. +// +// Solidity: function isApprovedSigner(address _sender, address _signer) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) IsApprovedSigner(_sender common.Address, _signer common.Address) (bool, error) { + return _LivepeerETHTicketBroker.Contract.IsApprovedSigner(&_LivepeerETHTicketBroker.CallOpts, _sender, _signer) +} + +// IsUnlockInProgress is a free data retrieval call binding the contract method 0x121cdcc2. +// +// Solidity: function isUnlockInProgress(address _sender) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) IsUnlockInProgress(opts *bind.CallOpts, _sender common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "isUnlockInProgress", _sender) + return *ret0, err +} + +// IsUnlockInProgress is a free data retrieval call binding the contract method 0x121cdcc2. +// +// Solidity: function isUnlockInProgress(address _sender) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) IsUnlockInProgress(_sender common.Address) (bool, error) { + return _LivepeerETHTicketBroker.Contract.IsUnlockInProgress(&_LivepeerETHTicketBroker.CallOpts, _sender) +} + +// IsUnlockInProgress is a free data retrieval call binding the contract method 0x121cdcc2. +// +// Solidity: function isUnlockInProgress(address _sender) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) IsUnlockInProgress(_sender common.Address) (bool, error) { + return _LivepeerETHTicketBroker.Contract.IsUnlockInProgress(&_LivepeerETHTicketBroker.CallOpts, _sender) +} + +// MinPenaltyEscrow is a free data retrieval call binding the contract method 0x713a5cc2. +// +// Solidity: function minPenaltyEscrow() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) MinPenaltyEscrow(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "minPenaltyEscrow") + return *ret0, err +} + +// MinPenaltyEscrow is a free data retrieval call binding the contract method 0x713a5cc2. +// +// Solidity: function minPenaltyEscrow() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) MinPenaltyEscrow() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.MinPenaltyEscrow(&_LivepeerETHTicketBroker.CallOpts) +} + +// MinPenaltyEscrow is a free data retrieval call binding the contract method 0x713a5cc2. +// +// Solidity: function minPenaltyEscrow() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) MinPenaltyEscrow() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.MinPenaltyEscrow(&_LivepeerETHTicketBroker.CallOpts) +} + +// Senders is a free data retrieval call binding the contract method 0x982fb9d8. +// +// Solidity: function senders(address ) constant returns(uint256 deposit, uint256 penaltyEscrow, uint256 withdrawBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) Senders(opts *bind.CallOpts, arg0 common.Address) (struct { + Deposit *big.Int + PenaltyEscrow *big.Int + WithdrawBlock *big.Int +}, error) { + ret := new(struct { + Deposit *big.Int + PenaltyEscrow *big.Int + WithdrawBlock *big.Int + }) + out := ret + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "senders", arg0) + return *ret, err +} + +// Senders is a free data retrieval call binding the contract method 0x982fb9d8. +// +// Solidity: function senders(address ) constant returns(uint256 deposit, uint256 penaltyEscrow, uint256 withdrawBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) Senders(arg0 common.Address) (struct { + Deposit *big.Int + PenaltyEscrow *big.Int + WithdrawBlock *big.Int +}, error) { + return _LivepeerETHTicketBroker.Contract.Senders(&_LivepeerETHTicketBroker.CallOpts, arg0) +} + +// Senders is a free data retrieval call binding the contract method 0x982fb9d8. +// +// Solidity: function senders(address ) constant returns(uint256 deposit, uint256 penaltyEscrow, uint256 withdrawBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) Senders(arg0 common.Address) (struct { + Deposit *big.Int + PenaltyEscrow *big.Int + WithdrawBlock *big.Int +}, error) { + return _LivepeerETHTicketBroker.Contract.Senders(&_LivepeerETHTicketBroker.CallOpts, arg0) +} + +// SignerRevocationPeriod is a free data retrieval call binding the contract method 0x6e2cff2b. +// +// Solidity: function signerRevocationPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) SignerRevocationPeriod(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "signerRevocationPeriod") + return *ret0, err +} + +// SignerRevocationPeriod is a free data retrieval call binding the contract method 0x6e2cff2b. +// +// Solidity: function signerRevocationPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) SignerRevocationPeriod() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.SignerRevocationPeriod(&_LivepeerETHTicketBroker.CallOpts) +} + +// SignerRevocationPeriod is a free data retrieval call binding the contract method 0x6e2cff2b. +// +// Solidity: function signerRevocationPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) SignerRevocationPeriod() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.SignerRevocationPeriod(&_LivepeerETHTicketBroker.CallOpts) +} + +// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. +// +// Solidity: function targetContractId() constant returns(bytes32) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) TargetContractId(opts *bind.CallOpts) ([32]byte, error) { + var ( + ret0 = new([32]byte) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "targetContractId") + return *ret0, err +} + +// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. +// +// Solidity: function targetContractId() constant returns(bytes32) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) TargetContractId() ([32]byte, error) { + return _LivepeerETHTicketBroker.Contract.TargetContractId(&_LivepeerETHTicketBroker.CallOpts) +} + +// TargetContractId is a free data retrieval call binding the contract method 0x51720b41. +// +// Solidity: function targetContractId() constant returns(bytes32) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) TargetContractId() ([32]byte, error) { + return _LivepeerETHTicketBroker.Contract.TargetContractId(&_LivepeerETHTicketBroker.CallOpts) +} + +// UnlockPeriod is a free data retrieval call binding the contract method 0x20d3a0b4. +// +// Solidity: function unlockPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) UnlockPeriod(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "unlockPeriod") + return *ret0, err +} + +// UnlockPeriod is a free data retrieval call binding the contract method 0x20d3a0b4. +// +// Solidity: function unlockPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) UnlockPeriod() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.UnlockPeriod(&_LivepeerETHTicketBroker.CallOpts) +} + +// UnlockPeriod is a free data retrieval call binding the contract method 0x20d3a0b4. +// +// Solidity: function unlockPeriod() constant returns(uint256) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) UnlockPeriod() (*big.Int, error) { + return _LivepeerETHTicketBroker.Contract.UnlockPeriod(&_LivepeerETHTicketBroker.CallOpts) +} + +// UsedTickets is a free data retrieval call binding the contract method 0x59a515ba. +// +// Solidity: function usedTickets(bytes32 ) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCaller) UsedTickets(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _LivepeerETHTicketBroker.contract.Call(opts, out, "usedTickets", arg0) + return *ret0, err +} + +// UsedTickets is a free data retrieval call binding the contract method 0x59a515ba. +// +// Solidity: function usedTickets(bytes32 ) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) UsedTickets(arg0 [32]byte) (bool, error) { + return _LivepeerETHTicketBroker.Contract.UsedTickets(&_LivepeerETHTicketBroker.CallOpts, arg0) +} + +// UsedTickets is a free data retrieval call binding the contract method 0x59a515ba. +// +// Solidity: function usedTickets(bytes32 ) constant returns(bool) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerCallerSession) UsedTickets(arg0 [32]byte) (bool, error) { + return _LivepeerETHTicketBroker.Contract.UsedTickets(&_LivepeerETHTicketBroker.CallOpts, arg0) +} + +// ApproveSigners is a paid mutator transaction binding the contract method 0x64b57754. +// +// Solidity: function approveSigners(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) ApproveSigners(opts *bind.TransactOpts, _signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "approveSigners", _signers) +} + +// ApproveSigners is a paid mutator transaction binding the contract method 0x64b57754. +// +// Solidity: function approveSigners(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) ApproveSigners(_signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.ApproveSigners(&_LivepeerETHTicketBroker.TransactOpts, _signers) +} + +// ApproveSigners is a paid mutator transaction binding the contract method 0x64b57754. +// +// Solidity: function approveSigners(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) ApproveSigners(_signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.ApproveSigners(&_LivepeerETHTicketBroker.TransactOpts, _signers) +} + +// CancelUnlock is a paid mutator transaction binding the contract method 0xc2c4c2c8. +// +// Solidity: function cancelUnlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) CancelUnlock(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "cancelUnlock") +} + +// CancelUnlock is a paid mutator transaction binding the contract method 0xc2c4c2c8. +// +// Solidity: function cancelUnlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) CancelUnlock() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.CancelUnlock(&_LivepeerETHTicketBroker.TransactOpts) +} + +// CancelUnlock is a paid mutator transaction binding the contract method 0xc2c4c2c8. +// +// Solidity: function cancelUnlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) CancelUnlock() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.CancelUnlock(&_LivepeerETHTicketBroker.TransactOpts) +} + +// FundAndApproveSigners is a paid mutator transaction binding the contract method 0x68e62fa7. +// +// Solidity: function fundAndApproveSigners(uint256 _depositAmount, uint256 _penaltyEscrowAmount, address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) FundAndApproveSigners(opts *bind.TransactOpts, _depositAmount *big.Int, _penaltyEscrowAmount *big.Int, _signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "fundAndApproveSigners", _depositAmount, _penaltyEscrowAmount, _signers) +} + +// FundAndApproveSigners is a paid mutator transaction binding the contract method 0x68e62fa7. +// +// Solidity: function fundAndApproveSigners(uint256 _depositAmount, uint256 _penaltyEscrowAmount, address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) FundAndApproveSigners(_depositAmount *big.Int, _penaltyEscrowAmount *big.Int, _signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundAndApproveSigners(&_LivepeerETHTicketBroker.TransactOpts, _depositAmount, _penaltyEscrowAmount, _signers) +} + +// FundAndApproveSigners is a paid mutator transaction binding the contract method 0x68e62fa7. +// +// Solidity: function fundAndApproveSigners(uint256 _depositAmount, uint256 _penaltyEscrowAmount, address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) FundAndApproveSigners(_depositAmount *big.Int, _penaltyEscrowAmount *big.Int, _signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundAndApproveSigners(&_LivepeerETHTicketBroker.TransactOpts, _depositAmount, _penaltyEscrowAmount, _signers) +} + +// FundDeposit is a paid mutator transaction binding the contract method 0x6caa736b. +// +// Solidity: function fundDeposit() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) FundDeposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "fundDeposit") +} + +// FundDeposit is a paid mutator transaction binding the contract method 0x6caa736b. +// +// Solidity: function fundDeposit() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) FundDeposit() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundDeposit(&_LivepeerETHTicketBroker.TransactOpts) +} + +// FundDeposit is a paid mutator transaction binding the contract method 0x6caa736b. +// +// Solidity: function fundDeposit() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) FundDeposit() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundDeposit(&_LivepeerETHTicketBroker.TransactOpts) +} + +// FundPenaltyEscrow is a paid mutator transaction binding the contract method 0x45286456. +// +// Solidity: function fundPenaltyEscrow() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) FundPenaltyEscrow(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "fundPenaltyEscrow") +} + +// FundPenaltyEscrow is a paid mutator transaction binding the contract method 0x45286456. +// +// Solidity: function fundPenaltyEscrow() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) FundPenaltyEscrow() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundPenaltyEscrow(&_LivepeerETHTicketBroker.TransactOpts) +} + +// FundPenaltyEscrow is a paid mutator transaction binding the contract method 0x45286456. +// +// Solidity: function fundPenaltyEscrow() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) FundPenaltyEscrow() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.FundPenaltyEscrow(&_LivepeerETHTicketBroker.TransactOpts) +} + +// RedeemWinningTicket is a paid mutator transaction binding the contract method 0x69ada57a. +// +// Solidity: function redeemWinningTicket(address _recipient, address _sender, uint256 _faceValue, uint256 _winProb, uint256 _senderNonce, bytes32 _recipientRandHash, bytes _auxData, bytes _sig, uint256 _recipientRand) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) RedeemWinningTicket(opts *bind.TransactOpts, _recipient common.Address, _sender common.Address, _faceValue *big.Int, _winProb *big.Int, _senderNonce *big.Int, _recipientRandHash [32]byte, _auxData []byte, _sig []byte, _recipientRand *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "redeemWinningTicket", _recipient, _sender, _faceValue, _winProb, _senderNonce, _recipientRandHash, _auxData, _sig, _recipientRand) +} + +// RedeemWinningTicket is a paid mutator transaction binding the contract method 0x69ada57a. +// +// Solidity: function redeemWinningTicket(address _recipient, address _sender, uint256 _faceValue, uint256 _winProb, uint256 _senderNonce, bytes32 _recipientRandHash, bytes _auxData, bytes _sig, uint256 _recipientRand) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) RedeemWinningTicket(_recipient common.Address, _sender common.Address, _faceValue *big.Int, _winProb *big.Int, _senderNonce *big.Int, _recipientRandHash [32]byte, _auxData []byte, _sig []byte, _recipientRand *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.RedeemWinningTicket(&_LivepeerETHTicketBroker.TransactOpts, _recipient, _sender, _faceValue, _winProb, _senderNonce, _recipientRandHash, _auxData, _sig, _recipientRand) +} + +// RedeemWinningTicket is a paid mutator transaction binding the contract method 0x69ada57a. +// +// Solidity: function redeemWinningTicket(address _recipient, address _sender, uint256 _faceValue, uint256 _winProb, uint256 _senderNonce, bytes32 _recipientRandHash, bytes _auxData, bytes _sig, uint256 _recipientRand) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) RedeemWinningTicket(_recipient common.Address, _sender common.Address, _faceValue *big.Int, _winProb *big.Int, _senderNonce *big.Int, _recipientRandHash [32]byte, _auxData []byte, _sig []byte, _recipientRand *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.RedeemWinningTicket(&_LivepeerETHTicketBroker.TransactOpts, _recipient, _sender, _faceValue, _winProb, _senderNonce, _recipientRandHash, _auxData, _sig, _recipientRand) +} + +// RequestSignersRevocation is a paid mutator transaction binding the contract method 0x66f6a7a2. +// +// Solidity: function requestSignersRevocation(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) RequestSignersRevocation(opts *bind.TransactOpts, _signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "requestSignersRevocation", _signers) +} + +// RequestSignersRevocation is a paid mutator transaction binding the contract method 0x66f6a7a2. +// +// Solidity: function requestSignersRevocation(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) RequestSignersRevocation(_signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.RequestSignersRevocation(&_LivepeerETHTicketBroker.TransactOpts, _signers) +} + +// RequestSignersRevocation is a paid mutator transaction binding the contract method 0x66f6a7a2. +// +// Solidity: function requestSignersRevocation(address[] _signers) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) RequestSignersRevocation(_signers []common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.RequestSignersRevocation(&_LivepeerETHTicketBroker.TransactOpts, _signers) +} + +// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. +// +// Solidity: function setController(address _controller) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "setController", _controller) +} + +// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. +// +// Solidity: function setController(address _controller) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) SetController(_controller common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetController(&_LivepeerETHTicketBroker.TransactOpts, _controller) +} + +// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. +// +// Solidity: function setController(address _controller) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetController(&_LivepeerETHTicketBroker.TransactOpts, _controller) +} + +// SetMinPenaltyEscrow is a paid mutator transaction binding the contract method 0x3fcbd299. +// +// Solidity: function setMinPenaltyEscrow(uint256 _minPenaltyEscrow) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) SetMinPenaltyEscrow(opts *bind.TransactOpts, _minPenaltyEscrow *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "setMinPenaltyEscrow", _minPenaltyEscrow) +} + +// SetMinPenaltyEscrow is a paid mutator transaction binding the contract method 0x3fcbd299. +// +// Solidity: function setMinPenaltyEscrow(uint256 _minPenaltyEscrow) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) SetMinPenaltyEscrow(_minPenaltyEscrow *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetMinPenaltyEscrow(&_LivepeerETHTicketBroker.TransactOpts, _minPenaltyEscrow) +} + +// SetMinPenaltyEscrow is a paid mutator transaction binding the contract method 0x3fcbd299. +// +// Solidity: function setMinPenaltyEscrow(uint256 _minPenaltyEscrow) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) SetMinPenaltyEscrow(_minPenaltyEscrow *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetMinPenaltyEscrow(&_LivepeerETHTicketBroker.TransactOpts, _minPenaltyEscrow) +} + +// SetSignerRevocationPeriod is a paid mutator transaction binding the contract method 0xec18a8af. +// +// Solidity: function setSignerRevocationPeriod(uint256 _signerRevocationPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) SetSignerRevocationPeriod(opts *bind.TransactOpts, _signerRevocationPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "setSignerRevocationPeriod", _signerRevocationPeriod) +} + +// SetSignerRevocationPeriod is a paid mutator transaction binding the contract method 0xec18a8af. +// +// Solidity: function setSignerRevocationPeriod(uint256 _signerRevocationPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) SetSignerRevocationPeriod(_signerRevocationPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetSignerRevocationPeriod(&_LivepeerETHTicketBroker.TransactOpts, _signerRevocationPeriod) +} + +// SetSignerRevocationPeriod is a paid mutator transaction binding the contract method 0xec18a8af. +// +// Solidity: function setSignerRevocationPeriod(uint256 _signerRevocationPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) SetSignerRevocationPeriod(_signerRevocationPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetSignerRevocationPeriod(&_LivepeerETHTicketBroker.TransactOpts, _signerRevocationPeriod) +} + +// SetUnlockPeriod is a paid mutator transaction binding the contract method 0x3d0ddf84. +// +// Solidity: function setUnlockPeriod(uint256 _unlockPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) SetUnlockPeriod(opts *bind.TransactOpts, _unlockPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "setUnlockPeriod", _unlockPeriod) +} + +// SetUnlockPeriod is a paid mutator transaction binding the contract method 0x3d0ddf84. +// +// Solidity: function setUnlockPeriod(uint256 _unlockPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) SetUnlockPeriod(_unlockPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetUnlockPeriod(&_LivepeerETHTicketBroker.TransactOpts, _unlockPeriod) +} + +// SetUnlockPeriod is a paid mutator transaction binding the contract method 0x3d0ddf84. +// +// Solidity: function setUnlockPeriod(uint256 _unlockPeriod) returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) SetUnlockPeriod(_unlockPeriod *big.Int) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.SetUnlockPeriod(&_LivepeerETHTicketBroker.TransactOpts, _unlockPeriod) +} + +// Unlock is a paid mutator transaction binding the contract method 0xa69df4b5. +// +// Solidity: function unlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) Unlock(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "unlock") +} + +// Unlock is a paid mutator transaction binding the contract method 0xa69df4b5. +// +// Solidity: function unlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) Unlock() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.Unlock(&_LivepeerETHTicketBroker.TransactOpts) +} + +// Unlock is a paid mutator transaction binding the contract method 0xa69df4b5. +// +// Solidity: function unlock() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) Unlock() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.Unlock(&_LivepeerETHTicketBroker.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LivepeerETHTicketBroker.contract.Transact(opts, "withdraw") +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerSession) Withdraw() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.Withdraw(&_LivepeerETHTicketBroker.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. +// +// Solidity: function withdraw() returns() +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerTransactorSession) Withdraw() (*types.Transaction, error) { + return _LivepeerETHTicketBroker.Contract.Withdraw(&_LivepeerETHTicketBroker.TransactOpts) +} + +// LivepeerETHTicketBrokerDepositFundedIterator is returned from FilterDepositFunded and is used to iterate over the raw logs and unpacked data for DepositFunded events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerDepositFundedIterator struct { + Event *LivepeerETHTicketBrokerDepositFunded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerDepositFundedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerDepositFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerDepositFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerDepositFundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerDepositFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerDepositFunded represents a DepositFunded event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerDepositFunded struct { + Sender common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDepositFunded is a free log retrieval operation binding the contract event 0x5159e237d952190e68d5215430f305831be7c9c8776d1377c76679ae4773413f. +// +// Solidity: event DepositFunded(address indexed sender, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterDepositFunded(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerDepositFundedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "DepositFunded", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerDepositFundedIterator{contract: _LivepeerETHTicketBroker.contract, event: "DepositFunded", logs: logs, sub: sub}, nil +} + +// WatchDepositFunded is a free log subscription operation binding the contract event 0x5159e237d952190e68d5215430f305831be7c9c8776d1377c76679ae4773413f. +// +// Solidity: event DepositFunded(address indexed sender, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchDepositFunded(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerDepositFunded, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "DepositFunded", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerDepositFunded) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "DepositFunded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerParameterUpdateIterator struct { + Event *LivepeerETHTicketBrokerParameterUpdate // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerParameterUpdateIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerParameterUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerParameterUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerParameterUpdateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerParameterUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerParameterUpdate represents a ParameterUpdate event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerParameterUpdate struct { + Param string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*LivepeerETHTicketBrokerParameterUpdateIterator, error) { + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "ParameterUpdate") + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerParameterUpdateIterator{contract: _LivepeerETHTicketBroker.contract, event: "ParameterUpdate", logs: logs, sub: sub}, nil +} + +// WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerParameterUpdate) (event.Subscription, error) { + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "ParameterUpdate") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerParameterUpdate) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerPenaltyEscrowFundedIterator is returned from FilterPenaltyEscrowFunded and is used to iterate over the raw logs and unpacked data for PenaltyEscrowFunded events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerPenaltyEscrowFundedIterator struct { + Event *LivepeerETHTicketBrokerPenaltyEscrowFunded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerPenaltyEscrowFundedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerPenaltyEscrowFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerPenaltyEscrowFunded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerPenaltyEscrowFundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerPenaltyEscrowFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerPenaltyEscrowFunded represents a PenaltyEscrowFunded event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerPenaltyEscrowFunded struct { + Sender common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPenaltyEscrowFunded is a free log retrieval operation binding the contract event 0xd679017ec79e2a2859033228f61da78d4793646aa3833e0b2fab88bae82f9ad3. +// +// Solidity: event PenaltyEscrowFunded(address indexed sender, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterPenaltyEscrowFunded(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerPenaltyEscrowFundedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "PenaltyEscrowFunded", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerPenaltyEscrowFundedIterator{contract: _LivepeerETHTicketBroker.contract, event: "PenaltyEscrowFunded", logs: logs, sub: sub}, nil +} + +// WatchPenaltyEscrowFunded is a free log subscription operation binding the contract event 0xd679017ec79e2a2859033228f61da78d4793646aa3833e0b2fab88bae82f9ad3. +// +// Solidity: event PenaltyEscrowFunded(address indexed sender, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchPenaltyEscrowFunded(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerPenaltyEscrowFunded, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "PenaltyEscrowFunded", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerPenaltyEscrowFunded) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "PenaltyEscrowFunded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator is returned from FilterPenaltyEscrowSlashed and is used to iterate over the raw logs and unpacked data for PenaltyEscrowSlashed events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator struct { + Event *LivepeerETHTicketBrokerPenaltyEscrowSlashed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerPenaltyEscrowSlashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerPenaltyEscrowSlashed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerPenaltyEscrowSlashed represents a PenaltyEscrowSlashed event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerPenaltyEscrowSlashed struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPenaltyEscrowSlashed is a free log retrieval operation binding the contract event 0xebf82fdc1b74684102a88965407eff69eeef94329b0d5c935ab383efc81b971e. +// +// Solidity: event PenaltyEscrowSlashed(address indexed sender, address indexed recipient, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterPenaltyEscrowSlashed(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "PenaltyEscrowSlashed", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerPenaltyEscrowSlashedIterator{contract: _LivepeerETHTicketBroker.contract, event: "PenaltyEscrowSlashed", logs: logs, sub: sub}, nil +} + +// WatchPenaltyEscrowSlashed is a free log subscription operation binding the contract event 0xebf82fdc1b74684102a88965407eff69eeef94329b0d5c935ab383efc81b971e. +// +// Solidity: event PenaltyEscrowSlashed(address indexed sender, address indexed recipient, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchPenaltyEscrowSlashed(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerPenaltyEscrowSlashed, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "PenaltyEscrowSlashed", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerPenaltyEscrowSlashed) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "PenaltyEscrowSlashed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSetControllerIterator struct { + Event *LivepeerETHTicketBrokerSetController // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerSetControllerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSetController) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSetController) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerSetControllerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerSetControllerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerSetController represents a SetController event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSetController struct { + Controller common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterSetController(opts *bind.FilterOpts) (*LivepeerETHTicketBrokerSetControllerIterator, error) { + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "SetController") + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerSetControllerIterator{contract: _LivepeerETHTicketBroker.contract, event: "SetController", logs: logs, sub: sub}, nil +} + +// WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerSetController) (event.Subscription, error) { + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "SetController") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerSetController) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "SetController", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerSignersApprovedIterator is returned from FilterSignersApproved and is used to iterate over the raw logs and unpacked data for SignersApproved events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSignersApprovedIterator struct { + Event *LivepeerETHTicketBrokerSignersApproved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerSignersApprovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSignersApproved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSignersApproved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerSignersApprovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerSignersApprovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerSignersApproved represents a SignersApproved event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSignersApproved struct { + Sender common.Address + ApprovedSigners []common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignersApproved is a free log retrieval operation binding the contract event 0x8612106bdb1778879d2c28794f6e78939e298025e0afd8fb02c7f3aa4ba23e55. +// +// Solidity: event SignersApproved(address indexed sender, address[] approvedSigners) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterSignersApproved(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerSignersApprovedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "SignersApproved", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerSignersApprovedIterator{contract: _LivepeerETHTicketBroker.contract, event: "SignersApproved", logs: logs, sub: sub}, nil +} + +// WatchSignersApproved is a free log subscription operation binding the contract event 0x8612106bdb1778879d2c28794f6e78939e298025e0afd8fb02c7f3aa4ba23e55. +// +// Solidity: event SignersApproved(address indexed sender, address[] approvedSigners) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchSignersApproved(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerSignersApproved, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "SignersApproved", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerSignersApproved) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "SignersApproved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerSignersRevocationRequestedIterator is returned from FilterSignersRevocationRequested and is used to iterate over the raw logs and unpacked data for SignersRevocationRequested events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSignersRevocationRequestedIterator struct { + Event *LivepeerETHTicketBrokerSignersRevocationRequested // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerSignersRevocationRequestedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSignersRevocationRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerSignersRevocationRequested) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerSignersRevocationRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerSignersRevocationRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerSignersRevocationRequested represents a SignersRevocationRequested event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerSignersRevocationRequested struct { + Sender common.Address + Signers []common.Address + RevocationBlock *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignersRevocationRequested is a free log retrieval operation binding the contract event 0x866265c73ee21dac2b20249a3684fcb0378e11be6e813b0c594eb1b21471d8c5. +// +// Solidity: event SignersRevocationRequested(address indexed sender, address[] signers, uint256 revocationBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterSignersRevocationRequested(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerSignersRevocationRequestedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "SignersRevocationRequested", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerSignersRevocationRequestedIterator{contract: _LivepeerETHTicketBroker.contract, event: "SignersRevocationRequested", logs: logs, sub: sub}, nil +} + +// WatchSignersRevocationRequested is a free log subscription operation binding the contract event 0x866265c73ee21dac2b20249a3684fcb0378e11be6e813b0c594eb1b21471d8c5. +// +// Solidity: event SignersRevocationRequested(address indexed sender, address[] signers, uint256 revocationBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchSignersRevocationRequested(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerSignersRevocationRequested, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "SignersRevocationRequested", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerSignersRevocationRequested) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "SignersRevocationRequested", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerUnlockIterator is returned from FilterUnlock and is used to iterate over the raw logs and unpacked data for Unlock events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerUnlockIterator struct { + Event *LivepeerETHTicketBrokerUnlock // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerUnlockIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerUnlock) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerUnlock) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerUnlockIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerUnlockIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerUnlock represents a Unlock event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerUnlock struct { + Sender common.Address + StartBlock *big.Int + EndBlock *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnlock is a free log retrieval operation binding the contract event 0xf7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c2004. +// +// Solidity: event Unlock(address indexed sender, uint256 startBlock, uint256 endBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterUnlock(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerUnlockIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "Unlock", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerUnlockIterator{contract: _LivepeerETHTicketBroker.contract, event: "Unlock", logs: logs, sub: sub}, nil +} + +// WatchUnlock is a free log subscription operation binding the contract event 0xf7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c2004. +// +// Solidity: event Unlock(address indexed sender, uint256 startBlock, uint256 endBlock) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchUnlock(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerUnlock, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "Unlock", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerUnlock) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "Unlock", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerUnlockCancelledIterator is returned from FilterUnlockCancelled and is used to iterate over the raw logs and unpacked data for UnlockCancelled events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerUnlockCancelledIterator struct { + Event *LivepeerETHTicketBrokerUnlockCancelled // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerUnlockCancelledIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerUnlockCancelled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerUnlockCancelled) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerUnlockCancelledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerUnlockCancelledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerUnlockCancelled represents a UnlockCancelled event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerUnlockCancelled struct { + Sender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnlockCancelled is a free log retrieval operation binding the contract event 0xfa044b7b93a40365dc68049797c2eb06918523d694e5d56e406cac3eb35578e5. +// +// Solidity: event UnlockCancelled(address indexed sender) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterUnlockCancelled(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerUnlockCancelledIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "UnlockCancelled", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerUnlockCancelledIterator{contract: _LivepeerETHTicketBroker.contract, event: "UnlockCancelled", logs: logs, sub: sub}, nil +} + +// WatchUnlockCancelled is a free log subscription operation binding the contract event 0xfa044b7b93a40365dc68049797c2eb06918523d694e5d56e406cac3eb35578e5. +// +// Solidity: event UnlockCancelled(address indexed sender) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchUnlockCancelled(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerUnlockCancelled, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "UnlockCancelled", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerUnlockCancelled) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "UnlockCancelled", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerWinningTicketRedeemedIterator is returned from FilterWinningTicketRedeemed and is used to iterate over the raw logs and unpacked data for WinningTicketRedeemed events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWinningTicketRedeemedIterator struct { + Event *LivepeerETHTicketBrokerWinningTicketRedeemed // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerWinningTicketRedeemedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWinningTicketRedeemed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWinningTicketRedeemed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerWinningTicketRedeemedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerWinningTicketRedeemedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerWinningTicketRedeemed represents a WinningTicketRedeemed event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWinningTicketRedeemed struct { + Sender common.Address + Recipient common.Address + FaceValue *big.Int + WinProb *big.Int + SenderNonce *big.Int + RecipientRand *big.Int + AuxData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWinningTicketRedeemed is a free log retrieval operation binding the contract event 0xc389eb51ed006dbf2528507f010efdf5225ea596e1e1741d74f550dab1925ee7. +// +// Solidity: event WinningTicketRedeemed(address indexed sender, address indexed recipient, uint256 faceValue, uint256 winProb, uint256 senderNonce, uint256 recipientRand, bytes auxData) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterWinningTicketRedeemed(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LivepeerETHTicketBrokerWinningTicketRedeemedIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "WinningTicketRedeemed", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerWinningTicketRedeemedIterator{contract: _LivepeerETHTicketBroker.contract, event: "WinningTicketRedeemed", logs: logs, sub: sub}, nil +} + +// WatchWinningTicketRedeemed is a free log subscription operation binding the contract event 0xc389eb51ed006dbf2528507f010efdf5225ea596e1e1741d74f550dab1925ee7. +// +// Solidity: event WinningTicketRedeemed(address indexed sender, address indexed recipient, uint256 faceValue, uint256 winProb, uint256 senderNonce, uint256 recipientRand, bytes auxData) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchWinningTicketRedeemed(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerWinningTicketRedeemed, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "WinningTicketRedeemed", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerWinningTicketRedeemed) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "WinningTicketRedeemed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerWinningTicketTransferIterator is returned from FilterWinningTicketTransfer and is used to iterate over the raw logs and unpacked data for WinningTicketTransfer events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWinningTicketTransferIterator struct { + Event *LivepeerETHTicketBrokerWinningTicketTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerWinningTicketTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWinningTicketTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWinningTicketTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerWinningTicketTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerWinningTicketTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerWinningTicketTransfer represents a WinningTicketTransfer event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWinningTicketTransfer struct { + Sender common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWinningTicketTransfer is a free log retrieval operation binding the contract event 0x8b87351a208c06e3ceee59d80725fd77a23b4129e1b51ca231fc89b40712649c. +// +// Solidity: event WinningTicketTransfer(address indexed sender, address indexed recipient, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterWinningTicketTransfer(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*LivepeerETHTicketBrokerWinningTicketTransferIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "WinningTicketTransfer", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerWinningTicketTransferIterator{contract: _LivepeerETHTicketBroker.contract, event: "WinningTicketTransfer", logs: logs, sub: sub}, nil +} + +// WatchWinningTicketTransfer is a free log subscription operation binding the contract event 0x8b87351a208c06e3ceee59d80725fd77a23b4129e1b51ca231fc89b40712649c. +// +// Solidity: event WinningTicketTransfer(address indexed sender, address indexed recipient, uint256 amount) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchWinningTicketTransfer(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerWinningTicketTransfer, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "WinningTicketTransfer", senderRule, recipientRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerWinningTicketTransfer) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "WinningTicketTransfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// LivepeerETHTicketBrokerWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWithdrawalIterator struct { + Event *LivepeerETHTicketBrokerWithdrawal // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerETHTicketBrokerWithdrawalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerETHTicketBrokerWithdrawal) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerETHTicketBrokerWithdrawalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerETHTicketBrokerWithdrawalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerETHTicketBrokerWithdrawal represents a Withdrawal event raised by the LivepeerETHTicketBroker contract. +type LivepeerETHTicketBrokerWithdrawal struct { + Sender common.Address + Deposit *big.Int + PenaltyEscrow *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawal is a free log retrieval operation binding the contract event 0xdf273cb619d95419a9cd0ec88123a0538c85064229baa6363788f743fff90deb. +// +// Solidity: event Withdrawal(address indexed sender, uint256 deposit, uint256 penaltyEscrow) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) FilterWithdrawal(opts *bind.FilterOpts, sender []common.Address) (*LivepeerETHTicketBrokerWithdrawalIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.FilterLogs(opts, "Withdrawal", senderRule) + if err != nil { + return nil, err + } + return &LivepeerETHTicketBrokerWithdrawalIterator{contract: _LivepeerETHTicketBroker.contract, event: "Withdrawal", logs: logs, sub: sub}, nil +} + +// WatchWithdrawal is a free log subscription operation binding the contract event 0xdf273cb619d95419a9cd0ec88123a0538c85064229baa6363788f743fff90deb. +// +// Solidity: event Withdrawal(address indexed sender, uint256 deposit, uint256 penaltyEscrow) +func (_LivepeerETHTicketBroker *LivepeerETHTicketBrokerFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *LivepeerETHTicketBrokerWithdrawal, sender []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _LivepeerETHTicketBroker.contract.WatchLogs(opts, "Withdrawal", senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerETHTicketBrokerWithdrawal) + if err := _LivepeerETHTicketBroker.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} diff --git a/eth/contracts/livepeerToken.go b/eth/contracts/livepeerToken.go index f0aa3eab8..b471bbecd 100644 --- a/eth/contracts/livepeerToken.go +++ b/eth/contracts/livepeerToken.go @@ -15,8 +15,20 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // LivepeerTokenABI is the input ABI used to generate the binding from. -const LivepeerTokenABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"mintingFinished\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finishMinting\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"burner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MintFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"}]" +const LivepeerTokenABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"mintingFinished\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finishMinting\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"burner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MintFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}]" // LivepeerToken is an auto generated Go binding around an Ethereum contract. type LivepeerToken struct { @@ -162,54 +174,54 @@ func (_LivepeerToken *LivepeerTokenTransactorRaw) Transact(opts *bind.TransactOp // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // -// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) -func (_LivepeerToken *LivepeerTokenCaller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 - err := _LivepeerToken.contract.Call(opts, out, "allowance", _owner, _spender) + err := _LivepeerToken.contract.Call(opts, out, "allowance", owner, spender) return *ret0, err } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // -// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) -func (_LivepeerToken *LivepeerTokenSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { - return _LivepeerToken.Contract.Allowance(&_LivepeerToken.CallOpts, _owner, _spender) +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.Allowance(&_LivepeerToken.CallOpts, owner, spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // -// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) -func (_LivepeerToken *LivepeerTokenCallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { - return _LivepeerToken.Contract.Allowance(&_LivepeerToken.CallOpts, _owner, _spender) +// Solidity: function allowance(address owner, address spender) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.Allowance(&_LivepeerToken.CallOpts, owner, spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// Solidity: function balanceOf(_owner address) constant returns(balance uint256) -func (_LivepeerToken *LivepeerTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { +// Solidity: function balanceOf(address owner) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 - err := _LivepeerToken.contract.Call(opts, out, "balanceOf", _owner) + err := _LivepeerToken.contract.Call(opts, out, "balanceOf", owner) return *ret0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// Solidity: function balanceOf(_owner address) constant returns(balance uint256) -func (_LivepeerToken *LivepeerTokenSession) BalanceOf(_owner common.Address) (*big.Int, error) { - return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, _owner) +// Solidity: function balanceOf(address owner) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// Solidity: function balanceOf(_owner address) constant returns(balance uint256) -func (_LivepeerToken *LivepeerTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { - return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, _owner) +// Solidity: function balanceOf(address owner) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, owner) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. @@ -396,65 +408,65 @@ func (_LivepeerToken *LivepeerTokenCallerSession) Version() (string, error) { // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // -// Solidity: function approve(_spender address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.contract.Transact(opts, "approve", _spender, _value) +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "approve", spender, value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // -// Solidity: function approve(_spender address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.Approve(&_LivepeerToken.TransactOpts, _spender, _value) +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Approve(&_LivepeerToken.TransactOpts, spender, value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // -// Solidity: function approve(_spender address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.Approve(&_LivepeerToken.TransactOpts, _spender, _value) +// Solidity: function approve(address spender, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Approve(&_LivepeerToken.TransactOpts, spender, value) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // -// Solidity: function burn(_amount uint256) returns() +// Solidity: function burn(uint256 _amount) returns() func (_LivepeerToken *LivepeerTokenTransactor) Burn(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.contract.Transact(opts, "burn", _amount) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // -// Solidity: function burn(_amount uint256) returns() +// Solidity: function burn(uint256 _amount) returns() func (_LivepeerToken *LivepeerTokenSession) Burn(_amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.Contract.Burn(&_LivepeerToken.TransactOpts, _amount) } // Burn is a paid mutator transaction binding the contract method 0x42966c68. // -// Solidity: function burn(_amount uint256) returns() +// Solidity: function burn(uint256 _amount) returns() func (_LivepeerToken *LivepeerTokenTransactorSession) Burn(_amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.Contract.Burn(&_LivepeerToken.TransactOpts, _amount) } -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // -// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue) +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) } -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // -// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.DecreaseApproval(&_LivepeerToken.TransactOpts, _spender, _subtractedValue) +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.DecreaseAllowance(&_LivepeerToken.TransactOpts, spender, subtractedValue) } -// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. // -// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.DecreaseApproval(&_LivepeerToken.TransactOpts, _spender, _subtractedValue) +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.DecreaseAllowance(&_LivepeerToken.TransactOpts, spender, subtractedValue) } // FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. @@ -478,107 +490,107 @@ func (_LivepeerToken *LivepeerTokenTransactorSession) FinishMinting() (*types.Tr return _LivepeerToken.Contract.FinishMinting(&_LivepeerToken.TransactOpts) } -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // -// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.contract.Transact(opts, "increaseApproval", _spender, _addedValue) +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) } -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // -// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.IncreaseApproval(&_LivepeerToken.TransactOpts, _spender, _addedValue) +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.IncreaseAllowance(&_LivepeerToken.TransactOpts, spender, addedValue) } -// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. // -// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.IncreaseApproval(&_LivepeerToken.TransactOpts, _spender, _addedValue) +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.IncreaseAllowance(&_LivepeerToken.TransactOpts, spender, addedValue) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // -// Solidity: function mint(_to address, _amount uint256) returns(bool) +// Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_LivepeerToken *LivepeerTokenTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.contract.Transact(opts, "mint", _to, _amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // -// Solidity: function mint(_to address, _amount uint256) returns(bool) +// Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_LivepeerToken *LivepeerTokenSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.Contract.Mint(&_LivepeerToken.TransactOpts, _to, _amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // -// Solidity: function mint(_to address, _amount uint256) returns(bool) +// Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_LivepeerToken *LivepeerTokenTransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _LivepeerToken.Contract.Mint(&_LivepeerToken.TransactOpts, _to, _amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// Solidity: function transfer(_to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.contract.Transact(opts, "transfer", _to, _value) +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "transfer", to, value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// Solidity: function transfer(_to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, _to, _value) +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, to, value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// Solidity: function transfer(_to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, _to, _value) +// Solidity: function transfer(address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.contract.Transact(opts, "transferFrom", _from, _to, _value) +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "transferFrom", from, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, _from, _to, _value) +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, from, to, value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) -func (_LivepeerToken *LivepeerTokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { - return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, _from, _to, _value) +// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, from, to, value) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerToken *LivepeerTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _LivepeerToken.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerToken *LivepeerTokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _LivepeerToken.Contract.TransferOwnership(&_LivepeerToken.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerToken *LivepeerTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _LivepeerToken.Contract.TransferOwnership(&_LivepeerToken.TransactOpts, newOwner) } @@ -660,7 +672,7 @@ type LivepeerTokenApproval struct { // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // -// Solidity: event Approval(owner indexed address, spender indexed address, value uint256) +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*LivepeerTokenApprovalIterator, error) { var ownerRule []interface{} @@ -681,7 +693,7 @@ func (_LivepeerToken *LivepeerTokenFilterer) FilterApproval(opts *bind.FilterOpt // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. // -// Solidity: event Approval(owner indexed address, spender indexed address, value uint256) +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *LivepeerTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { var ownerRule []interface{} @@ -801,7 +813,7 @@ type LivepeerTokenBurn struct { // FilterBurn is a free log retrieval operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. // -// Solidity: event Burn(burner indexed address, value uint256) +// Solidity: event Burn(address indexed burner, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) FilterBurn(opts *bind.FilterOpts, burner []common.Address) (*LivepeerTokenBurnIterator, error) { var burnerRule []interface{} @@ -818,7 +830,7 @@ func (_LivepeerToken *LivepeerTokenFilterer) FilterBurn(opts *bind.FilterOpts, b // WatchBurn is a free log subscription operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. // -// Solidity: event Burn(burner indexed address, value uint256) +// Solidity: event Burn(address indexed burner, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *LivepeerTokenBurn, burner []common.Address) (event.Subscription, error) { var burnerRule []interface{} @@ -934,7 +946,7 @@ type LivepeerTokenMint struct { // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // -// Solidity: event Mint(to indexed address, amount uint256) +// Solidity: event Mint(address indexed to, uint256 amount) func (_LivepeerToken *LivepeerTokenFilterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*LivepeerTokenMintIterator, error) { var toRule []interface{} @@ -951,7 +963,7 @@ func (_LivepeerToken *LivepeerTokenFilterer) FilterMint(opts *bind.FilterOpts, t // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // -// Solidity: event Mint(to indexed address, amount uint256) +// Solidity: event Mint(address indexed to, uint256 amount) func (_LivepeerToken *LivepeerTokenFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *LivepeerTokenMint, to []common.Address) (event.Subscription, error) { var toRule []interface{} @@ -1188,7 +1200,7 @@ type LivepeerTokenOwnershipTransferred struct { // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_LivepeerToken *LivepeerTokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*LivepeerTokenOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} @@ -1209,7 +1221,7 @@ func (_LivepeerToken *LivepeerTokenFilterer) FilterOwnershipTransferred(opts *bi // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_LivepeerToken *LivepeerTokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LivepeerTokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} @@ -1330,7 +1342,7 @@ type LivepeerTokenTransfer struct { // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // -// Solidity: event Transfer(from indexed address, to indexed address, value uint256) +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*LivepeerTokenTransferIterator, error) { var fromRule []interface{} @@ -1351,7 +1363,7 @@ func (_LivepeerToken *LivepeerTokenFilterer) FilterTransfer(opts *bind.FilterOpt // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // -// Solidity: event Transfer(from indexed address, to indexed address, value uint256) +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) func (_LivepeerToken *LivepeerTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *LivepeerTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { var fromRule []interface{} diff --git a/eth/contracts/livepeerTokenFaucet.go b/eth/contracts/livepeerTokenFaucet.go index e9e018627..47947a4fe 100644 --- a/eth/contracts/livepeerTokenFaucet.go +++ b/eth/contracts/livepeerTokenFaucet.go @@ -15,6 +15,18 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // LivepeerTokenFaucetABI is the input ABI used to generate the binding from. const LivepeerTokenFaucetABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"requestWait\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"nextValidRequest\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"isWhitelisted\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"requestAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_token\",\"type\":\"address\"},{\"name\":\"_requestAmount\",\"type\":\"uint256\"},{\"name\":\"_requestWait\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Request\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"addToWhitelist\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"removeFromWhitelist\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" @@ -162,7 +174,7 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactorRaw) Transact(opts *bin // IsWhitelisted is a free data retrieval call binding the contract method 0x3af32abf. // -// Solidity: function isWhitelisted( address) constant returns(bool) +// Solidity: function isWhitelisted(address ) constant returns(bool) func (_LivepeerTokenFaucet *LivepeerTokenFaucetCaller) IsWhitelisted(opts *bind.CallOpts, arg0 common.Address) (bool, error) { var ( ret0 = new(bool) @@ -174,21 +186,21 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetCaller) IsWhitelisted(opts *bind. // IsWhitelisted is a free data retrieval call binding the contract method 0x3af32abf. // -// Solidity: function isWhitelisted( address) constant returns(bool) +// Solidity: function isWhitelisted(address ) constant returns(bool) func (_LivepeerTokenFaucet *LivepeerTokenFaucetSession) IsWhitelisted(arg0 common.Address) (bool, error) { return _LivepeerTokenFaucet.Contract.IsWhitelisted(&_LivepeerTokenFaucet.CallOpts, arg0) } // IsWhitelisted is a free data retrieval call binding the contract method 0x3af32abf. // -// Solidity: function isWhitelisted( address) constant returns(bool) +// Solidity: function isWhitelisted(address ) constant returns(bool) func (_LivepeerTokenFaucet *LivepeerTokenFaucetCallerSession) IsWhitelisted(arg0 common.Address) (bool, error) { return _LivepeerTokenFaucet.Contract.IsWhitelisted(&_LivepeerTokenFaucet.CallOpts, arg0) } // NextValidRequest is a free data retrieval call binding the contract method 0x207f5ce6. // -// Solidity: function nextValidRequest( address) constant returns(uint256) +// Solidity: function nextValidRequest(address ) constant returns(uint256) func (_LivepeerTokenFaucet *LivepeerTokenFaucetCaller) NextValidRequest(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) @@ -200,14 +212,14 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetCaller) NextValidRequest(opts *bi // NextValidRequest is a free data retrieval call binding the contract method 0x207f5ce6. // -// Solidity: function nextValidRequest( address) constant returns(uint256) +// Solidity: function nextValidRequest(address ) constant returns(uint256) func (_LivepeerTokenFaucet *LivepeerTokenFaucetSession) NextValidRequest(arg0 common.Address) (*big.Int, error) { return _LivepeerTokenFaucet.Contract.NextValidRequest(&_LivepeerTokenFaucet.CallOpts, arg0) } // NextValidRequest is a free data retrieval call binding the contract method 0x207f5ce6. // -// Solidity: function nextValidRequest( address) constant returns(uint256) +// Solidity: function nextValidRequest(address ) constant returns(uint256) func (_LivepeerTokenFaucet *LivepeerTokenFaucetCallerSession) NextValidRequest(arg0 common.Address) (*big.Int, error) { return _LivepeerTokenFaucet.Contract.NextValidRequest(&_LivepeerTokenFaucet.CallOpts, arg0) } @@ -318,42 +330,42 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetCallerSession) Token() (common.Ad // AddToWhitelist is a paid mutator transaction binding the contract method 0xe43252d7. // -// Solidity: function addToWhitelist(_addr address) returns() +// Solidity: function addToWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactor) AddToWhitelist(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.contract.Transact(opts, "addToWhitelist", _addr) } // AddToWhitelist is a paid mutator transaction binding the contract method 0xe43252d7. // -// Solidity: function addToWhitelist(_addr address) returns() +// Solidity: function addToWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetSession) AddToWhitelist(_addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.AddToWhitelist(&_LivepeerTokenFaucet.TransactOpts, _addr) } // AddToWhitelist is a paid mutator transaction binding the contract method 0xe43252d7. // -// Solidity: function addToWhitelist(_addr address) returns() +// Solidity: function addToWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactorSession) AddToWhitelist(_addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.AddToWhitelist(&_LivepeerTokenFaucet.TransactOpts, _addr) } // RemoveFromWhitelist is a paid mutator transaction binding the contract method 0x8ab1d681. // -// Solidity: function removeFromWhitelist(_addr address) returns() +// Solidity: function removeFromWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactor) RemoveFromWhitelist(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.contract.Transact(opts, "removeFromWhitelist", _addr) } // RemoveFromWhitelist is a paid mutator transaction binding the contract method 0x8ab1d681. // -// Solidity: function removeFromWhitelist(_addr address) returns() +// Solidity: function removeFromWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetSession) RemoveFromWhitelist(_addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.RemoveFromWhitelist(&_LivepeerTokenFaucet.TransactOpts, _addr) } // RemoveFromWhitelist is a paid mutator transaction binding the contract method 0x8ab1d681. // -// Solidity: function removeFromWhitelist(_addr address) returns() +// Solidity: function removeFromWhitelist(address _addr) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactorSession) RemoveFromWhitelist(_addr common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.RemoveFromWhitelist(&_LivepeerTokenFaucet.TransactOpts, _addr) } @@ -381,21 +393,21 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactorSession) Request() (*ty // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.contract.Transact(opts, "transferOwnership", newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.TransferOwnership(&_LivepeerTokenFaucet.TransactOpts, newOwner) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: function transferOwnership(newOwner address) returns() +// Solidity: function transferOwnership(address newOwner) returns() func (_LivepeerTokenFaucet *LivepeerTokenFaucetTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { return _LivepeerTokenFaucet.Contract.TransferOwnership(&_LivepeerTokenFaucet.TransactOpts, newOwner) } @@ -476,7 +488,7 @@ type LivepeerTokenFaucetOwnershipTransferred struct { // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*LivepeerTokenFaucetOwnershipTransferredIterator, error) { var previousOwnerRule []interface{} @@ -497,7 +509,7 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) FilterOwnershipTransfer // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event OwnershipTransferred(previousOwner indexed address, newOwner indexed address) +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LivepeerTokenFaucetOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { var previousOwnerRule []interface{} @@ -617,7 +629,7 @@ type LivepeerTokenFaucetRequest struct { // FilterRequest is a free log retrieval operation binding the contract event 0xe31c60e37ab1301f69f01b436a1d13486e6c16cc22c888a08c0e64a39230b6ac. // -// Solidity: event Request(to indexed address, amount uint256) +// Solidity: event Request(address indexed to, uint256 amount) func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) FilterRequest(opts *bind.FilterOpts, to []common.Address) (*LivepeerTokenFaucetRequestIterator, error) { var toRule []interface{} @@ -634,7 +646,7 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) FilterRequest(opts *bin // WatchRequest is a free log subscription operation binding the contract event 0xe31c60e37ab1301f69f01b436a1d13486e6c16cc22c888a08c0e64a39230b6ac. // -// Solidity: event Request(to indexed address, amount uint256) +// Solidity: event Request(address indexed to, uint256 amount) func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) WatchRequest(opts *bind.WatchOpts, sink chan<- *LivepeerTokenFaucetRequest, to []common.Address) (event.Subscription, error) { var toRule []interface{} diff --git a/eth/contracts/livepeerVerifier.go b/eth/contracts/livepeerVerifier.go index a641041b6..2e522b0fa 100644 --- a/eth/contracts/livepeerVerifier.go +++ b/eth/contracts/livepeerVerifier.go @@ -15,8 +15,20 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // LivepeerVerifierABI is the input ABI used to generate the binding from. -const LivepeerVerifierABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"isSolver\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"verificationCodeHash\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"requestCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requests\",\"outputs\":[{\"name\":\"jobId\",\"type\":\"uint256\"},{\"name\":\"claimId\",\"type\":\"uint256\"},{\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"solvers\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"},{\"name\":\"_solvers\",\"type\":\"address[]\"},{\"name\":\"_verificationCodeHash\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"transcodingOptions\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"dataStorageHash\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"transcodedDataHash\",\"type\":\"bytes32\"}],\"name\":\"VerifyRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"Callback\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_verificationCodeHash\",\"type\":\"string\"}],\"name\":\"setVerificationCodeHash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_solver\",\"type\":\"address\"}],\"name\":\"addSolver\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"},{\"name\":\"_transcodingOptions\",\"type\":\"string\"},{\"name\":\"_dataStorageHash\",\"type\":\"string\"},{\"name\":\"_dataHashes\",\"type\":\"bytes32[2]\"}],\"name\":\"verify\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_requestId\",\"type\":\"uint256\"},{\"name\":\"_result\",\"type\":\"bytes32\"}],\"name\":\"__callback\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" +const LivepeerVerifierABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"verificationCodeHash\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"solver\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"requestCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requests\",\"outputs\":[{\"name\":\"jobId\",\"type\":\"uint256\"},{\"name\":\"claimId\",\"type\":\"uint256\"},{\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"},{\"name\":\"_solver\",\"type\":\"address\"},{\"name\":\"_verificationCodeHash\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"transcodingOptions\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"dataStorageHash\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"transcodedDataHash\",\"type\":\"bytes32\"}],\"name\":\"VerifyRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"jobId\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"claimId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"segmentNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"}],\"name\":\"Callback\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"solver\",\"type\":\"address\"}],\"name\":\"SolverUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_verificationCodeHash\",\"type\":\"string\"}],\"name\":\"setVerificationCodeHash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_solver\",\"type\":\"address\"}],\"name\":\"setSolver\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_jobId\",\"type\":\"uint256\"},{\"name\":\"_claimId\",\"type\":\"uint256\"},{\"name\":\"_segmentNumber\",\"type\":\"uint256\"},{\"name\":\"_transcodingOptions\",\"type\":\"string\"},{\"name\":\"_dataStorageHash\",\"type\":\"string\"},{\"name\":\"_dataHashes\",\"type\":\"bytes32[2]\"}],\"name\":\"verify\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_requestId\",\"type\":\"uint256\"},{\"name\":\"_result\",\"type\":\"bytes32\"}],\"name\":\"__callback\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // LivepeerVerifier is an auto generated Go binding around an Ethereum contract. type LivepeerVerifier struct { @@ -212,32 +224,6 @@ func (_LivepeerVerifier *LivepeerVerifierCallerSession) GetPrice() (*big.Int, er return _LivepeerVerifier.Contract.GetPrice(&_LivepeerVerifier.CallOpts) } -// IsSolver is a free data retrieval call binding the contract method 0x02cc250d. -// -// Solidity: function isSolver( address) constant returns(bool) -func (_LivepeerVerifier *LivepeerVerifierCaller) IsSolver(opts *bind.CallOpts, arg0 common.Address) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _LivepeerVerifier.contract.Call(opts, out, "isSolver", arg0) - return *ret0, err -} - -// IsSolver is a free data retrieval call binding the contract method 0x02cc250d. -// -// Solidity: function isSolver( address) constant returns(bool) -func (_LivepeerVerifier *LivepeerVerifierSession) IsSolver(arg0 common.Address) (bool, error) { - return _LivepeerVerifier.Contract.IsSolver(&_LivepeerVerifier.CallOpts, arg0) -} - -// IsSolver is a free data retrieval call binding the contract method 0x02cc250d. -// -// Solidity: function isSolver( address) constant returns(bool) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) IsSolver(arg0 common.Address) (bool, error) { - return _LivepeerVerifier.Contract.IsSolver(&_LivepeerVerifier.CallOpts, arg0) -} - // RequestCount is a free data retrieval call binding the contract method 0x5badbe4c. // // Solidity: function requestCount() constant returns(uint256) @@ -266,7 +252,7 @@ func (_LivepeerVerifier *LivepeerVerifierCallerSession) RequestCount() (*big.Int // Requests is a free data retrieval call binding the contract method 0x81d12c58. // -// Solidity: function requests( uint256) constant returns(jobId uint256, claimId uint256, segmentNumber uint256, commitHash bytes32) +// Solidity: function requests(uint256 ) constant returns(uint256 jobId, uint256 claimId, uint256 segmentNumber, bytes32 commitHash) func (_LivepeerVerifier *LivepeerVerifierCaller) Requests(opts *bind.CallOpts, arg0 *big.Int) (struct { JobId *big.Int ClaimId *big.Int @@ -286,7 +272,7 @@ func (_LivepeerVerifier *LivepeerVerifierCaller) Requests(opts *bind.CallOpts, a // Requests is a free data retrieval call binding the contract method 0x81d12c58. // -// Solidity: function requests( uint256) constant returns(jobId uint256, claimId uint256, segmentNumber uint256, commitHash bytes32) +// Solidity: function requests(uint256 ) constant returns(uint256 jobId, uint256 claimId, uint256 segmentNumber, bytes32 commitHash) func (_LivepeerVerifier *LivepeerVerifierSession) Requests(arg0 *big.Int) (struct { JobId *big.Int ClaimId *big.Int @@ -298,7 +284,7 @@ func (_LivepeerVerifier *LivepeerVerifierSession) Requests(arg0 *big.Int) (struc // Requests is a free data retrieval call binding the contract method 0x81d12c58. // -// Solidity: function requests( uint256) constant returns(jobId uint256, claimId uint256, segmentNumber uint256, commitHash bytes32) +// Solidity: function requests(uint256 ) constant returns(uint256 jobId, uint256 claimId, uint256 segmentNumber, bytes32 commitHash) func (_LivepeerVerifier *LivepeerVerifierCallerSession) Requests(arg0 *big.Int) (struct { JobId *big.Int ClaimId *big.Int @@ -308,30 +294,30 @@ func (_LivepeerVerifier *LivepeerVerifierCallerSession) Requests(arg0 *big.Int) return _LivepeerVerifier.Contract.Requests(&_LivepeerVerifier.CallOpts, arg0) } -// Solvers is a free data retrieval call binding the contract method 0x92ce765e. +// Solver is a free data retrieval call binding the contract method 0x49a7a26d. // -// Solidity: function solvers( uint256) constant returns(address) -func (_LivepeerVerifier *LivepeerVerifierCaller) Solvers(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { +// Solidity: function solver() constant returns(address) +func (_LivepeerVerifier *LivepeerVerifierCaller) Solver(opts *bind.CallOpts) (common.Address, error) { var ( ret0 = new(common.Address) ) out := ret0 - err := _LivepeerVerifier.contract.Call(opts, out, "solvers", arg0) + err := _LivepeerVerifier.contract.Call(opts, out, "solver") return *ret0, err } -// Solvers is a free data retrieval call binding the contract method 0x92ce765e. +// Solver is a free data retrieval call binding the contract method 0x49a7a26d. // -// Solidity: function solvers( uint256) constant returns(address) -func (_LivepeerVerifier *LivepeerVerifierSession) Solvers(arg0 *big.Int) (common.Address, error) { - return _LivepeerVerifier.Contract.Solvers(&_LivepeerVerifier.CallOpts, arg0) +// Solidity: function solver() constant returns(address) +func (_LivepeerVerifier *LivepeerVerifierSession) Solver() (common.Address, error) { + return _LivepeerVerifier.Contract.Solver(&_LivepeerVerifier.CallOpts) } -// Solvers is a free data retrieval call binding the contract method 0x92ce765e. +// Solver is a free data retrieval call binding the contract method 0x49a7a26d. // -// Solidity: function solvers( uint256) constant returns(address) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) Solvers(arg0 *big.Int) (common.Address, error) { - return _LivepeerVerifier.Contract.Solvers(&_LivepeerVerifier.CallOpts, arg0) +// Solidity: function solver() constant returns(address) +func (_LivepeerVerifier *LivepeerVerifierCallerSession) Solver() (common.Address, error) { + return _LivepeerVerifier.Contract.Solver(&_LivepeerVerifier.CallOpts) } // VerificationCodeHash is a free data retrieval call binding the contract method 0x41af1524. @@ -362,105 +348,105 @@ func (_LivepeerVerifier *LivepeerVerifierCallerSession) VerificationCodeHash() ( // Callback is a paid mutator transaction binding the contract method 0x9842a37c. // -// Solidity: function __callback(_requestId uint256, _result bytes32) returns() +// Solidity: function __callback(uint256 _requestId, bytes32 _result) returns() func (_LivepeerVerifier *LivepeerVerifierTransactor) Callback(opts *bind.TransactOpts, _requestId *big.Int, _result [32]byte) (*types.Transaction, error) { return _LivepeerVerifier.contract.Transact(opts, "__callback", _requestId, _result) } // Callback is a paid mutator transaction binding the contract method 0x9842a37c. // -// Solidity: function __callback(_requestId uint256, _result bytes32) returns() +// Solidity: function __callback(uint256 _requestId, bytes32 _result) returns() func (_LivepeerVerifier *LivepeerVerifierSession) Callback(_requestId *big.Int, _result [32]byte) (*types.Transaction, error) { return _LivepeerVerifier.Contract.Callback(&_LivepeerVerifier.TransactOpts, _requestId, _result) } // Callback is a paid mutator transaction binding the contract method 0x9842a37c. // -// Solidity: function __callback(_requestId uint256, _result bytes32) returns() +// Solidity: function __callback(uint256 _requestId, bytes32 _result) returns() func (_LivepeerVerifier *LivepeerVerifierTransactorSession) Callback(_requestId *big.Int, _result [32]byte) (*types.Transaction, error) { return _LivepeerVerifier.Contract.Callback(&_LivepeerVerifier.TransactOpts, _requestId, _result) } -// AddSolver is a paid mutator transaction binding the contract method 0xec58f4b8. -// -// Solidity: function addSolver(_solver address) returns() -func (_LivepeerVerifier *LivepeerVerifierTransactor) AddSolver(opts *bind.TransactOpts, _solver common.Address) (*types.Transaction, error) { - return _LivepeerVerifier.contract.Transact(opts, "addSolver", _solver) -} - -// AddSolver is a paid mutator transaction binding the contract method 0xec58f4b8. -// -// Solidity: function addSolver(_solver address) returns() -func (_LivepeerVerifier *LivepeerVerifierSession) AddSolver(_solver common.Address) (*types.Transaction, error) { - return _LivepeerVerifier.Contract.AddSolver(&_LivepeerVerifier.TransactOpts, _solver) -} - -// AddSolver is a paid mutator transaction binding the contract method 0xec58f4b8. -// -// Solidity: function addSolver(_solver address) returns() -func (_LivepeerVerifier *LivepeerVerifierTransactorSession) AddSolver(_solver common.Address) (*types.Transaction, error) { - return _LivepeerVerifier.Contract.AddSolver(&_LivepeerVerifier.TransactOpts, _solver) -} - // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_LivepeerVerifier *LivepeerVerifierTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { return _LivepeerVerifier.contract.Transact(opts, "setController", _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_LivepeerVerifier *LivepeerVerifierSession) SetController(_controller common.Address) (*types.Transaction, error) { return _LivepeerVerifier.Contract.SetController(&_LivepeerVerifier.TransactOpts, _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_LivepeerVerifier *LivepeerVerifierTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { return _LivepeerVerifier.Contract.SetController(&_LivepeerVerifier.TransactOpts, _controller) } +// SetSolver is a paid mutator transaction binding the contract method 0x1f879433. +// +// Solidity: function setSolver(address _solver) returns() +func (_LivepeerVerifier *LivepeerVerifierTransactor) SetSolver(opts *bind.TransactOpts, _solver common.Address) (*types.Transaction, error) { + return _LivepeerVerifier.contract.Transact(opts, "setSolver", _solver) +} + +// SetSolver is a paid mutator transaction binding the contract method 0x1f879433. +// +// Solidity: function setSolver(address _solver) returns() +func (_LivepeerVerifier *LivepeerVerifierSession) SetSolver(_solver common.Address) (*types.Transaction, error) { + return _LivepeerVerifier.Contract.SetSolver(&_LivepeerVerifier.TransactOpts, _solver) +} + +// SetSolver is a paid mutator transaction binding the contract method 0x1f879433. +// +// Solidity: function setSolver(address _solver) returns() +func (_LivepeerVerifier *LivepeerVerifierTransactorSession) SetSolver(_solver common.Address) (*types.Transaction, error) { + return _LivepeerVerifier.Contract.SetSolver(&_LivepeerVerifier.TransactOpts, _solver) +} + // SetVerificationCodeHash is a paid mutator transaction binding the contract method 0x4862e650. // -// Solidity: function setVerificationCodeHash(_verificationCodeHash string) returns() +// Solidity: function setVerificationCodeHash(string _verificationCodeHash) returns() func (_LivepeerVerifier *LivepeerVerifierTransactor) SetVerificationCodeHash(opts *bind.TransactOpts, _verificationCodeHash string) (*types.Transaction, error) { return _LivepeerVerifier.contract.Transact(opts, "setVerificationCodeHash", _verificationCodeHash) } // SetVerificationCodeHash is a paid mutator transaction binding the contract method 0x4862e650. // -// Solidity: function setVerificationCodeHash(_verificationCodeHash string) returns() +// Solidity: function setVerificationCodeHash(string _verificationCodeHash) returns() func (_LivepeerVerifier *LivepeerVerifierSession) SetVerificationCodeHash(_verificationCodeHash string) (*types.Transaction, error) { return _LivepeerVerifier.Contract.SetVerificationCodeHash(&_LivepeerVerifier.TransactOpts, _verificationCodeHash) } // SetVerificationCodeHash is a paid mutator transaction binding the contract method 0x4862e650. // -// Solidity: function setVerificationCodeHash(_verificationCodeHash string) returns() +// Solidity: function setVerificationCodeHash(string _verificationCodeHash) returns() func (_LivepeerVerifier *LivepeerVerifierTransactorSession) SetVerificationCodeHash(_verificationCodeHash string) (*types.Transaction, error) { return _LivepeerVerifier.Contract.SetVerificationCodeHash(&_LivepeerVerifier.TransactOpts, _verificationCodeHash) } // Verify is a paid mutator transaction binding the contract method 0x8c118cf1. // -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _transcodingOptions string, _dataStorageHash string, _dataHashes bytes32[2]) returns() +// Solidity: function verify(uint256 _jobId, uint256 _claimId, uint256 _segmentNumber, string _transcodingOptions, string _dataStorageHash, bytes32[2] _dataHashes) returns() func (_LivepeerVerifier *LivepeerVerifierTransactor) Verify(opts *bind.TransactOpts, _jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _transcodingOptions string, _dataStorageHash string, _dataHashes [2][32]byte) (*types.Transaction, error) { return _LivepeerVerifier.contract.Transact(opts, "verify", _jobId, _claimId, _segmentNumber, _transcodingOptions, _dataStorageHash, _dataHashes) } // Verify is a paid mutator transaction binding the contract method 0x8c118cf1. // -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _transcodingOptions string, _dataStorageHash string, _dataHashes bytes32[2]) returns() +// Solidity: function verify(uint256 _jobId, uint256 _claimId, uint256 _segmentNumber, string _transcodingOptions, string _dataStorageHash, bytes32[2] _dataHashes) returns() func (_LivepeerVerifier *LivepeerVerifierSession) Verify(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _transcodingOptions string, _dataStorageHash string, _dataHashes [2][32]byte) (*types.Transaction, error) { return _LivepeerVerifier.Contract.Verify(&_LivepeerVerifier.TransactOpts, _jobId, _claimId, _segmentNumber, _transcodingOptions, _dataStorageHash, _dataHashes) } // Verify is a paid mutator transaction binding the contract method 0x8c118cf1. // -// Solidity: function verify(_jobId uint256, _claimId uint256, _segmentNumber uint256, _transcodingOptions string, _dataStorageHash string, _dataHashes bytes32[2]) returns() +// Solidity: function verify(uint256 _jobId, uint256 _claimId, uint256 _segmentNumber, string _transcodingOptions, string _dataStorageHash, bytes32[2] _dataHashes) returns() func (_LivepeerVerifier *LivepeerVerifierTransactorSession) Verify(_jobId *big.Int, _claimId *big.Int, _segmentNumber *big.Int, _transcodingOptions string, _dataStorageHash string, _dataHashes [2][32]byte) (*types.Transaction, error) { return _LivepeerVerifier.Contract.Verify(&_LivepeerVerifier.TransactOpts, _jobId, _claimId, _segmentNumber, _transcodingOptions, _dataStorageHash, _dataHashes) } @@ -544,7 +530,7 @@ type LivepeerVerifierCallback struct { // FilterCallback is a free log retrieval operation binding the contract event 0xaa22eba262859195ec25c1d3c94f98248add6d1374bd46df08c78470225df8d3. // -// Solidity: event Callback(requestId indexed uint256, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256, result bool) +// Solidity: event Callback(uint256 indexed requestId, uint256 indexed jobId, uint256 indexed claimId, uint256 segmentNumber, bool result) func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterCallback(opts *bind.FilterOpts, requestId []*big.Int, jobId []*big.Int, claimId []*big.Int) (*LivepeerVerifierCallbackIterator, error) { var requestIdRule []interface{} @@ -569,7 +555,7 @@ func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterCallback(opts *bind.Fil // WatchCallback is a free log subscription operation binding the contract event 0xaa22eba262859195ec25c1d3c94f98248add6d1374bd46df08c78470225df8d3. // -// Solidity: event Callback(requestId indexed uint256, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256, result bool) +// Solidity: event Callback(uint256 indexed requestId, uint256 indexed jobId, uint256 indexed claimId, uint256 segmentNumber, bool result) func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchCallback(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierCallback, requestId []*big.Int, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { var requestIdRule []interface{} @@ -692,7 +678,7 @@ type LivepeerVerifierParameterUpdate struct { // FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*LivepeerVerifierParameterUpdateIterator, error) { logs, sub, err := _LivepeerVerifier.contract.FilterLogs(opts, "ParameterUpdate") @@ -704,7 +690,7 @@ func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterParameterUpdate(opts *b // WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierParameterUpdate) (event.Subscription, error) { logs, sub, err := _LivepeerVerifier.contract.WatchLogs(opts, "ParameterUpdate") @@ -814,7 +800,7 @@ type LivepeerVerifierSetController struct { // FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterSetController(opts *bind.FilterOpts) (*LivepeerVerifierSetControllerIterator, error) { logs, sub, err := _LivepeerVerifier.contract.FilterLogs(opts, "SetController") @@ -826,7 +812,7 @@ func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterSetController(opts *bin // WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierSetController) (event.Subscription, error) { logs, sub, err := _LivepeerVerifier.contract.WatchLogs(opts, "SetController") @@ -861,6 +847,128 @@ func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchSetController(opts *bind }), nil } +// LivepeerVerifierSolverUpdateIterator is returned from FilterSolverUpdate and is used to iterate over the raw logs and unpacked data for SolverUpdate events raised by the LivepeerVerifier contract. +type LivepeerVerifierSolverUpdateIterator struct { + Event *LivepeerVerifierSolverUpdate // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *LivepeerVerifierSolverUpdateIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(LivepeerVerifierSolverUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(LivepeerVerifierSolverUpdate) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *LivepeerVerifierSolverUpdateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *LivepeerVerifierSolverUpdateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// LivepeerVerifierSolverUpdate represents a SolverUpdate event raised by the LivepeerVerifier contract. +type LivepeerVerifierSolverUpdate struct { + Solver common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSolverUpdate is a free log retrieval operation binding the contract event 0xace515c35c46c2bef1424779ab5938a69fd660a490ba0a4863392ee28000666f. +// +// Solidity: event SolverUpdate(address solver) +func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterSolverUpdate(opts *bind.FilterOpts) (*LivepeerVerifierSolverUpdateIterator, error) { + + logs, sub, err := _LivepeerVerifier.contract.FilterLogs(opts, "SolverUpdate") + if err != nil { + return nil, err + } + return &LivepeerVerifierSolverUpdateIterator{contract: _LivepeerVerifier.contract, event: "SolverUpdate", logs: logs, sub: sub}, nil +} + +// WatchSolverUpdate is a free log subscription operation binding the contract event 0xace515c35c46c2bef1424779ab5938a69fd660a490ba0a4863392ee28000666f. +// +// Solidity: event SolverUpdate(address solver) +func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchSolverUpdate(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierSolverUpdate) (event.Subscription, error) { + + logs, sub, err := _LivepeerVerifier.contract.WatchLogs(opts, "SolverUpdate") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(LivepeerVerifierSolverUpdate) + if err := _LivepeerVerifier.contract.UnpackLog(event, "SolverUpdate", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + // LivepeerVerifierVerifyRequestIterator is returned from FilterVerifyRequest and is used to iterate over the raw logs and unpacked data for VerifyRequest events raised by the LivepeerVerifier contract. type LivepeerVerifierVerifyRequestIterator struct { Event *LivepeerVerifierVerifyRequest // Event containing the contract specifics and raw log @@ -943,7 +1051,7 @@ type LivepeerVerifierVerifyRequest struct { // FilterVerifyRequest is a free log retrieval operation binding the contract event 0xf68da1a7e850796ae5473e78db07307108751eec3461dddf5ef610db7dfaaf56. // -// Solidity: event VerifyRequest(requestId indexed uint256, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256, transcodingOptions string, dataStorageHash string, dataHash bytes32, transcodedDataHash bytes32) +// Solidity: event VerifyRequest(uint256 indexed requestId, uint256 indexed jobId, uint256 indexed claimId, uint256 segmentNumber, string transcodingOptions, string dataStorageHash, bytes32 dataHash, bytes32 transcodedDataHash) func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterVerifyRequest(opts *bind.FilterOpts, requestId []*big.Int, jobId []*big.Int, claimId []*big.Int) (*LivepeerVerifierVerifyRequestIterator, error) { var requestIdRule []interface{} @@ -968,7 +1076,7 @@ func (_LivepeerVerifier *LivepeerVerifierFilterer) FilterVerifyRequest(opts *bin // WatchVerifyRequest is a free log subscription operation binding the contract event 0xf68da1a7e850796ae5473e78db07307108751eec3461dddf5ef610db7dfaaf56. // -// Solidity: event VerifyRequest(requestId indexed uint256, jobId indexed uint256, claimId indexed uint256, segmentNumber uint256, transcodingOptions string, dataStorageHash string, dataHash bytes32, transcodedDataHash bytes32) +// Solidity: event VerifyRequest(uint256 indexed requestId, uint256 indexed jobId, uint256 indexed claimId, uint256 segmentNumber, string transcodingOptions, string dataStorageHash, bytes32 dataHash, bytes32 transcodedDataHash) func (_LivepeerVerifier *LivepeerVerifierFilterer) WatchVerifyRequest(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierVerifyRequest, requestId []*big.Int, jobId []*big.Int, claimId []*big.Int) (event.Subscription, error) { var requestIdRule []interface{} diff --git a/eth/contracts/minter.go b/eth/contracts/minter.go index cb982a4a6..390503dab 100644 --- a/eth/contracts/minter.go +++ b/eth/contracts/minter.go @@ -15,8 +15,20 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // MinterABI is the input ABI used to generate the binding from. -const MinterABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"currentMintedTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetBondingRate\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentMintableTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflationChange\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflation\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"},{\"name\":\"_inflation\",\"type\":\"uint256\"},{\"name\":\"_inflationChange\",\"type\":\"uint256\"},{\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"currentMintableTokens\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"currentInflation\",\"type\":\"uint256\"}],\"name\":\"SetCurrentRewardTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"name\":\"setTargetBondingRate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_inflationChange\",\"type\":\"uint256\"}],\"name\":\"setInflationChange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newMinter\",\"type\":\"address\"}],\"name\":\"migrateToNewMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_fracNum\",\"type\":\"uint256\"},{\"name\":\"_fracDenom\",\"type\":\"uint256\"}],\"name\":\"createReward\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedTransferTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedBurnTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedWithdrawETH\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositETH\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setCurrentRewardTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getController\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" +const MinterABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"currentMintedTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetBondingRate\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentMintableTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflationChange\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflation\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"},{\"name\":\"_inflation\",\"type\":\"uint256\"},{\"name\":\"_inflationChange\",\"type\":\"uint256\"},{\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"currentMintableTokens\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"currentInflation\",\"type\":\"uint256\"}],\"name\":\"SetCurrentRewardTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"name\":\"setTargetBondingRate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_inflationChange\",\"type\":\"uint256\"}],\"name\":\"setInflationChange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newMinter\",\"type\":\"address\"}],\"name\":\"migrateToNewMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_fracNum\",\"type\":\"uint256\"},{\"name\":\"_fracDenom\",\"type\":\"uint256\"}],\"name\":\"createReward\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedTransferTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedBurnTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedWithdrawETH\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"trustedDepositETH\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedBurnETH\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setCurrentRewardTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getController\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // Minter is an auto generated Go binding around an Ethereum contract. type Minter struct { @@ -344,84 +356,63 @@ func (_Minter *MinterCallerSession) TargetBondingRate() (*big.Int, error) { // CreateReward is a paid mutator transaction binding the contract method 0x7dbedad5. // -// Solidity: function createReward(_fracNum uint256, _fracDenom uint256) returns(uint256) +// Solidity: function createReward(uint256 _fracNum, uint256 _fracDenom) returns(uint256) func (_Minter *MinterTransactor) CreateReward(opts *bind.TransactOpts, _fracNum *big.Int, _fracDenom *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "createReward", _fracNum, _fracDenom) } // CreateReward is a paid mutator transaction binding the contract method 0x7dbedad5. // -// Solidity: function createReward(_fracNum uint256, _fracDenom uint256) returns(uint256) +// Solidity: function createReward(uint256 _fracNum, uint256 _fracDenom) returns(uint256) func (_Minter *MinterSession) CreateReward(_fracNum *big.Int, _fracDenom *big.Int) (*types.Transaction, error) { return _Minter.Contract.CreateReward(&_Minter.TransactOpts, _fracNum, _fracDenom) } // CreateReward is a paid mutator transaction binding the contract method 0x7dbedad5. // -// Solidity: function createReward(_fracNum uint256, _fracDenom uint256) returns(uint256) +// Solidity: function createReward(uint256 _fracNum, uint256 _fracDenom) returns(uint256) func (_Minter *MinterTransactorSession) CreateReward(_fracNum *big.Int, _fracDenom *big.Int) (*types.Transaction, error) { return _Minter.Contract.CreateReward(&_Minter.TransactOpts, _fracNum, _fracDenom) } -// DepositETH is a paid mutator transaction binding the contract method 0xf6326fb3. -// -// Solidity: function depositETH() returns(bool) -func (_Minter *MinterTransactor) DepositETH(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "depositETH") -} - -// DepositETH is a paid mutator transaction binding the contract method 0xf6326fb3. -// -// Solidity: function depositETH() returns(bool) -func (_Minter *MinterSession) DepositETH() (*types.Transaction, error) { - return _Minter.Contract.DepositETH(&_Minter.TransactOpts) -} - -// DepositETH is a paid mutator transaction binding the contract method 0xf6326fb3. -// -// Solidity: function depositETH() returns(bool) -func (_Minter *MinterTransactorSession) DepositETH() (*types.Transaction, error) { - return _Minter.Contract.DepositETH(&_Minter.TransactOpts) -} - // MigrateToNewMinter is a paid mutator transaction binding the contract method 0x18d217ad. // -// Solidity: function migrateToNewMinter(_newMinter address) returns() +// Solidity: function migrateToNewMinter(address _newMinter) returns() func (_Minter *MinterTransactor) MigrateToNewMinter(opts *bind.TransactOpts, _newMinter common.Address) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "migrateToNewMinter", _newMinter) } // MigrateToNewMinter is a paid mutator transaction binding the contract method 0x18d217ad. // -// Solidity: function migrateToNewMinter(_newMinter address) returns() +// Solidity: function migrateToNewMinter(address _newMinter) returns() func (_Minter *MinterSession) MigrateToNewMinter(_newMinter common.Address) (*types.Transaction, error) { return _Minter.Contract.MigrateToNewMinter(&_Minter.TransactOpts, _newMinter) } // MigrateToNewMinter is a paid mutator transaction binding the contract method 0x18d217ad. // -// Solidity: function migrateToNewMinter(_newMinter address) returns() +// Solidity: function migrateToNewMinter(address _newMinter) returns() func (_Minter *MinterTransactorSession) MigrateToNewMinter(_newMinter common.Address) (*types.Transaction, error) { return _Minter.Contract.MigrateToNewMinter(&_Minter.TransactOpts, _newMinter) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_Minter *MinterTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "setController", _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_Minter *MinterSession) SetController(_controller common.Address) (*types.Transaction, error) { return _Minter.Contract.SetController(&_Minter.TransactOpts, _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_Minter *MinterTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { return _Minter.Contract.SetController(&_Minter.TransactOpts, _controller) } @@ -449,105 +440,147 @@ func (_Minter *MinterTransactorSession) SetCurrentRewardTokens() (*types.Transac // SetInflationChange is a paid mutator transaction binding the contract method 0x010e3c1c. // -// Solidity: function setInflationChange(_inflationChange uint256) returns() +// Solidity: function setInflationChange(uint256 _inflationChange) returns() func (_Minter *MinterTransactor) SetInflationChange(opts *bind.TransactOpts, _inflationChange *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "setInflationChange", _inflationChange) } // SetInflationChange is a paid mutator transaction binding the contract method 0x010e3c1c. // -// Solidity: function setInflationChange(_inflationChange uint256) returns() +// Solidity: function setInflationChange(uint256 _inflationChange) returns() func (_Minter *MinterSession) SetInflationChange(_inflationChange *big.Int) (*types.Transaction, error) { return _Minter.Contract.SetInflationChange(&_Minter.TransactOpts, _inflationChange) } // SetInflationChange is a paid mutator transaction binding the contract method 0x010e3c1c. // -// Solidity: function setInflationChange(_inflationChange uint256) returns() +// Solidity: function setInflationChange(uint256 _inflationChange) returns() func (_Minter *MinterTransactorSession) SetInflationChange(_inflationChange *big.Int) (*types.Transaction, error) { return _Minter.Contract.SetInflationChange(&_Minter.TransactOpts, _inflationChange) } // SetTargetBondingRate is a paid mutator transaction binding the contract method 0x77bde142. // -// Solidity: function setTargetBondingRate(_targetBondingRate uint256) returns() +// Solidity: function setTargetBondingRate(uint256 _targetBondingRate) returns() func (_Minter *MinterTransactor) SetTargetBondingRate(opts *bind.TransactOpts, _targetBondingRate *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "setTargetBondingRate", _targetBondingRate) } // SetTargetBondingRate is a paid mutator transaction binding the contract method 0x77bde142. // -// Solidity: function setTargetBondingRate(_targetBondingRate uint256) returns() +// Solidity: function setTargetBondingRate(uint256 _targetBondingRate) returns() func (_Minter *MinterSession) SetTargetBondingRate(_targetBondingRate *big.Int) (*types.Transaction, error) { return _Minter.Contract.SetTargetBondingRate(&_Minter.TransactOpts, _targetBondingRate) } // SetTargetBondingRate is a paid mutator transaction binding the contract method 0x77bde142. // -// Solidity: function setTargetBondingRate(_targetBondingRate uint256) returns() +// Solidity: function setTargetBondingRate(uint256 _targetBondingRate) returns() func (_Minter *MinterTransactorSession) SetTargetBondingRate(_targetBondingRate *big.Int) (*types.Transaction, error) { return _Minter.Contract.SetTargetBondingRate(&_Minter.TransactOpts, _targetBondingRate) } +// TrustedBurnETH is a paid mutator transaction binding the contract method 0xf518ead2. +// +// Solidity: function trustedBurnETH(uint256 _amount) returns() +func (_Minter *MinterTransactor) TrustedBurnETH(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "trustedBurnETH", _amount) +} + +// TrustedBurnETH is a paid mutator transaction binding the contract method 0xf518ead2. +// +// Solidity: function trustedBurnETH(uint256 _amount) returns() +func (_Minter *MinterSession) TrustedBurnETH(_amount *big.Int) (*types.Transaction, error) { + return _Minter.Contract.TrustedBurnETH(&_Minter.TransactOpts, _amount) +} + +// TrustedBurnETH is a paid mutator transaction binding the contract method 0xf518ead2. +// +// Solidity: function trustedBurnETH(uint256 _amount) returns() +func (_Minter *MinterTransactorSession) TrustedBurnETH(_amount *big.Int) (*types.Transaction, error) { + return _Minter.Contract.TrustedBurnETH(&_Minter.TransactOpts, _amount) +} + // TrustedBurnTokens is a paid mutator transaction binding the contract method 0xc7ee98c2. // -// Solidity: function trustedBurnTokens(_amount uint256) returns() +// Solidity: function trustedBurnTokens(uint256 _amount) returns() func (_Minter *MinterTransactor) TrustedBurnTokens(opts *bind.TransactOpts, _amount *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "trustedBurnTokens", _amount) } // TrustedBurnTokens is a paid mutator transaction binding the contract method 0xc7ee98c2. // -// Solidity: function trustedBurnTokens(_amount uint256) returns() +// Solidity: function trustedBurnTokens(uint256 _amount) returns() func (_Minter *MinterSession) TrustedBurnTokens(_amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedBurnTokens(&_Minter.TransactOpts, _amount) } // TrustedBurnTokens is a paid mutator transaction binding the contract method 0xc7ee98c2. // -// Solidity: function trustedBurnTokens(_amount uint256) returns() +// Solidity: function trustedBurnTokens(uint256 _amount) returns() func (_Minter *MinterTransactorSession) TrustedBurnTokens(_amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedBurnTokens(&_Minter.TransactOpts, _amount) } +// TrustedDepositETH is a paid mutator transaction binding the contract method 0x9020d522. +// +// Solidity: function trustedDepositETH() returns() +func (_Minter *MinterTransactor) TrustedDepositETH(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "trustedDepositETH") +} + +// TrustedDepositETH is a paid mutator transaction binding the contract method 0x9020d522. +// +// Solidity: function trustedDepositETH() returns() +func (_Minter *MinterSession) TrustedDepositETH() (*types.Transaction, error) { + return _Minter.Contract.TrustedDepositETH(&_Minter.TransactOpts) +} + +// TrustedDepositETH is a paid mutator transaction binding the contract method 0x9020d522. +// +// Solidity: function trustedDepositETH() returns() +func (_Minter *MinterTransactorSession) TrustedDepositETH() (*types.Transaction, error) { + return _Minter.Contract.TrustedDepositETH(&_Minter.TransactOpts) +} + // TrustedTransferTokens is a paid mutator transaction binding the contract method 0xe7a49c2b. // -// Solidity: function trustedTransferTokens(_to address, _amount uint256) returns() +// Solidity: function trustedTransferTokens(address _to, uint256 _amount) returns() func (_Minter *MinterTransactor) TrustedTransferTokens(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "trustedTransferTokens", _to, _amount) } // TrustedTransferTokens is a paid mutator transaction binding the contract method 0xe7a49c2b. // -// Solidity: function trustedTransferTokens(_to address, _amount uint256) returns() +// Solidity: function trustedTransferTokens(address _to, uint256 _amount) returns() func (_Minter *MinterSession) TrustedTransferTokens(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedTransferTokens(&_Minter.TransactOpts, _to, _amount) } // TrustedTransferTokens is a paid mutator transaction binding the contract method 0xe7a49c2b. // -// Solidity: function trustedTransferTokens(_to address, _amount uint256) returns() +// Solidity: function trustedTransferTokens(address _to, uint256 _amount) returns() func (_Minter *MinterTransactorSession) TrustedTransferTokens(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedTransferTokens(&_Minter.TransactOpts, _to, _amount) } // TrustedWithdrawETH is a paid mutator transaction binding the contract method 0x20283da9. // -// Solidity: function trustedWithdrawETH(_to address, _amount uint256) returns() +// Solidity: function trustedWithdrawETH(address _to, uint256 _amount) returns() func (_Minter *MinterTransactor) TrustedWithdrawETH(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.contract.Transact(opts, "trustedWithdrawETH", _to, _amount) } // TrustedWithdrawETH is a paid mutator transaction binding the contract method 0x20283da9. // -// Solidity: function trustedWithdrawETH(_to address, _amount uint256) returns() +// Solidity: function trustedWithdrawETH(address _to, uint256 _amount) returns() func (_Minter *MinterSession) TrustedWithdrawETH(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedWithdrawETH(&_Minter.TransactOpts, _to, _amount) } // TrustedWithdrawETH is a paid mutator transaction binding the contract method 0x20283da9. // -// Solidity: function trustedWithdrawETH(_to address, _amount uint256) returns() +// Solidity: function trustedWithdrawETH(address _to, uint256 _amount) returns() func (_Minter *MinterTransactorSession) TrustedWithdrawETH(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _Minter.Contract.TrustedWithdrawETH(&_Minter.TransactOpts, _to, _amount) } @@ -627,7 +660,7 @@ type MinterParameterUpdate struct { // FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_Minter *MinterFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*MinterParameterUpdateIterator, error) { logs, sub, err := _Minter.contract.FilterLogs(opts, "ParameterUpdate") @@ -639,7 +672,7 @@ func (_Minter *MinterFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*Mi // WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_Minter *MinterFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *MinterParameterUpdate) (event.Subscription, error) { logs, sub, err := _Minter.contract.WatchLogs(opts, "ParameterUpdate") @@ -749,7 +782,7 @@ type MinterSetController struct { // FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_Minter *MinterFilterer) FilterSetController(opts *bind.FilterOpts) (*MinterSetControllerIterator, error) { logs, sub, err := _Minter.contract.FilterLogs(opts, "SetController") @@ -761,7 +794,7 @@ func (_Minter *MinterFilterer) FilterSetController(opts *bind.FilterOpts) (*Mint // WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_Minter *MinterFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *MinterSetController) (event.Subscription, error) { logs, sub, err := _Minter.contract.WatchLogs(opts, "SetController") @@ -872,7 +905,7 @@ type MinterSetCurrentRewardTokens struct { // FilterSetCurrentRewardTokens is a free log retrieval operation binding the contract event 0x39567a366345edf17f50c1967a31b597745186c4632f34c4f8ebe06b6890784d. // -// Solidity: event SetCurrentRewardTokens(currentMintableTokens uint256, currentInflation uint256) +// Solidity: event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation) func (_Minter *MinterFilterer) FilterSetCurrentRewardTokens(opts *bind.FilterOpts) (*MinterSetCurrentRewardTokensIterator, error) { logs, sub, err := _Minter.contract.FilterLogs(opts, "SetCurrentRewardTokens") @@ -884,7 +917,7 @@ func (_Minter *MinterFilterer) FilterSetCurrentRewardTokens(opts *bind.FilterOpt // WatchSetCurrentRewardTokens is a free log subscription operation binding the contract event 0x39567a366345edf17f50c1967a31b597745186c4632f34c4f8ebe06b6890784d. // -// Solidity: event SetCurrentRewardTokens(currentMintableTokens uint256, currentInflation uint256) +// Solidity: event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation) func (_Minter *MinterFilterer) WatchSetCurrentRewardTokens(opts *bind.WatchOpts, sink chan<- *MinterSetCurrentRewardTokens) (event.Subscription, error) { logs, sub, err := _Minter.contract.WatchLogs(opts, "SetCurrentRewardTokens") diff --git a/eth/contracts/roundsManager.go b/eth/contracts/roundsManager.go index aea389617..073825720 100644 --- a/eth/contracts/roundsManager.go +++ b/eth/contracts/roundsManager.go @@ -15,6 +15,18 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // RoundsManagerABI is the input ABI used to generate the binding from. const RoundsManagerABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"lastRoundLengthUpdateRound\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lastRoundLengthUpdateStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lastInitializedRound\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"roundLength\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"roundLockAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"round\",\"type\":\"uint256\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roundLength\",\"type\":\"uint256\"}],\"name\":\"setRoundLength\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_roundLockAmount\",\"type\":\"uint256\"}],\"name\":\"setRoundLockAmount\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"initializeRound\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"blockNum\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRound\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundStartBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundInitialized\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundLocked\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" @@ -162,7 +174,7 @@ func (_RoundsManager *RoundsManagerTransactorRaw) Transact(opts *bind.TransactOp // BlockHash is a free data retrieval call binding the contract method 0x85df51fd. // -// Solidity: function blockHash(_block uint256) constant returns(bytes32) +// Solidity: function blockHash(uint256 _block) constant returns(bytes32) func (_RoundsManager *RoundsManagerCaller) BlockHash(opts *bind.CallOpts, _block *big.Int) ([32]byte, error) { var ( ret0 = new([32]byte) @@ -174,14 +186,14 @@ func (_RoundsManager *RoundsManagerCaller) BlockHash(opts *bind.CallOpts, _block // BlockHash is a free data retrieval call binding the contract method 0x85df51fd. // -// Solidity: function blockHash(_block uint256) constant returns(bytes32) +// Solidity: function blockHash(uint256 _block) constant returns(bytes32) func (_RoundsManager *RoundsManagerSession) BlockHash(_block *big.Int) ([32]byte, error) { return _RoundsManager.Contract.BlockHash(&_RoundsManager.CallOpts, _block) } // BlockHash is a free data retrieval call binding the contract method 0x85df51fd. // -// Solidity: function blockHash(_block uint256) constant returns(bytes32) +// Solidity: function blockHash(uint256 _block) constant returns(bytes32) func (_RoundsManager *RoundsManagerCallerSession) BlockHash(_block *big.Int) ([32]byte, error) { return _RoundsManager.Contract.BlockHash(&_RoundsManager.CallOpts, _block) } @@ -521,63 +533,63 @@ func (_RoundsManager *RoundsManagerTransactorSession) InitializeRound() (*types. // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_RoundsManager *RoundsManagerTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { return _RoundsManager.contract.Transact(opts, "setController", _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_RoundsManager *RoundsManagerSession) SetController(_controller common.Address) (*types.Transaction, error) { return _RoundsManager.Contract.SetController(&_RoundsManager.TransactOpts, _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_RoundsManager *RoundsManagerTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { return _RoundsManager.Contract.SetController(&_RoundsManager.TransactOpts, _controller) } // SetRoundLength is a paid mutator transaction binding the contract method 0x681312f5. // -// Solidity: function setRoundLength(_roundLength uint256) returns() +// Solidity: function setRoundLength(uint256 _roundLength) returns() func (_RoundsManager *RoundsManagerTransactor) SetRoundLength(opts *bind.TransactOpts, _roundLength *big.Int) (*types.Transaction, error) { return _RoundsManager.contract.Transact(opts, "setRoundLength", _roundLength) } // SetRoundLength is a paid mutator transaction binding the contract method 0x681312f5. // -// Solidity: function setRoundLength(_roundLength uint256) returns() +// Solidity: function setRoundLength(uint256 _roundLength) returns() func (_RoundsManager *RoundsManagerSession) SetRoundLength(_roundLength *big.Int) (*types.Transaction, error) { return _RoundsManager.Contract.SetRoundLength(&_RoundsManager.TransactOpts, _roundLength) } // SetRoundLength is a paid mutator transaction binding the contract method 0x681312f5. // -// Solidity: function setRoundLength(_roundLength uint256) returns() +// Solidity: function setRoundLength(uint256 _roundLength) returns() func (_RoundsManager *RoundsManagerTransactorSession) SetRoundLength(_roundLength *big.Int) (*types.Transaction, error) { return _RoundsManager.Contract.SetRoundLength(&_RoundsManager.TransactOpts, _roundLength) } // SetRoundLockAmount is a paid mutator transaction binding the contract method 0x0b1573b8. // -// Solidity: function setRoundLockAmount(_roundLockAmount uint256) returns() +// Solidity: function setRoundLockAmount(uint256 _roundLockAmount) returns() func (_RoundsManager *RoundsManagerTransactor) SetRoundLockAmount(opts *bind.TransactOpts, _roundLockAmount *big.Int) (*types.Transaction, error) { return _RoundsManager.contract.Transact(opts, "setRoundLockAmount", _roundLockAmount) } // SetRoundLockAmount is a paid mutator transaction binding the contract method 0x0b1573b8. // -// Solidity: function setRoundLockAmount(_roundLockAmount uint256) returns() +// Solidity: function setRoundLockAmount(uint256 _roundLockAmount) returns() func (_RoundsManager *RoundsManagerSession) SetRoundLockAmount(_roundLockAmount *big.Int) (*types.Transaction, error) { return _RoundsManager.Contract.SetRoundLockAmount(&_RoundsManager.TransactOpts, _roundLockAmount) } // SetRoundLockAmount is a paid mutator transaction binding the contract method 0x0b1573b8. // -// Solidity: function setRoundLockAmount(_roundLockAmount uint256) returns() +// Solidity: function setRoundLockAmount(uint256 _roundLockAmount) returns() func (_RoundsManager *RoundsManagerTransactorSession) SetRoundLockAmount(_roundLockAmount *big.Int) (*types.Transaction, error) { return _RoundsManager.Contract.SetRoundLockAmount(&_RoundsManager.TransactOpts, _roundLockAmount) } @@ -657,7 +669,7 @@ type RoundsManagerNewRound struct { // FilterNewRound is a free log retrieval operation binding the contract event 0xa2b5357eea32aeb35142ba36b087f9fe674f34f8b57ce94d30e9f4f572195bcf. // -// Solidity: event NewRound(round uint256) +// Solidity: event NewRound(uint256 round) func (_RoundsManager *RoundsManagerFilterer) FilterNewRound(opts *bind.FilterOpts) (*RoundsManagerNewRoundIterator, error) { logs, sub, err := _RoundsManager.contract.FilterLogs(opts, "NewRound") @@ -669,7 +681,7 @@ func (_RoundsManager *RoundsManagerFilterer) FilterNewRound(opts *bind.FilterOpt // WatchNewRound is a free log subscription operation binding the contract event 0xa2b5357eea32aeb35142ba36b087f9fe674f34f8b57ce94d30e9f4f572195bcf. // -// Solidity: event NewRound(round uint256) +// Solidity: event NewRound(uint256 round) func (_RoundsManager *RoundsManagerFilterer) WatchNewRound(opts *bind.WatchOpts, sink chan<- *RoundsManagerNewRound) (event.Subscription, error) { logs, sub, err := _RoundsManager.contract.WatchLogs(opts, "NewRound") @@ -779,7 +791,7 @@ type RoundsManagerParameterUpdate struct { // FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_RoundsManager *RoundsManagerFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*RoundsManagerParameterUpdateIterator, error) { logs, sub, err := _RoundsManager.contract.FilterLogs(opts, "ParameterUpdate") @@ -791,7 +803,7 @@ func (_RoundsManager *RoundsManagerFilterer) FilterParameterUpdate(opts *bind.Fi // WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_RoundsManager *RoundsManagerFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *RoundsManagerParameterUpdate) (event.Subscription, error) { logs, sub, err := _RoundsManager.contract.WatchLogs(opts, "ParameterUpdate") @@ -901,7 +913,7 @@ type RoundsManagerSetController struct { // FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_RoundsManager *RoundsManagerFilterer) FilterSetController(opts *bind.FilterOpts) (*RoundsManagerSetControllerIterator, error) { logs, sub, err := _RoundsManager.contract.FilterLogs(opts, "SetController") @@ -913,7 +925,7 @@ func (_RoundsManager *RoundsManagerFilterer) FilterSetController(opts *bind.Filt // WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_RoundsManager *RoundsManagerFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *RoundsManagerSetController) (event.Subscription, error) { logs, sub, err := _RoundsManager.contract.WatchLogs(opts, "SetController") diff --git a/eth/contracts/serviceRegistry.go b/eth/contracts/serviceRegistry.go index 7e482acaa..30004c0d7 100644 --- a/eth/contracts/serviceRegistry.go +++ b/eth/contracts/serviceRegistry.go @@ -4,6 +4,7 @@ package contracts import ( + "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" @@ -14,8 +15,20 @@ import ( "github.com/ethereum/go-ethereum/event" ) +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + // ServiceRegistryABI is the input ABI used to generate the binding from. -const ServiceRegistryABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getServiceURI\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_serviceURI\",\"type\":\"string\"}],\"name\":\"setServiceURI\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"serviceURI\",\"type\":\"string\"}],\"name\":\"ServiceURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"}]" +const ServiceRegistryABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"serviceURI\",\"type\":\"string\"}],\"name\":\"ServiceURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"name\":\"_serviceURI\",\"type\":\"string\"}],\"name\":\"setServiceURI\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getServiceURI\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // ServiceRegistry is an auto generated Go binding around an Ethereum contract. type ServiceRegistry struct { @@ -187,7 +200,7 @@ func (_ServiceRegistry *ServiceRegistryCallerSession) Controller() (common.Addre // GetServiceURI is a free data retrieval call binding the contract method 0x214c2a4b. // -// Solidity: function getServiceURI(_addr address) constant returns(string) +// Solidity: function getServiceURI(address _addr) constant returns(string) func (_ServiceRegistry *ServiceRegistryCaller) GetServiceURI(opts *bind.CallOpts, _addr common.Address) (string, error) { var ( ret0 = new(string) @@ -199,14 +212,14 @@ func (_ServiceRegistry *ServiceRegistryCaller) GetServiceURI(opts *bind.CallOpts // GetServiceURI is a free data retrieval call binding the contract method 0x214c2a4b. // -// Solidity: function getServiceURI(_addr address) constant returns(string) +// Solidity: function getServiceURI(address _addr) constant returns(string) func (_ServiceRegistry *ServiceRegistrySession) GetServiceURI(_addr common.Address) (string, error) { return _ServiceRegistry.Contract.GetServiceURI(&_ServiceRegistry.CallOpts, _addr) } // GetServiceURI is a free data retrieval call binding the contract method 0x214c2a4b. // -// Solidity: function getServiceURI(_addr address) constant returns(string) +// Solidity: function getServiceURI(address _addr) constant returns(string) func (_ServiceRegistry *ServiceRegistryCallerSession) GetServiceURI(_addr common.Address) (string, error) { return _ServiceRegistry.Contract.GetServiceURI(&_ServiceRegistry.CallOpts, _addr) } @@ -239,42 +252,42 @@ func (_ServiceRegistry *ServiceRegistryCallerSession) TargetContractId() ([32]by // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_ServiceRegistry *ServiceRegistryTransactor) SetController(opts *bind.TransactOpts, _controller common.Address) (*types.Transaction, error) { return _ServiceRegistry.contract.Transact(opts, "setController", _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_ServiceRegistry *ServiceRegistrySession) SetController(_controller common.Address) (*types.Transaction, error) { return _ServiceRegistry.Contract.SetController(&_ServiceRegistry.TransactOpts, _controller) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. // -// Solidity: function setController(_controller address) returns() +// Solidity: function setController(address _controller) returns() func (_ServiceRegistry *ServiceRegistryTransactorSession) SetController(_controller common.Address) (*types.Transaction, error) { return _ServiceRegistry.Contract.SetController(&_ServiceRegistry.TransactOpts, _controller) } // SetServiceURI is a paid mutator transaction binding the contract method 0x5f11301b. // -// Solidity: function setServiceURI(_serviceURI string) returns() +// Solidity: function setServiceURI(string _serviceURI) returns() func (_ServiceRegistry *ServiceRegistryTransactor) SetServiceURI(opts *bind.TransactOpts, _serviceURI string) (*types.Transaction, error) { return _ServiceRegistry.contract.Transact(opts, "setServiceURI", _serviceURI) } // SetServiceURI is a paid mutator transaction binding the contract method 0x5f11301b. // -// Solidity: function setServiceURI(_serviceURI string) returns() +// Solidity: function setServiceURI(string _serviceURI) returns() func (_ServiceRegistry *ServiceRegistrySession) SetServiceURI(_serviceURI string) (*types.Transaction, error) { return _ServiceRegistry.Contract.SetServiceURI(&_ServiceRegistry.TransactOpts, _serviceURI) } // SetServiceURI is a paid mutator transaction binding the contract method 0x5f11301b. // -// Solidity: function setServiceURI(_serviceURI string) returns() +// Solidity: function setServiceURI(string _serviceURI) returns() func (_ServiceRegistry *ServiceRegistryTransactorSession) SetServiceURI(_serviceURI string) (*types.Transaction, error) { return _ServiceRegistry.Contract.SetServiceURI(&_ServiceRegistry.TransactOpts, _serviceURI) } @@ -354,7 +367,7 @@ type ServiceRegistryParameterUpdate struct { // FilterParameterUpdate is a free log retrieval operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_ServiceRegistry *ServiceRegistryFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*ServiceRegistryParameterUpdateIterator, error) { logs, sub, err := _ServiceRegistry.contract.FilterLogs(opts, "ParameterUpdate") @@ -366,7 +379,7 @@ func (_ServiceRegistry *ServiceRegistryFilterer) FilterParameterUpdate(opts *bin // WatchParameterUpdate is a free log subscription operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. // -// Solidity: event ParameterUpdate(param string) +// Solidity: event ParameterUpdate(string param) func (_ServiceRegistry *ServiceRegistryFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *ServiceRegistryParameterUpdate) (event.Subscription, error) { logs, sub, err := _ServiceRegistry.contract.WatchLogs(opts, "ParameterUpdate") @@ -477,7 +490,7 @@ type ServiceRegistryServiceURIUpdate struct { // FilterServiceURIUpdate is a free log retrieval operation binding the contract event 0xfbb63068732c85741c9f8e61caffaabe038d577bfafd2d2dcc0e352a4f653a4c. // -// Solidity: event ServiceURIUpdate(addr indexed address, serviceURI string) +// Solidity: event ServiceURIUpdate(address indexed addr, string serviceURI) func (_ServiceRegistry *ServiceRegistryFilterer) FilterServiceURIUpdate(opts *bind.FilterOpts, addr []common.Address) (*ServiceRegistryServiceURIUpdateIterator, error) { var addrRule []interface{} @@ -494,7 +507,7 @@ func (_ServiceRegistry *ServiceRegistryFilterer) FilterServiceURIUpdate(opts *bi // WatchServiceURIUpdate is a free log subscription operation binding the contract event 0xfbb63068732c85741c9f8e61caffaabe038d577bfafd2d2dcc0e352a4f653a4c. // -// Solidity: event ServiceURIUpdate(addr indexed address, serviceURI string) +// Solidity: event ServiceURIUpdate(address indexed addr, string serviceURI) func (_ServiceRegistry *ServiceRegistryFilterer) WatchServiceURIUpdate(opts *bind.WatchOpts, sink chan<- *ServiceRegistryServiceURIUpdate, addr []common.Address) (event.Subscription, error) { var addrRule []interface{} @@ -609,7 +622,7 @@ type ServiceRegistrySetController struct { // FilterSetController is a free log retrieval operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_ServiceRegistry *ServiceRegistryFilterer) FilterSetController(opts *bind.FilterOpts) (*ServiceRegistrySetControllerIterator, error) { logs, sub, err := _ServiceRegistry.contract.FilterLogs(opts, "SetController") @@ -621,7 +634,7 @@ func (_ServiceRegistry *ServiceRegistryFilterer) FilterSetController(opts *bind. // WatchSetController is a free log subscription operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. // -// Solidity: event SetController(controller address) +// Solidity: event SetController(address controller) func (_ServiceRegistry *ServiceRegistryFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *ServiceRegistrySetController) (event.Subscription, error) { logs, sub, err := _ServiceRegistry.contract.WatchLogs(opts, "SetController") diff --git a/eth/eventmonitor.go b/eth/eventmonitor.go index cf31f28f7..5bb6ca287 100644 --- a/eth/eventmonitor.go +++ b/eth/eventmonitor.go @@ -23,7 +23,6 @@ type logCallback func(types.Log) (bool, error) type headerCallback func(*types.Header) (bool, error) type EventMonitor interface { - SubscribeNewJob(context.Context, string, chan types.Log, ethcommon.Address, logCallback) (ethereum.Subscription, error) SubscribeNewRound(context.Context, string, chan types.Log, logCallback) (ethereum.Subscription, error) SubscribeNewBlock(context.Context, string, chan *types.Header, headerCallback) (ethereum.Subscription, error) EventSubscriptions() map[string]bool @@ -115,66 +114,6 @@ func (em *eventMonitor) SubscribeNewRound(ctx context.Context, subName string, l return em.eventSubMap[subName].sub, nil } -func (em *eventMonitor) SubscribeNewJob(ctx context.Context, subName string, logsCh chan types.Log, broadcasterAddr ethcommon.Address, cb logCallback) (ethereum.Subscription, error) { - if _, ok := em.eventSubMap[subName]; ok { - return nil, fmt.Errorf("Event subscription already registered as active with name: %v", subName) - } - - abiJSON, err := abi.JSON(strings.NewReader(contracts.JobsManagerABI)) - if err != nil { - return nil, err - } - - eventId := abiJSON.Events["NewJob"].Id() - jobsManagerAddr := em.contractAddrMap["JobsManager"] - - var q ethereum.FilterQuery - if !IsNullAddress(broadcasterAddr) { - q = ethereum.FilterQuery{ - Addresses: []ethcommon.Address{jobsManagerAddr}, - Topics: [][]ethcommon.Hash{[]ethcommon.Hash{eventId}, []ethcommon.Hash{}, []ethcommon.Hash{ethcommon.BytesToHash(ethcommon.LeftPadBytes(broadcasterAddr[:], 32))}}, - } - } else { - q = ethereum.FilterQuery{ - Addresses: []ethcommon.Address{jobsManagerAddr}, - Topics: [][]ethcommon.Hash{[]ethcommon.Hash{eventId}}, - } - } - - subscribe := func() error { - sub, err := em.backend.SubscribeFilterLogs(ctx, q, logsCh) - if err != nil { - glog.V(common.DEBUG).Infof("SubscribeNewJob error: %v. retrying...", err) - return err - } else { - glog.V(common.DEBUG).Infof("SubscribedNewJob successful.") - } - - em.eventSubMap[subName] = &EventSubscription{ - sub: sub, - logsCh: logsCh, - active: true, - } - return nil - } - - if err = backoff.Retry(subscribe, backoff.NewConstantBackOff(time.Second*2)); err != nil { - glog.Errorf("SubscribeNewJob failed: %v", err) - return nil, err - } - - go em.watchLogs(subName, cb, func() { - glog.V(common.DEBUG).Infof("Trying to resubscribe for %v", subName) - if err := backoff.Retry(subscribe, backoff.NewConstantBackOff(time.Second*2)); err != nil { - glog.V(common.DEBUG).Infof("Resubscribe failed: %v", err) - em.eventSubMap[subName] = nil - return - } - }) - - return em.eventSubMap[subName].sub, nil -} - func (em *eventMonitor) SubscribeNewBlock(ctx context.Context, subName string, headersCh chan *types.Header, cb headerCallback) (ethereum.Subscription, error) { if _, ok := em.eventSubMap[subName]; ok { return nil, fmt.Errorf("Event subscription already registered as active with name: %v", subName) diff --git a/eth/eventservices/jobservice.go b/eth/eventservices/jobservice.go deleted file mode 100644 index d15edf961..000000000 --- a/eth/eventservices/jobservice.go +++ /dev/null @@ -1,233 +0,0 @@ -package eventservices - -import ( - "context" - "errors" - "fmt" - "math/big" - "time" - - "github.com/cenkalti/backoff" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/golang/glog" - "github.com/livepeer/go-livepeer/core" - "github.com/livepeer/go-livepeer/eth" - "github.com/livepeer/go-livepeer/eth/contracts" - lpTypes "github.com/livepeer/go-livepeer/eth/types" -) - -var ( - ErrJobServiceStarted = fmt.Errorf("job service already started") - ErrJobServicedStopped = fmt.Errorf("job service already stopped") - - CheckFirstClaimPollingInterval = time.Second * 15 -) - -type JobService struct { - node *core.LivepeerNode - working bool - cancelWorker context.CancelFunc - resubscribe bool -} - -func NewJobService(node *core.LivepeerNode) *JobService { - return &JobService{ - node: node, - resubscribe: true, - } -} - -func (s *JobService) RestartTranscoder() error { - return eth.RecoverClaims(s.node.Eth, s.node.Ipfs, s.node.Database) -} - -func (s *JobService) Start(ctx context.Context) error { - if s.working { - return ErrJobServiceStarted - } - - ctx, cancel := context.WithCancel(ctx) - s.cancelWorker = cancel - - startBlock, err := s.node.Database.LastSeenBlock() - if err == nil { - go s.processHistoricalEvents(ctx, startBlock) - } - s.working = true - - go func() { - var ( - newJobSink = make(chan *contracts.JobsManagerNewJob) - newJobSub ethereum.Subscription - err error - ) - - for { - if s.resubscribe { - newJobSub, err = s.node.Eth.WatchForNewJob(true, newJobSink) - if err != nil { - glog.Error(err) - } else { - s.resubscribe = false - } - } - - select { - case newJob := <-newJobSink: - if err = s.processNewJob(ctx, newJob); err != nil { - glog.Error(err) - } - case newJobErr := <-newJobSub.Err(): - newJobSub.Unsubscribe() - s.resubscribe = true - - glog.Error("Error with NewJob subscription ", newJobErr) - case <-ctx.Done(): - newJobSub.Unsubscribe() - - glog.Error("Received cancellation from job service; stopping") - - return - } - } - }() - - return nil -} - -func (s *JobService) Stop() error { - if !s.working { - return ErrJobServicedStopped - } - - s.cancelWorker() - s.working = false - - return nil -} - -func (s *JobService) IsWorking() bool { - return s.working -} - -func (s *JobService) firstClaim(ctx context.Context, job *lpTypes.Job) error { - // We might want to check for the latest block - // (from the blockchain, not the local DB) - // and skip creating the claimmanager if the job is too old - cm, err := s.node.GetClaimManager(job) - if err != nil { - return err - } - - tickCh := time.NewTicker(CheckFirstClaimPollingInterval).C - - go func() { - for { - select { - case <-tickCh: - lastSeenBlock, err := s.node.Database.LastSeenBlock() - if err != nil { - glog.Error("Error getting last seen block ", err) - continue - } - - firstClaimBlock := new(big.Int).Add(job.CreationBlock, eth.BlocksUntilFirstClaimDeadline) - - // Check if we should submit the first claim - if lastSeenBlock.Cmp(firstClaimBlock) >= 0 { - canClaim, err := cm.CanClaim(lastSeenBlock, job) - if err != nil { - glog.Errorf("Error checking if the transcoder can claim %v", err) - continue - } - - if canClaim { - err := cm.ClaimVerifyAndDistributeFees() - if err != nil { - glog.Errorf("Error executing first claim process %v", err) - continue - } - - glog.Infof("Executed first claim process for job %v", job.JobId) - } - - return - } - case <-ctx.Done(): - return - } - } - }() - - return nil -} - -func (s *JobService) processNewJob(ctx context.Context, newJob *contracts.JobsManagerNewJob) error { - var job *lpTypes.Job - - getJob := func() error { - j, err := s.node.Eth.GetJob(newJob.JobId) - if err != nil || j == nil { - return err - } - if j == nil { - glog.Errorf("Unable to get job %v. Should try again.", newJob.JobId) - return errors.New("ErrGetJob") - } - if j.StreamId == "" { - glog.Errorf("Got job %v with empty stream ID. Should try again.", newJob.JobId) - return errors.New("ErrGetJob") - } - - job = j - - if (job.TranscoderAddress == common.Address{}) { - transcoderAddress, err := s.node.Eth.AssignedTranscoder(job) - if err != nil { - return err - } - - job.TranscoderAddress = transcoderAddress - } - - return nil - } - - if err := backoff.Retry(getJob, backoff.NewConstantBackOff(time.Second*2)); err != nil { - glog.Errorf("Error getting job info: %v", err) - return err - } - - if job.TranscoderAddress == s.node.Eth.Account().Address { - dbjob := eth.EthJobToDBJob(job) - if err := s.node.Database.InsertJob(dbjob); err != nil { - return err - } - - if err := s.firstClaim(ctx, job); err != nil { - return err - } - } - - return nil -} - -func (s *JobService) processHistoricalEvents(ctx context.Context, startBlock *big.Int) error { - //Exit early if LastSeenBlock is zero (starting with a new db) - if startBlock.Cmp(big.NewInt(0)) == 0 { - return nil - } - - if err := s.node.Eth.ProcessHistoricalNewJob(startBlock, true, func(newJob *contracts.JobsManagerNewJob) error { - if err := s.processNewJob(ctx, newJob); err != nil { - return err - } - - return nil - }); err != nil { - return err - } - - return nil -} diff --git a/eth/eventservices/jobservice_test.go b/eth/eventservices/jobservice_test.go deleted file mode 100644 index 2d28475e4..000000000 --- a/eth/eventservices/jobservice_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package eventservices - -import ( - "context" - "fmt" - "math/big" - "testing" - - "github.com/livepeer/go-livepeer/core" - "github.com/livepeer/go-livepeer/eth" -) - -func TestProcessHistoricalJobs(t *testing.T) { - seth := ð.StubClient{} - seth.WatchJobError = fmt.Errorf("Historical job error") - n, err := core.NewLivepeerNode(seth, ".", nil) - if err != nil { - t.Error(err) - } - js := NewJobService(n) - - //Test that we exit early because startBlock is 0 in this case - err = js.processHistoricalEvents(context.Background(), big.NewInt(0)) - if err != nil { - t.Error("Unexpected error ", err) - } - - //Set last seen block to be 10, this should result in an error because we don't exit early anymore and we set a stubbed error - err = js.processHistoricalEvents(context.Background(), big.NewInt(10)) - if err != seth.WatchJobError { - t.Error("Expected WatchJobError, got ", err) - } -} diff --git a/eth/helpers.go b/eth/helpers.go index 26db7da1f..7da851d01 100644 --- a/eth/helpers.go +++ b/eth/helpers.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/golang/glog" "github.com/livepeer/go-livepeer/common" - lpTypes "github.com/livepeer/go-livepeer/eth/types" ) var ( @@ -123,14 +122,3 @@ func Wait(db *common.DB, blocks *big.Int) error { func IsNullAddress(addr ethcommon.Address) bool { return addr == ethcommon.Address{} } - -func EthJobToDBJob(job *lpTypes.Job) *common.DBJob { - if job == nil { - return nil - } - return common.NewDBJob( - job.JobId, job.StreamId, - job.MaxPricePerSegment, job.Profiles, - job.BroadcasterAddress, job.TranscoderAddress, - job.CreationBlock, job.EndBlock) -} diff --git a/eth/stubclient.go b/eth/stubclient.go index 435e673f4..31eaeb486 100644 --- a/eth/stubclient.go +++ b/eth/stubclient.go @@ -13,32 +13,11 @@ import ( ) type StubClient struct { - StrmID string - TOpts string - MaxPrice *big.Int - Jid *big.Int - SegSeqNum *big.Int - VeriRate uint64 - DStorageHash string - DHash [32]byte - TDHash [32]byte - BSig []byte - Proof []byte - VerifyCounter int - ClaimJid []*big.Int - ClaimStart []*big.Int - ClaimEnd []*big.Int - ClaimRoot map[[32]byte]bool - ClaimCounter int SubLogsCh chan types.Log - JobsMap map[string]*lpTypes.Job TranscoderAddress common.Address BlockNum *big.Int BlockHashToReturn common.Hash - Claims map[int]*lpTypes.Claim LatestBlockError error - JobError error - WatchJobError error ProcessHistoricalUnbondError error Orchestrators []*lpTypes.Transcoder } @@ -107,75 +86,17 @@ func (e *StubClient) RegisteredTranscoders() ([]*lpTypes.Transcoder, error) { return e.Orchestrators, nil } func (e *StubClient) IsActiveTranscoder() (bool, error) { return false, nil } -func (e *StubClient) AssignedTranscoder(job *lpTypes.Job) (common.Address, error) { - return e.TranscoderAddress, nil -} func (e *StubClient) GetTotalBonded() (*big.Int, error) { return big.NewInt(0), nil } -// Jobs - -func (e *StubClient) Job(streamId string, transcodingOptions string, maxPricePerSegment *big.Int, endBlock *big.Int) (*types.Transaction, error) { - return nil, e.JobError -} -func (e *StubClient) ClaimWork(jobId *big.Int, segmentRange [2]*big.Int, claimRoot [32]byte) (*types.Transaction, error) { - e.ClaimCounter++ - e.ClaimJid = append(e.ClaimJid, jobId) - e.ClaimStart = append(e.ClaimStart, segmentRange[0]) - e.ClaimEnd = append(e.ClaimEnd, segmentRange[1]) - e.ClaimRoot[claimRoot] = true - e.Claims[e.ClaimCounter-1] = &lpTypes.Claim{ - SegmentRange: segmentRange, - ClaimRoot: claimRoot, - } - return nil, nil -} -func (e *StubClient) Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, dataStorageHash string, dataHashes [2][32]byte, broadcasterSig []byte, proof []byte) (*types.Transaction, error) { - e.Jid = jobId - e.SegSeqNum = segmentNumber - e.DStorageHash = dataStorageHash - e.DHash = dataHashes[0] - e.TDHash = dataHashes[1] - e.BSig = broadcasterSig - e.Proof = proof - e.VerifyCounter++ - - return nil, nil -} -func (e *StubClient) DistributeFees(jobId *big.Int, claimId *big.Int) (*types.Transaction, error) { - return nil, nil -} -func (c *StubClient) Deposit(amount *big.Int) (*types.Transaction, error) { - return nil, nil -} -func (c *StubClient) Withdraw() (*types.Transaction, error) { return nil, nil } -func (c *StubClient) BroadcasterDeposit(broadcaster common.Address) (*big.Int, error) { - return big.NewInt(10), nil -} -func (e *StubClient) GetJob(jobID *big.Int) (*lpTypes.Job, error) { - return e.JobsMap[jobID.String()], nil -} -func (c *StubClient) GetClaim(jobID *big.Int, claimID *big.Int) (*lpTypes.Claim, error) { - return c.Claims[int(claimID.Int64())], nil -} -func (c *StubClient) NumJobs() (*big.Int, error) { return big.NewInt(0), nil } - // Parameters -func (c *StubClient) NumActiveTranscoders() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) RoundLength() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) RoundLockAmount() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) UnbondingPeriod() (uint64, error) { return 0, nil } -func (c *StubClient) VerificationRate() (uint64, error) { return 0, nil } -func (c *StubClient) VerificationPeriod() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) VerificationSlashingPeriod() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) FailedVerificationSlashAmount() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) MissedVerificationSlashAmount() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) DoubleClaimSegmentSlashAmount() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) FinderFee() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) Inflation() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) InflationChange() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) TargetBondingRate() (*big.Int, error) { return big.NewInt(0), nil } -func (c *StubClient) VerificationCodeHash() (string, error) { return "", nil } +func (c *StubClient) NumActiveTranscoders() (*big.Int, error) { return big.NewInt(0), nil } +func (c *StubClient) RoundLength() (*big.Int, error) { return big.NewInt(0), nil } +func (c *StubClient) RoundLockAmount() (*big.Int, error) { return big.NewInt(0), nil } +func (c *StubClient) UnbondingPeriod() (uint64, error) { return 0, nil } +func (c *StubClient) Inflation() (*big.Int, error) { return big.NewInt(0), nil } +func (c *StubClient) InflationChange() (*big.Int, error) { return big.NewInt(0), nil } +func (c *StubClient) TargetBondingRate() (*big.Int, error) { return big.NewInt(0), nil } // Helpers @@ -188,15 +109,6 @@ func (c *StubClient) Sign(msg []byte) ([]byte, error) { return nil, nil } func (c *StubClient) LatestBlockNum() (*big.Int, error) { return big.NewInt(0), c.LatestBlockError } func (c *StubClient) GetGasInfo() (uint64, *big.Int) { return 0, nil } func (c *StubClient) SetGasInfo(uint64, *big.Int) error { return nil } -func (c *StubClient) WatchForJob(j string) (*lpTypes.Job, error) { - return c.JobsMap[j], c.WatchJobError -} -func (c *StubClient) ProcessHistoricalNewJob(*big.Int, bool, func(*contracts.JobsManagerNewJob) error) error { - return c.WatchJobError -} -func (c *StubClient) WatchForNewJob(bool, chan *contracts.JobsManagerNewJob) (ethereum.Subscription, error) { - return nil, nil -} func (c *StubClient) ProcessHistoricalUnbond(*big.Int, func(*contracts.BondingManagerUnbond) error) error { return c.ProcessHistoricalUnbondError } diff --git a/eth/types/contracts.go b/eth/types/contracts.go index f1f7af9dd..36c4c7089 100644 --- a/eth/types/contracts.go +++ b/eth/types/contracts.go @@ -5,14 +5,11 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - ffmpeg "github.com/livepeer/lpms/ffmpeg" ) var ( ErrUnknownTranscoderStatus = fmt.Errorf("unknown transcoder status") ErrUnknownDelegatorStatus = fmt.Errorf("unknown delegator status") - ErrUnknownJobStatus = fmt.Errorf("unknown job status") - ErrUnknownClaimStatus = fmt.Errorf("unknown claim status") ) type Transcoder struct { @@ -82,56 +79,6 @@ type TokenPools struct { ClaimableStake *big.Int } -type Job struct { - JobId *big.Int - StreamId string - Profiles []ffmpeg.VideoProfile - MaxPricePerSegment *big.Int - BroadcasterAddress common.Address - TranscoderAddress common.Address - CreationRound *big.Int - CreationBlock *big.Int - EndBlock *big.Int - Escrow *big.Int - TotalClaims *big.Int - Status string - FirstClaimSubmitted bool -} - -func ParseJobStatus(s uint8) (string, error) { - switch s { - case 0: - return "Inactive", nil - case 1: - return "Active", nil - default: - return "", ErrUnknownJobStatus - } -} - -type Claim struct { - ClaimId *big.Int - SegmentRange [2]*big.Int - ClaimRoot [32]byte - ClaimBlock *big.Int - EndVerificationBlock *big.Int - EndVerificationSlashingBlock *big.Int - Status string -} - -func ParseClaimStatus(s uint8) (string, error) { - switch s { - case 0: - return "Pending", nil - case 1: - return "Slashed", nil - case 2: - return "Complete", nil - default: - return "", ErrUnknownClaimStatus - } -} - type ProtocolParameters struct { NumActiveTranscoders *big.Int RoundLength *big.Int diff --git a/monitor/events.go b/monitor/events.go index bfda93638..e01b79f58 100644 --- a/monitor/events.go +++ b/monitor/events.go @@ -8,7 +8,6 @@ import ( "time" "github.com/golang/glog" - ethTypes "github.com/livepeer/go-livepeer/eth/types" ) var Enabled bool @@ -86,38 +85,6 @@ func LogSegmentTranscodeEnded(seqNo uint64, manifestID string) { sendPost("SegmentTranscodeEnded", 0, props) } -func LogJobCreatedEvent(job *ethTypes.Job, nonce uint64) { - glog.Infof("Logging JobCreated...") - - props := map[string]interface{}{ - "jobID": job.JobId.Uint64(), - "streamID": job.StreamId, - "broadcasterAddress": job.BroadcasterAddress.Hex(), - "transcoderAddress": job.TranscoderAddress.Hex(), - "creationRound": job.CreationRound.Uint64(), - "creationBlock": job.CreationBlock.Uint64(), - "endBlock": job.EndBlock.Uint64(), - } - - sendPost("JobCreated", nonce, props) -} - -func LogJobReusedEvent(job *ethTypes.Job, startSeq int, nonce uint64) { - glog.Infof("Logging JobReused...") - - props := map[string]interface{}{ - "jobID": job.JobId.Uint64(), - "streamID": job.StreamId, - "broadcasterAddress": job.BroadcasterAddress.Hex(), - "transcoderAddress": job.TranscoderAddress.Hex(), - "creationBlock": job.CreationBlock.Uint64(), - "endBlock": job.EndBlock.Uint64(), - "startSeq": startSeq, - } - - sendPost("JobReused", nonce, props) -} - func LogStreamCreatedEvent(hlsStrmID string, nonce uint64) { glog.Infof("Logging StreamCreated...") diff --git a/server/mediaserver.go b/server/mediaserver.go index 95645419c..fe7f8d817 100644 --- a/server/mediaserver.go +++ b/server/mediaserver.go @@ -277,23 +277,8 @@ func gotRTMPStreamHandler(s *LivepeerServer) func(url *url.URL, rtmpStrm stream. // todo send to metrics ? return ErrRoundInit } - // Check deposit - deposit, err := s.LivepeerNode.Eth.BroadcasterDeposit(s.LivepeerNode.Eth.Account().Address) - if err != nil { - glog.Errorf("Error getting deposit: %v", err) - return ErrBroadcast - } - - glog.V(common.SHORT).Infof("Current deposit is: %v", deposit) - minDeposit := big.NewInt(0).Mul(BroadcastPrice, big.NewInt(MinDepositSegmentCount)) - if deposit.Cmp(minDeposit) < 0 { - glog.Errorf("Low deposit (%v) - cannot start broadcast session. Need at least %v", deposit, minDeposit) - if monitor.Enabled { - monitor.LogStreamCreateFailed(nonce, "LowDeposit") - } - return ErrBroadcast - } + // TODO: Check broadcaster's deposit with TicketBroker } //Create a HLS StreamID diff --git a/server/rpc.go b/server/rpc.go index b63c52d27..30fe62f9c 100644 --- a/server/rpc.go +++ b/server/rpc.go @@ -21,7 +21,6 @@ import ( "github.com/livepeer/go-livepeer/common" "github.com/livepeer/go-livepeer/core" "github.com/livepeer/go-livepeer/drivers" - lpTypes "github.com/livepeer/go-livepeer/eth/types" "github.com/livepeer/go-livepeer/monitor" "github.com/livepeer/go-livepeer/net" ffmpeg "github.com/livepeer/lpms/ffmpeg" @@ -127,25 +126,6 @@ func startOrchestratorClient(uri *url.URL) (net.OrchestratorClient, *grpc.Client return c, conn, nil } -func jobClaimable(orch Orchestrator, job *lpTypes.Job) bool { - if len(job.Profiles) <= 0 { - // This is just to be extra cautious: - // We don't need to do any work, so nothing to claim - return false - } - - blk := orch.CurrentBlock() - if blk == nil { - // The benefit of doubt. - // May be offchain or have internal errors in fetching a block. - return true - } - - canClaim := job.FirstClaimSubmitted || blk.Cmp(new(big.Int).Add(job.CreationBlock, big.NewInt(256))) <= 0 - - return canClaim && !(blk.Cmp(job.CreationBlock) == -1 || blk.Cmp(job.EndBlock) == 1) -} - func verifyOrchestratorReq(orch Orchestrator, req *net.OrchestratorRequest) error { addr := ethcommon.BytesToAddress(req.Address) if !orch.VerifySig(addr, addr.Hex(), req.Sig) { diff --git a/server/webserver.go b/server/webserver.go index 03b3ec06b..1d9c5b28b 100644 --- a/server/webserver.go +++ b/server/webserver.go @@ -314,38 +314,6 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { } }) - mux.HandleFunc("/latestJobs", func(w http.ResponseWriter, r *http.Request) { - countStr := r.FormValue("count") - if countStr == "" { - countStr = "5" - } - count, err := strconv.ParseInt(countStr, 10, 8) - if err != nil { - glog.Error(err) - return - } - numJobs, err := s.LivepeerNode.Eth.NumJobs() - if err != nil { - glog.Error(err) - return - } - ts := "" - for i := numJobs.Int64() - count; i < numJobs.Int64(); i++ { - j, err := s.LivepeerNode.Eth.GetJob(big.NewInt(i)) - if err != nil { - glog.Error(err) - continue - } - t, err := s.LivepeerNode.Eth.AssignedTranscoder(j) - if err != nil { - glog.Error(err) - continue - } - ts = fmt.Sprintf("%vJob: %v, Price: %v, Broadcaster: %v, Transcoder: %v\n", ts, i, j.MaxPricePerSegment.String(), j.BroadcasterAddress.String(), t.String()) - } - w.Write([]byte(ts)) - }) - //Set transcoder config on-chain. mux.HandleFunc("/setOrchestratorConfig", func(w http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil { @@ -742,59 +710,6 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { } }) - mux.HandleFunc("/deposit", func(w http.ResponseWriter, r *http.Request) { - if s.LivepeerNode.Eth != nil { - if err := r.ParseForm(); err != nil { - glog.Errorf("Parse Form Error: %v", err) - return - } - - //Parse amount - amountStr := r.FormValue("amount") - if amountStr == "" { - glog.Errorf("Need to provide amount") - return - } - amount, err := lpcommon.ParseBigInt(amountStr) - if err != nil { - glog.Error(err) - return - } - - glog.Infof("Depositing: %v", amount) - - tx, err := s.LivepeerNode.Eth.Deposit(amount) - if err != nil { - glog.Error(err) - return - } - - err = s.LivepeerNode.Eth.CheckTx(tx) - if err != nil { - glog.Error(err) - return - } - } - }) - - mux.HandleFunc("/withdrawDeposit", func(w http.ResponseWriter, r *http.Request) { - if s.LivepeerNode.Eth != nil { - tx, err := s.LivepeerNode.Eth.Withdraw() - if err != nil { - glog.Error(err) - return - } - - err = s.LivepeerNode.Eth.CheckTx(tx) - if err != nil { - glog.Error(err) - return - } - - glog.Infof("Withdrew deposit") - } - }) - //Print the current broadcast HLS streamID mux.HandleFunc("/streamID", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(LastHLSStreamID)) @@ -911,48 +826,6 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { return } - verificationRate, err := lp.VerificationRate() - if err != nil { - glog.Error(err) - return - } - - verificationPeriod, err := lp.VerificationPeriod() - if err != nil { - glog.Error(err) - return - } - - slashingPeriod, err := lp.VerificationSlashingPeriod() - if err != nil { - glog.Error(err) - return - } - - failedVerificationSlashAmount, err := lp.FailedVerificationSlashAmount() - if err != nil { - glog.Error(err) - return - } - - missedVerificationSlashAmount, err := lp.MissedVerificationSlashAmount() - if err != nil { - glog.Error(err) - return - } - - doubleClaimSegmentSlashAmount, err := lp.DoubleClaimSegmentSlashAmount() - if err != nil { - glog.Error(err) - return - } - - finderFee, err := lp.FinderFee() - if err != nil { - glog.Error(err) - return - } - inflation, err := lp.Inflation() if err != nil { glog.Error(err) @@ -971,12 +844,6 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { return } - verificationCodeHash, err := lp.VerificationCodeHash() - if err != nil { - glog.Error(err) - return - } - totalBonded, err := lp.GetTotalBonded() if err != nil { glog.Error(err) @@ -996,24 +863,16 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { } params := &lpTypes.ProtocolParameters{ - NumActiveTranscoders: numActiveOrchestrators, - RoundLength: roundLength, - RoundLockAmount: roundLockAmount, - UnbondingPeriod: unbondingPeriod, - VerificationRate: verificationRate, - VerificationPeriod: verificationPeriod, - SlashingPeriod: slashingPeriod, - FailedVerificationSlashAmount: failedVerificationSlashAmount, - MissedVerificationSlashAmount: missedVerificationSlashAmount, - DoubleClaimSegmentSlashAmount: doubleClaimSegmentSlashAmount, - FinderFee: finderFee, - Inflation: inflation, - InflationChange: inflationChange, - TargetBondingRate: targetBondingRate, - VerificationCodeHash: verificationCodeHash, - TotalBonded: totalBonded, - TotalSupply: totalSupply, - Paused: paused, + NumActiveTranscoders: numActiveOrchestrators, + RoundLength: roundLength, + RoundLockAmount: roundLockAmount, + UnbondingPeriod: unbondingPeriod, + Inflation: inflation, + InflationChange: inflationChange, + TargetBondingRate: targetBondingRate, + TotalBonded: totalBonded, + TotalSupply: totalSupply, + Paused: paused, } data, err := json.Marshal(params) @@ -1063,18 +922,6 @@ func (s *LivepeerServer) StartWebserver(bindAddr string) { } }) - mux.HandleFunc("/broadcasterDeposit", func(w http.ResponseWriter, r *http.Request) { - if s.LivepeerNode.Eth != nil { - b, err := s.LivepeerNode.Eth.BroadcasterDeposit(s.LivepeerNode.Eth.Account().Address) - if err != nil { - glog.Error(err) - w.Write([]byte("")) - } else { - w.Write([]byte(b.String())) - } - } - }) - mux.HandleFunc("/registeredOrchestrators", func(w http.ResponseWriter, r *http.Request) { if s.LivepeerNode.Eth != nil { orchestrators, err := s.LivepeerNode.Eth.RegisteredTranscoders()