diff --git a/cmd/devtool/devtool.go b/cmd/devtool/devtool.go index 99b90cd837..fc38f44e37 100644 --- a/cmd/devtool/devtool.go +++ b/cmd/devtool/devtool.go @@ -237,7 +237,7 @@ func ethSetup(ethAcctAddr, keystoreDir string, isBroadcaster bool) { } glog.Info("Done initializing round.") glog.Info("Activating transcoder") - // curl -d "blockRewardCut=10&feeShare=5&pricePerSegment=1&amount=500" --data-urlencode "serviceURI=https://$transcoderServiceAddr" \ + // curl -d "blockRewardCut=10&feeShare=5&amount=500" --data-urlencode "serviceURI=https://$transcoderServiceAddr" \ // -H "Content-Type: application/x-www-form-urlencoded" \ // -X "POST" http://localhost:$transcoderCliPort/activateTranscoder\ var amount *big.Int = big.NewInt(int64(500)) @@ -256,9 +256,8 @@ func ethSetup(ethAcctAddr, keystoreDir string, isBroadcaster bool) { return } glog.Infof("Registering transcoder %v", ethAcctAddr) - price := big.NewInt(1) - tx, err = client.Transcoder(eth.FromPerc(10), eth.FromPerc(5), price) + tx, err = client.Transcoder(eth.FromPerc(10), eth.FromPerc(5)) if err == eth.ErrCurrentRoundLocked { // wait for next round and retry } @@ -314,7 +313,7 @@ func createRunScript(ethAcctAddr, dataDir, serviceHost string, isBroadcaster boo script += fmt.Sprintf(` -initializeRound=true \ -serviceAddr %s:%d -transcoder=true -orchestrator=true \ -orchSecret secre -pricePerUnit 1 - `, serviceHost, mediaPort, dataDir) + `, serviceHost, mediaPort) } else { script += fmt.Sprintf(` -broadcaster=true -rtmpAddr %s:%d`, serviceHost, rtmpPort) } diff --git a/cmd/livepeer/livepeer.go b/cmd/livepeer/livepeer.go index ca6207e78f..64ba3c4c82 100644 --- a/cmd/livepeer/livepeer.go +++ b/cmd/livepeer/livepeer.go @@ -383,7 +383,7 @@ func main() { go unbondingWatcher.Watch() defer unbondingWatcher.Stop() - senderWatcher, err := watchers.NewSenderWatcher(addrMap["TicketBroker"], blockWatcher, n.Eth) + senderWatcher, err := watchers.NewSenderWatcher(addrMap["TicketBroker"], blockWatcher, n.Eth, roundsWatcher) if err != nil { glog.Errorf("Failed to setup senderwatcher: %v", err) return diff --git a/cmd/livepeer_cli/wizard_bond.go b/cmd/livepeer_cli/wizard_bond.go index 85c50186bd..e1d133f7d5 100644 --- a/cmd/livepeer_cli/wizard_bond.go +++ b/cmd/livepeer_cli/wizard_bond.go @@ -34,7 +34,7 @@ func (w *wizard) registeredOrchestratorStats() map[int]common.Address { fmt.Println("+------------------------+") table := tablewriter.NewWriter(os.Stdout) - table.SetHeader([]string{"ID", "Address", "Active", "Delegated Stake", "Reward Cut (%)", "Fee Share (%)", "Price", "Pending Reward Cut (%)", "Pending Fee Share (%)", "Pending Price", "Service URI"}) + table.SetHeader([]string{"ID", "Address", "Active", "Delegated Stake", "Reward Cut (%)", "Fee Share (%)", "Service URI"}) for _, t := range orchestrators { table.Append([]string{ @@ -44,10 +44,6 @@ func (w *wizard) registeredOrchestratorStats() map[int]common.Address { eth.FormatUnits(t.DelegatedStake, "LPT"), eth.FormatPerc(t.RewardCut), eth.FormatPerc(t.FeeShare), - eth.FormatUnits(t.PricePerSegment, "ETH"), - eth.FormatPerc(t.PendingRewardCut), - eth.FormatPerc(t.PendingFeeShare), - eth.FormatUnits(t.PendingPricePerSegment, "ETH"), t.ServiceURI, }) @@ -337,7 +333,12 @@ func (w *wizard) withdrawFees() { } func (w *wizard) claimRewardsAndFees() { - fmt.Printf("Current round: %v\n", w.currentRound()) + currentRound, err := w.currentRound() + if err != nil { + glog.Errorf("error getting current round: %v\n", err) + return + } + fmt.Printf("Current round: %v\n", currentRound.Int64()) d, err := w.getDelegatorInfo() if err != nil { diff --git a/cmd/livepeer_cli/wizard_rounds.go b/cmd/livepeer_cli/wizard_rounds.go index ec9cb47664..8f0e9c6f31 100644 --- a/cmd/livepeer_cli/wizard_rounds.go +++ b/cmd/livepeer_cli/wizard_rounds.go @@ -1,11 +1,31 @@ package main import ( + "errors" "fmt" + "io/ioutil" + "math/big" + "net/http" ) -func (w *wizard) currentRound() string { - return httpGet(fmt.Sprintf("http://%v:%v/currentRound", w.host, w.httpPort)) +func (w *wizard) currentRound() (*big.Int, error) { + resp, err := http.Get(fmt.Sprintf("http://%v:%v/currentRound", w.host, w.httpPort)) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, errors.New("http response status not ok") + } + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + return new(big.Int).SetBytes(body), nil } func (w *wizard) initializeRound() { diff --git a/cmd/livepeer_cli/wizard_stats.go b/cmd/livepeer_cli/wizard_stats.go index 66efd90750..82882e3a4c 100644 --- a/cmd/livepeer_cli/wizard_stats.go +++ b/cmd/livepeer_cli/wizard_stats.go @@ -15,7 +15,6 @@ import ( "github.com/livepeer/go-livepeer/eth" lpTypes "github.com/livepeer/go-livepeer/eth/types" "github.com/livepeer/go-livepeer/net" - "github.com/livepeer/go-livepeer/pm" "github.com/olekukonko/tablewriter" ) @@ -76,7 +75,11 @@ func (w *wizard) stats(showOrchestrator bool) { w.delegatorStats() } - currentRound := w.currentRound() + currentRound, err := w.currentRound() + if err != nil { + glog.Errorf("Error getting current round: %v", err) + return + } fmt.Printf("CURRENT ROUND: %v\n", currentRound) } @@ -153,19 +156,15 @@ func (w *wizard) broadcastStats() { []string{"Max Price Per Pixel", priceString}, []string{"Broadcast Transcoding Options", transcodingOptions}, []string{"Deposit", eth.FormatUnits(sender.Deposit, "ETH")}, - []string{"Reserve", eth.FormatUnits(sender.Reserve, "ETH")}, + []string{"Reserve", eth.FormatUnits(sender.Reserve.FundsRemaining, "ETH")}, } for _, v := range data { table.Append(v) } - if sender.ReserveState != pm.NotFrozen { - table.Append([]string{"Thaw Round", sender.ThawRound.String()}) - } - - if sender.WithdrawBlock.Cmp(big.NewInt(0)) > 0 && (sender.Deposit.Cmp(big.NewInt(0)) > 0 || sender.Reserve.Cmp(big.NewInt(0)) > 0) { - table.Append([]string{"Withdraw Block", sender.WithdrawBlock.String()}) + if sender.WithdrawRound.Cmp(big.NewInt(0)) > 0 && (sender.Deposit.Cmp(big.NewInt(0)) > 0 || sender.Reserve.FundsRemaining.Cmp(big.NewInt(0)) > 0) { + table.Append([]string{"Withdraw Round", sender.WithdrawRound.String()}) } table.SetAlignment(tablewriter.ALIGN_RIGHT) @@ -197,8 +196,6 @@ func (w *wizard) orchestratorStats() { []string{"Delegated Stake", eth.FormatUnits(t.DelegatedStake, "LPT")}, []string{"Reward Cut (%)", eth.FormatPerc(t.RewardCut)}, []string{"Fee Share (%)", eth.FormatPerc(t.FeeShare)}, - []string{"Pending Reward Cut (%)", eth.FormatPerc(t.PendingRewardCut)}, - []string{"Pending Fee Share (%)", eth.FormatPerc(t.PendingFeeShare)}, []string{"Last Reward Round", t.LastRewardRound.String()}, []string{"Base price per pixel", fmt.Sprintf("%v wei / %v pixels", priceInfo.Num(), priceInfo.Denom())}, } diff --git a/cmd/livepeer_cli/wizard_ticketbroker.go b/cmd/livepeer_cli/wizard_ticketbroker.go index d8f4bf11f9..b2813d9a08 100644 --- a/cmd/livepeer_cli/wizard_ticketbroker.go +++ b/cmd/livepeer_cli/wizard_ticketbroker.go @@ -47,17 +47,7 @@ func (w *wizard) deposit() { } fmt.Printf("Current Deposit: %v\n", sender.Deposit) - fmt.Printf("Current Reserve: %v\n", sender.Reserve) - - if sender.ReserveState == pm.Frozen { - currRound := w.currentRound() - - fmt.Printf("Current Round: %v\n", currRound) - fmt.Printf("Thaw Round: %v\n", sender.ThawRound) - - fmt.Printf("Cannot deposit because sender's reserve is frozen and not yet thawed") - return - } + fmt.Printf("Current Reserve: %v\n", sender.Reserve.FundsRemaining) fmt.Printf("Enter deposit amount in ETH - ") @@ -83,28 +73,18 @@ func (w *wizard) unlock() { return } - blk, err := w.currentBlock() + round, err := w.currentRound() if err != nil { - glog.Errorf("Error getting current block: %v", err) + glog.Errorf("Error getting current round: %v", err) return } fmt.Printf("Current Deposit: %v\n", eth.FormatUnits(sender.Deposit, "ETH")) - fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve, "ETH")) - - if sender.ReserveState == pm.Frozen { - currRound := w.currentRound() - - fmt.Printf("Current Round: %v\n", currRound) - fmt.Printf("Thaw Round: %v\n", sender.ThawRound) - - fmt.Printf("Cannot deposit because sender's reserve is frozen and not yet thawed") - return - } + fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve.FundsRemaining, "ETH")) - fmt.Printf("Current Block: %v\n", blk) + fmt.Printf("Current Round: %v\n", round) - ss := senderStatus(sender, blk) + ss := senderStatus(sender, round) if ss != Locked { printSenderStatus("Cannot unlock because sender's deposit and reserve are not locked", ss) return @@ -116,9 +96,9 @@ func (w *wizard) unlock() { return } - projWithdrawBlock := new(big.Int).Add(blk, params.UnlockPeriod) + projWithdrawRound := new(big.Int).Add(round, params.UnlockPeriod) - fmt.Printf("If you initiate the unlock period now, you will be able to withdraw at block %v\n", projWithdrawBlock) + fmt.Printf("If you initiate the unlock period now, you will be able to withdraw at round %v\n", projWithdrawRound) fmt.Printf("Would you like initiate the unlock period? (y/n) - ") input := w.readStringYesOrNo() @@ -136,18 +116,18 @@ func (w *wizard) cancelUnlock() { return } - blk, err := w.currentBlock() + round, err := w.currentRound() if err != nil { - glog.Errorf("Error getting current block: %v", err) + glog.Errorf("Error getting current round: %v", err) return } fmt.Printf("Current Deposit: %v\n", eth.FormatUnits(sender.Deposit, "ETH")) - fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve, "ETH")) - fmt.Printf("Current Block: %v\n", blk) - fmt.Printf("Withdraw Block: %v\n", sender.WithdrawBlock) + fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve.FundsRemaining, "ETH")) + fmt.Printf("Current Round: %v\n", round) + fmt.Printf("Withdraw Round: %v\n", sender.WithdrawRound) - ss := senderStatus(sender, blk) + ss := senderStatus(sender, round) if ss != Unlocking { printSenderStatus("Cannot cancel unlock because sender is not in the unlock period", ss) return @@ -171,33 +151,21 @@ func (w *wizard) withdraw() { } fmt.Printf("Current Deposit: %v\n", eth.FormatUnits(sender.Deposit, "ETH")) - fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve, "ETH")) + fmt.Printf("Current Reserve: %v\n", eth.FormatUnits(sender.Reserve.FundsRemaining, "ETH")) - if sender.ReserveState != pm.NotFrozen { - currRound := w.currentRound() - - fmt.Printf("Current Round: %v\n", currRound) - fmt.Printf("Thaw Round: %v\n", sender.ThawRound) - - if sender.ReserveState == pm.Frozen { - fmt.Printf("Cannot withdraw because sender's reserve is frozen and not yet thawed") - return - } - } else { - blk, err := w.currentBlock() - if err != nil { - glog.Errorf("Error getting current block: %v", err) - return - } + round, err := w.currentRound() + if err != nil { + glog.Errorf("Error getting current round: %v", err) + return + } - fmt.Printf("Current Block: %v\n", blk) - fmt.Printf("Withdraw Block: %v\n", sender.WithdrawBlock) + fmt.Printf("Current Round: %v\n", round) + fmt.Printf("Withdraw Round: %v\n", sender.WithdrawRound) - ss := senderStatus(sender, blk) - if ss != Unlocked { - printSenderStatus("Cannot withdraw because sender's deposit and reserve are not unlocked", ss) - return - } + ss := senderStatus(sender, round) + if ss != Unlocked { + printSenderStatus("Cannot withdraw because sender's deposit and reserve are not unlocked", ss) + return } fmt.Printf("Would you like to withdraw? (y/n) - ") @@ -220,9 +188,11 @@ func (w *wizard) senderInfo() (info pm.SenderInfo, err error) { if resp.StatusCode == http.StatusInternalServerError { // node is in offchain mode info.Deposit = big.NewInt(0) - info.Reserve = big.NewInt(0) - info.ThawRound = big.NewInt(0) - info.WithdrawBlock = big.NewInt(0) + info.WithdrawRound = big.NewInt(0) + info.Reserve = &pm.ReserveInfo{ + FundsRemaining: big.NewInt(0), + ClaimedInCurrentRound: big.NewInt(0), + } return } @@ -282,13 +252,13 @@ func printSenderStatus(msg string, status SenderStatus) { fmt.Printf("%v: %v\n", msg, statusMsg) } -func senderStatus(sender pm.SenderInfo, currentBlock *big.Int) SenderStatus { - if sender.Deposit.Cmp(big.NewInt(0)) == 0 && sender.Reserve.Cmp(big.NewInt(0)) == 0 { +func senderStatus(sender pm.SenderInfo, currentRound *big.Int) SenderStatus { + if sender.Deposit.Cmp(big.NewInt(0)) == 0 && sender.Reserve.FundsRemaining.Cmp(big.NewInt(0)) == 0 { return Empty } - if sender.WithdrawBlock.Cmp(big.NewInt(0)) > 0 { - if sender.WithdrawBlock.Cmp(currentBlock) <= 0 { + if sender.WithdrawRound.Cmp(big.NewInt(0)) > 0 { + if sender.WithdrawRound.Cmp(currentRound) <= 0 { return Unlocked } diff --git a/cmd/livepeer_cli/wizard_ticketbroker_test.go b/cmd/livepeer_cli/wizard_ticketbroker_test.go index 32bf4916cc..1f4c9629b3 100644 --- a/cmd/livepeer_cli/wizard_ticketbroker_test.go +++ b/cmd/livepeer_cli/wizard_ticketbroker_test.go @@ -8,10 +8,13 @@ import ( "github.com/stretchr/testify/assert" ) -func createSender(deposit *big.Int, reserve *big.Int, withdrawBlock *big.Int) (sender pm.SenderInfo) { +func createSender(deposit *big.Int, reserve *big.Int, withdrawRound *big.Int) (sender pm.SenderInfo) { sender.Deposit = deposit - sender.Reserve = reserve - sender.WithdrawBlock = withdrawBlock + sender.WithdrawRound = withdrawRound + sender.Reserve = &pm.ReserveInfo{ + FundsRemaining: reserve, + ClaimedInCurrentRound: big.NewInt(0), + } return } @@ -24,17 +27,17 @@ func TestSenderStatus(t *testing.T) { ss := senderStatus(s, big.NewInt(0)) assert.Equal(Empty, ss) - // Test Empty, but withdrawBlock > 0 + // Test Empty, but WithdrawRound > 0 s = createSender(big.NewInt(0), big.NewInt(0), big.NewInt(5)) ss = senderStatus(s, big.NewInt(0)) assert.Equal(Empty, ss) - // Test Unlocked when withdrawBlock = currentBlock + // Test Unlocked when WithdrawRound = currentRound s = createSender(big.NewInt(7), big.NewInt(0), big.NewInt(5)) ss = senderStatus(s, big.NewInt(5)) assert.Equal(Unlocked, ss) - // Test Unlocked when withdrawBlock < currentBlock + // Test Unlocked when WithdrawRound < currentRound s = createSender(big.NewInt(7), big.NewInt(0), big.NewInt(5)) ss = senderStatus(s, big.NewInt(6)) assert.Equal(Unlocked, ss) diff --git a/cmd/livepeer_cli/wizard_transcoder.go b/cmd/livepeer_cli/wizard_transcoder.go index 7f0edc4a27..aa351901c0 100644 --- a/cmd/livepeer_cli/wizard_transcoder.go +++ b/cmd/livepeer_cli/wizard_transcoder.go @@ -172,12 +172,12 @@ func (w *wizard) callReward() { fmt.Printf("Error getting orchestrator info: %v\n", err) return } - c, err := strconv.ParseInt(w.currentRound(), 10, 64) + c, err := w.currentRound() if err != nil { fmt.Printf("Error converting current round: %v\n", c) } - if c == t.LastRewardRound.Int64() { + if c.Cmp(t.LastRewardRound) == 0 { fmt.Printf("Reward for current round %v already called\n", c) return } diff --git a/eth/client.go b/eth/client.go index dc72a2f0f2..9c094a923c 100644 --- a/eth/client.go +++ b/eth/client.go @@ -10,7 +10,6 @@ package eth //go:generate abigen --abi protocol/abi/TicketBroker.abi --pkg contracts --type TicketBroker --out contracts/ticketBroker.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 //go:generate abigen --abi protocol/abi/LivepeerTokenFaucet.abi --pkg contracts --type LivepeerTokenFaucet --out contracts/livepeerTokenFaucet.go import ( @@ -66,7 +65,7 @@ type LivepeerEthClient interface { GetServiceURI(addr ethcommon.Address) (string, error) // Staking - Transcoder(blockRewardCut *big.Int, feeShare *big.Int, pricePerSegment *big.Int) (*types.Transaction, error) + Transcoder(blockRewardCut, feeShare *big.Int) (*types.Transaction, error) Reward() (*types.Transaction, error) Bond(amount *big.Int, toAddr ethcommon.Address) (*types.Transaction, error) Rebond(unbondingLockID *big.Int) (*types.Transaction, error) @@ -98,7 +97,7 @@ type LivepeerEthClient interface { ClaimedReserve(reserveHolder ethcommon.Address, claimant ethcommon.Address) (*big.Int, error) // Parameters - NumActiveTranscoders() (*big.Int, error) + GetTranscoderPoolMaxSize() (*big.Int, error) RoundLength() (*big.Int, error) RoundLockAmount() (*big.Int, error) UnbondingPeriod() (uint64, error) @@ -138,7 +137,6 @@ type client struct { *contracts.TicketBrokerSession *contracts.RoundsManagerSession *contracts.MinterSession - *contracts.LivepeerVerifierSession *contracts.LivepeerTokenFaucetSession gasLimit uint64 @@ -331,27 +329,6 @@ func (c *client) setContracts(opts *bind.TransactOpts) error { glog.V(common.SHORT).Infof("Minter: %v", c.minterAddr.Hex()) - verifierAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("Verifier"))) - if err != nil { - glog.Errorf("Error getting Verifier address: %v", err) - return err - } - - c.verifierAddr = verifierAddr - - verifier, err := contracts.NewLivepeerVerifier(verifierAddr, c.backend) - if err != nil { - glog.Errorf("Error creating LivepeerVerifier binding: %v", err) - return err - } - - // Client should never transact with the Verifier directly so we don't include transact opts - c.LivepeerVerifierSession = &contracts.LivepeerVerifierSession{ - Contract: verifier, - } - - glog.V(common.SHORT).Infof("Verifier: %v", c.verifierAddr.Hex()) - faucetAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("LivepeerTokenFaucet"))) if err != nil { glog.Errorf("Error getting LivepeerTokenFaucet address: %v", err) @@ -404,7 +381,7 @@ func (c *client) InitializeRound() (*types.Transaction, error) { // Staking -func (c *client) Transcoder(blockRewardCut, feeShare, pricePerSegment *big.Int) (*types.Transaction, error) { +func (c *client) Transcoder(blockRewardCut, feeShare *big.Int) (*types.Transaction, error) { locked, err := c.CurrentRoundLocked() if err != nil { return nil, err @@ -413,7 +390,7 @@ func (c *client) Transcoder(blockRewardCut, feeShare, pricePerSegment *big.Int) if locked { return nil, ErrCurrentRoundLocked } else { - return c.BondingManagerSession.Transcoder(blockRewardCut, feeShare, pricePerSegment) + return c.BondingManagerSession.Transcoder(blockRewardCut, feeShare) } } @@ -569,12 +546,7 @@ func (c *client) autoClaimEarnings(endRound *big.Int, allRounds bool) error { } func (c *client) IsActiveTranscoder() (bool, error) { - r, err := c.CurrentRound() - if err != nil { - return false, err - } - - return c.BondingManagerSession.IsActiveTranscoder(c.Account().Address, r) + return c.BondingManagerSession.IsActiveTranscoder(c.Account().Address) } func (c *client) GetTranscoder(addr ethcommon.Address) (*lpTypes.Transcoder, error) { @@ -598,12 +570,7 @@ func (c *client) GetTranscoder(addr ethcommon.Address) (*lpTypes.Transcoder, err return nil, err } - currentRound, err := c.CurrentRound() - if err != nil { - return nil, err - } - - active, err := c.BondingManagerSession.IsActiveTranscoder(addr, currentRound) + active, err := c.BondingManagerSession.IsActiveTranscoder(addr) if err != nil { return nil, err } @@ -614,18 +581,14 @@ func (c *client) GetTranscoder(addr ethcommon.Address) (*lpTypes.Transcoder, err } return &lpTypes.Transcoder{ - Address: addr, - ServiceURI: serviceURI, - LastRewardRound: tInfo.LastRewardRound, - RewardCut: tInfo.RewardCut, - FeeShare: tInfo.FeeShare, - PricePerSegment: tInfo.PricePerSegment, - PendingRewardCut: tInfo.PendingRewardCut, - PendingFeeShare: tInfo.PendingFeeShare, - PendingPricePerSegment: tInfo.PendingPricePerSegment, - DelegatedStake: delegatedStake, - Active: active, - Status: status, + Address: addr, + ServiceURI: serviceURI, + LastRewardRound: tInfo.LastRewardRound, + RewardCut: tInfo.RewardCut, + FeeShare: tInfo.FeeShare, + DelegatedStake: delegatedStake, + Active: active, + Status: status, }, nil } diff --git a/eth/client_ticketbroker.go b/eth/client_ticketbroker.go index c9eb8a6c34..8bfe7df0fc 100644 --- a/eth/client_ticketbroker.go +++ b/eth/client_ticketbroker.go @@ -2,7 +2,10 @@ package eth import ( "math/big" + "strings" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/livepeer/go-livepeer/eth/contracts" @@ -62,17 +65,31 @@ func (c *client) RedeemWinningTicket(ticket *pm.Ticket, sig []byte, recipientRan // GetSenderInfo returns the info for a sender func (c *client) GetSenderInfo(addr ethcommon.Address) (*pm.SenderInfo, error) { - info, err := c.TicketBrokerSession.GetSenderInfo(addr) + info := new(struct { + Sender struct { + Deposit *big.Int + WithdrawRound *big.Int + } + Reserve pm.ReserveInfo + }) + + abi, err := abi.JSON(strings.NewReader(contracts.TicketBrokerABI)) if err != nil { return nil, err } + contract := bind.NewBoundContract(c.ticketBrokerAddr, abi, c.backend, c.backend, c.backend) + if err := contract.Call(&c.TicketBrokerSession.CallOpts, info, "getSenderInfo", addr); err != nil { + return nil, err + } + return &pm.SenderInfo{ Deposit: info.Sender.Deposit, - WithdrawBlock: info.Sender.WithdrawBlock, - Reserve: info.Reserve.FundsRemaining, - ReserveState: pm.ReserveState(info.Reserve.State), - ThawRound: info.Reserve.ThawRound, + WithdrawRound: info.Sender.WithdrawRound, + Reserve: &pm.ReserveInfo{ + FundsRemaining: info.Reserve.FundsRemaining, + ClaimedInCurrentRound: info.Reserve.ClaimedInCurrentRound, + }, }, nil } diff --git a/eth/contracts/bondingManager.go b/eth/contracts/bondingManager.go index c0b8a937de..1a4df3bee8 100644 --- a/eth/contracts/bondingManager.go +++ b/eth/contracts/bondingManager.go @@ -28,7 +28,7 @@ var ( ) // 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\":\"\",\"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\"}]" +const BondingManagerABI = "[{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"activeTranscoderSetDEPRECATED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStake\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxEarningsClaimsRounds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numActiveTranscodersDEPRECATED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundTotalActiveStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"nextRoundTotalActiveStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"unbondingPeriod\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardCut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeShare\",\"type\":\"uint256\"}],\"name\":\"TranscoderUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"activationRound\",\"type\":\"uint256\"}],\"name\":\"TranscoderActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deactivationRound\",\"type\":\"uint256\"}],\"name\":\"TranscoderDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"finder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"penalty\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"finderReward\",\"type\":\"uint256\"}],\"name\":\"TranscoderSlashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"transcoder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Reward\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"additionalAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bondedAmount\",\"type\":\"uint256\"}],\"name\":\"Bond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"Unbond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Rebond\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unbondingLockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"name\":\"WithdrawStake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"WithdrawFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewards\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fees\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startRound\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endRound\",\"type\":\"uint256\"}],\"name\":\"EarningsClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_unbondingPeriod\",\"type\":\"uint64\"}],\"name\":\"setUnbondingPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numActiveTranscoders\",\"type\":\"uint256\"}],\"name\":\"setNumActiveTranscoders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxEarningsClaimsRounds\",\"type\":\"uint256\"}],\"name\":\"setMaxEarningsClaimsRounds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_rewardCut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeShare\",\"type\":\"uint256\"}],\"name\":\"transcoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"bond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"unbond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebond\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"rebondFromUnbonded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"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\":\"reward\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fees\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"updateTranscoderWithFees\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_finder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_slashAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_finderFee\",\"type\":\"uint256\"}],\"name\":\"slashTranscoder\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"claimEarnings\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setCurrentRoundTotalActiveStake\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_rewardCut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeShare\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_newPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newPosNext\",\"type\":\"address\"}],\"name\":\"transcoderWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_oldDelegateNewPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_oldDelegateNewPosNext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currDelegateNewPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_currDelegateNewPosNext\",\"type\":\"address\"}],\"name\":\"bondWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_newPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newPosNext\",\"type\":\"address\"}],\"name\":\"unbondWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_newPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newPosNext\",\"type\":\"address\"}],\"name\":\"rebondWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_newPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newPosNext\",\"type\":\"address\"}],\"name\":\"rebondFromUnbondedWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newPosPrev\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newPosNext\",\"type\":\"address\"}],\"name\":\"rewardWithHint\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_endRound\",\"type\":\"uint256\"}],\"name\":\"pendingFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderTotalStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"transcoderStatus\",\"outputs\":[{\"internalType\":\"enumBondingManager.TranscoderStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"delegatorStatus\",\"outputs\":[{\"internalType\":\"enumBondingManager.DelegatorStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getTranscoder\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"lastRewardRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardCut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeShare\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastActiveStakeUpdateRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"activationRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deactivationRound\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getTranscoderEarningsPoolForRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardPool\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feePool\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimableStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transcoderRewardCut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transcoderFeeShare\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transcoderRewardPool\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"transcoderFeePool\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"hasTranscoderRewardFeePool\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"}],\"name\":\"getDelegator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"bondedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fees\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"delegateAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"delegatedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastClaimRound\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nextUnbondingLockId\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"getDelegatorUnbondingLock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolMaxSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTranscoderPoolSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getFirstTranscoderInPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"getNextTranscoderInPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTotalBonded\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"isActiveTranscoder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_transcoder\",\"type\":\"address\"}],\"name\":\"isRegisteredTranscoder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_unbondingLockId\",\"type\":\"uint256\"}],\"name\":\"isValidUnbondingLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // BondingManager is an auto generated Go binding around an Ethereum contract. type BondingManager struct { @@ -172,56 +172,30 @@ func (_BondingManager *BondingManagerTransactorRaw) Transact(opts *bind.Transact return _BondingManager.Contract.contract.Transact(opts, method, params...) } -// ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. +// ActiveTranscoderSetDEPRECATED is a free data retrieval call binding the contract method 0x014ee259. // -// Solidity: function activeTranscoderSet(uint256 ) constant returns(uint256 totalStake) -func (_BondingManager *BondingManagerCaller) ActiveTranscoderSet(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { +// Solidity: function activeTranscoderSetDEPRECATED(uint256 ) constant returns(uint256 totalStake) +func (_BondingManager *BondingManagerCaller) ActiveTranscoderSetDEPRECATED(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 - err := _BondingManager.contract.Call(opts, out, "activeTranscoderSet", arg0) + err := _BondingManager.contract.Call(opts, out, "activeTranscoderSetDEPRECATED", arg0) return *ret0, err } -// ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. +// ActiveTranscoderSetDEPRECATED is a free data retrieval call binding the contract method 0x014ee259. // -// 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) +// Solidity: function activeTranscoderSetDEPRECATED(uint256 ) constant returns(uint256 totalStake) +func (_BondingManager *BondingManagerSession) ActiveTranscoderSetDEPRECATED(arg0 *big.Int) (*big.Int, error) { + return _BondingManager.Contract.ActiveTranscoderSetDEPRECATED(&_BondingManager.CallOpts, arg0) } -// ActiveTranscoderSet is a free data retrieval call binding the contract method 0x3da1c2f5. +// ActiveTranscoderSetDEPRECATED is a free data retrieval call binding the contract method 0x014ee259. // -// 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(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) - ) - out := ret0 - err := _BondingManager.contract.Call(opts, out, "activeTranscoderTotalStake", _transcoder, _round) - return *ret0, err -} - -// ActiveTranscoderTotalStake is a free data retrieval call binding the contract method 0xf2083220. -// -// 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(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) +// Solidity: function activeTranscoderSetDEPRECATED(uint256 ) constant returns(uint256 totalStake) +func (_BondingManager *BondingManagerCallerSession) ActiveTranscoderSetDEPRECATED(arg0 *big.Int) (*big.Int, error) { + return _BondingManager.Contract.ActiveTranscoderSetDEPRECATED(&_BondingManager.CallOpts, arg0) } // Controller is a free data retrieval call binding the contract method 0xf77c4791. @@ -250,56 +224,56 @@ func (_BondingManager *BondingManagerCallerSession) Controller() (common.Address return _BondingManager.Contract.Controller(&_BondingManager.CallOpts) } -// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. +// CurrentRoundTotalActiveStake is a free data retrieval call binding the contract method 0x4196ee75. // -// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) -func (_BondingManager *BondingManagerCaller) DelegatorStatus(opts *bind.CallOpts, _delegator common.Address) (uint8, error) { +// Solidity: function currentRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerCaller) CurrentRoundTotalActiveStake(opts *bind.CallOpts) (*big.Int, error) { var ( - ret0 = new(uint8) + ret0 = new(*big.Int) ) out := ret0 - err := _BondingManager.contract.Call(opts, out, "delegatorStatus", _delegator) + err := _BondingManager.contract.Call(opts, out, "currentRoundTotalActiveStake") return *ret0, err } -// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. +// CurrentRoundTotalActiveStake is a free data retrieval call binding the contract method 0x4196ee75. // -// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) -func (_BondingManager *BondingManagerSession) DelegatorStatus(_delegator common.Address) (uint8, error) { - return _BondingManager.Contract.DelegatorStatus(&_BondingManager.CallOpts, _delegator) +// Solidity: function currentRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerSession) CurrentRoundTotalActiveStake() (*big.Int, error) { + return _BondingManager.Contract.CurrentRoundTotalActiveStake(&_BondingManager.CallOpts) } -// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. +// CurrentRoundTotalActiveStake is a free data retrieval call binding the contract method 0x4196ee75. // -// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) -func (_BondingManager *BondingManagerCallerSession) DelegatorStatus(_delegator common.Address) (uint8, error) { - return _BondingManager.Contract.DelegatorStatus(&_BondingManager.CallOpts, _delegator) +// Solidity: function currentRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerCallerSession) CurrentRoundTotalActiveStake() (*big.Int, error) { + return _BondingManager.Contract.CurrentRoundTotalActiveStake(&_BondingManager.CallOpts) } -// ElectActiveTranscoder is a free data retrieval call binding the contract method 0x91fdf6b1. +// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// 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) { +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) +func (_BondingManager *BondingManagerCaller) DelegatorStatus(opts *bind.CallOpts, _delegator common.Address) (uint8, error) { var ( - ret0 = new(common.Address) + ret0 = new(uint8) ) out := ret0 - err := _BondingManager.contract.Call(opts, out, "electActiveTranscoder", _maxPricePerSegment, _blockHash, _round) + err := _BondingManager.contract.Call(opts, out, "delegatorStatus", _delegator) return *ret0, err } -// ElectActiveTranscoder is a free data retrieval call binding the contract method 0x91fdf6b1. +// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// 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) +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) +func (_BondingManager *BondingManagerSession) 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. +// DelegatorStatus is a free data retrieval call binding the contract method 0x1544fc67. // -// 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) +// Solidity: function delegatorStatus(address _delegator) constant returns(uint8) +func (_BondingManager *BondingManagerCallerSession) DelegatorStatus(_delegator common.Address) (uint8, error) { + return _BondingManager.Contract.DelegatorStatus(&_BondingManager.CallOpts, _delegator) } // GetDelegator is a free data retrieval call binding the contract method 0xa64ad595. @@ -446,32 +420,6 @@ func (_BondingManager *BondingManagerCallerSession) GetNextTranscoderInPool(_tra return _BondingManager.Contract.GetNextTranscoderInPool(&_BondingManager.CallOpts, _transcoder) } -// GetTotalActiveStake is a free data retrieval call binding the contract method 0x77517765. -// -// 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) - ) - out := ret0 - err := _BondingManager.contract.Call(opts, out, "getTotalActiveStake", _round) - return *ret0, err -} - -// GetTotalActiveStake is a free data retrieval call binding the contract method 0x77517765. -// -// 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(uint256 _round) constant returns(uint256) -func (_BondingManager *BondingManagerCallerSession) GetTotalActiveStake(_round *big.Int) (*big.Int, error) { - return _BondingManager.Contract.GetTotalActiveStake(&_BondingManager.CallOpts, _round) -} - // GetTotalBonded is a free data retrieval call binding the contract method 0x5c50c356. // // Solidity: function getTotalBonded() constant returns(uint256) @@ -500,24 +448,22 @@ func (_BondingManager *BondingManagerCallerSession) GetTotalBonded() (*big.Int, // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 lastActiveStakeUpdateRound, uint256 activationRound, uint256 deactivationRound) func (_BondingManager *BondingManagerCaller) GetTranscoder(opts *bind.CallOpts, _transcoder common.Address) (struct { - LastRewardRound *big.Int - RewardCut *big.Int - FeeShare *big.Int - PricePerSegment *big.Int - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int + LastRewardRound *big.Int + RewardCut *big.Int + FeeShare *big.Int + LastActiveStakeUpdateRound *big.Int + ActivationRound *big.Int + DeactivationRound *big.Int }, error) { ret := new(struct { - LastRewardRound *big.Int - RewardCut *big.Int - FeeShare *big.Int - PricePerSegment *big.Int - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int + LastRewardRound *big.Int + RewardCut *big.Int + FeeShare *big.Int + LastActiveStakeUpdateRound *big.Int + ActivationRound *big.Int + DeactivationRound *big.Int }) out := ret err := _BondingManager.contract.Call(opts, out, "getTranscoder", _transcoder) @@ -526,30 +472,28 @@ func (_BondingManager *BondingManagerCaller) GetTranscoder(opts *bind.CallOpts, // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 lastActiveStakeUpdateRound, uint256 activationRound, uint256 deactivationRound) func (_BondingManager *BondingManagerSession) GetTranscoder(_transcoder common.Address) (struct { - LastRewardRound *big.Int - RewardCut *big.Int - FeeShare *big.Int - PricePerSegment *big.Int - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int + LastRewardRound *big.Int + RewardCut *big.Int + FeeShare *big.Int + LastActiveStakeUpdateRound *big.Int + ActivationRound *big.Int + DeactivationRound *big.Int }, error) { return _BondingManager.Contract.GetTranscoder(&_BondingManager.CallOpts, _transcoder) } // GetTranscoder is a free data retrieval call binding the contract method 0x5dce9948. // -// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 pricePerSegment, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment) +// Solidity: function getTranscoder(address _transcoder) constant returns(uint256 lastRewardRound, uint256 rewardCut, uint256 feeShare, uint256 lastActiveStakeUpdateRound, uint256 activationRound, uint256 deactivationRound) func (_BondingManager *BondingManagerCallerSession) GetTranscoder(_transcoder common.Address) (struct { - LastRewardRound *big.Int - RewardCut *big.Int - FeeShare *big.Int - PricePerSegment *big.Int - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int + LastRewardRound *big.Int + RewardCut *big.Int + FeeShare *big.Int + LastActiveStakeUpdateRound *big.Int + ActivationRound *big.Int + DeactivationRound *big.Int }, error) { return _BondingManager.Contract.GetTranscoder(&_BondingManager.CallOpts, _transcoder) } @@ -670,30 +614,30 @@ func (_BondingManager *BondingManagerCallerSession) GetTranscoderPoolSize() (*bi return _BondingManager.Contract.GetTranscoderPoolSize(&_BondingManager.CallOpts) } -// IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. +// IsActiveTranscoder is a free data retrieval call binding the contract method 0x08802374. // -// 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) { +// Solidity: function isActiveTranscoder(address _transcoder) constant returns(bool) +func (_BondingManager *BondingManagerCaller) IsActiveTranscoder(opts *bind.CallOpts, _transcoder common.Address) (bool, error) { var ( ret0 = new(bool) ) out := ret0 - err := _BondingManager.contract.Call(opts, out, "isActiveTranscoder", _transcoder, _round) + err := _BondingManager.contract.Call(opts, out, "isActiveTranscoder", _transcoder) return *ret0, err } -// IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. +// IsActiveTranscoder is a free data retrieval call binding the contract method 0x08802374. // -// 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) +// Solidity: function isActiveTranscoder(address _transcoder) constant returns(bool) +func (_BondingManager *BondingManagerSession) IsActiveTranscoder(_transcoder common.Address) (bool, error) { + return _BondingManager.Contract.IsActiveTranscoder(&_BondingManager.CallOpts, _transcoder) } -// IsActiveTranscoder is a free data retrieval call binding the contract method 0x7c0207cb. +// IsActiveTranscoder is a free data retrieval call binding the contract method 0x08802374. // -// 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) +// Solidity: function isActiveTranscoder(address _transcoder) constant returns(bool) +func (_BondingManager *BondingManagerCallerSession) IsActiveTranscoder(_transcoder common.Address) (bool, error) { + return _BondingManager.Contract.IsActiveTranscoder(&_BondingManager.CallOpts, _transcoder) } // IsRegisteredTranscoder is a free data retrieval call binding the contract method 0x68ba170c. @@ -774,30 +718,56 @@ func (_BondingManager *BondingManagerCallerSession) MaxEarningsClaimsRounds() (* return _BondingManager.Contract.MaxEarningsClaimsRounds(&_BondingManager.CallOpts) } -// NumActiveTranscoders is a free data retrieval call binding the contract method 0x61e25d23. +// NextRoundTotalActiveStake is a free data retrieval call binding the contract method 0x465501d3. // -// Solidity: function numActiveTranscoders() constant returns(uint256) -func (_BondingManager *BondingManagerCaller) NumActiveTranscoders(opts *bind.CallOpts) (*big.Int, error) { +// Solidity: function nextRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerCaller) NextRoundTotalActiveStake(opts *bind.CallOpts) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 - err := _BondingManager.contract.Call(opts, out, "numActiveTranscoders") + err := _BondingManager.contract.Call(opts, out, "nextRoundTotalActiveStake") return *ret0, err } -// NumActiveTranscoders is a free data retrieval call binding the contract method 0x61e25d23. +// NextRoundTotalActiveStake is a free data retrieval call binding the contract method 0x465501d3. // -// Solidity: function numActiveTranscoders() constant returns(uint256) -func (_BondingManager *BondingManagerSession) NumActiveTranscoders() (*big.Int, error) { - return _BondingManager.Contract.NumActiveTranscoders(&_BondingManager.CallOpts) +// Solidity: function nextRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerSession) NextRoundTotalActiveStake() (*big.Int, error) { + return _BondingManager.Contract.NextRoundTotalActiveStake(&_BondingManager.CallOpts) } -// NumActiveTranscoders is a free data retrieval call binding the contract method 0x61e25d23. +// NextRoundTotalActiveStake is a free data retrieval call binding the contract method 0x465501d3. // -// Solidity: function numActiveTranscoders() constant returns(uint256) -func (_BondingManager *BondingManagerCallerSession) NumActiveTranscoders() (*big.Int, error) { - return _BondingManager.Contract.NumActiveTranscoders(&_BondingManager.CallOpts) +// Solidity: function nextRoundTotalActiveStake() constant returns(uint256) +func (_BondingManager *BondingManagerCallerSession) NextRoundTotalActiveStake() (*big.Int, error) { + return _BondingManager.Contract.NextRoundTotalActiveStake(&_BondingManager.CallOpts) +} + +// NumActiveTranscodersDEPRECATED is a free data retrieval call binding the contract method 0x3c725cbb. +// +// Solidity: function numActiveTranscodersDEPRECATED() constant returns(uint256) +func (_BondingManager *BondingManagerCaller) NumActiveTranscodersDEPRECATED(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _BondingManager.contract.Call(opts, out, "numActiveTranscodersDEPRECATED") + return *ret0, err +} + +// NumActiveTranscodersDEPRECATED is a free data retrieval call binding the contract method 0x3c725cbb. +// +// Solidity: function numActiveTranscodersDEPRECATED() constant returns(uint256) +func (_BondingManager *BondingManagerSession) NumActiveTranscodersDEPRECATED() (*big.Int, error) { + return _BondingManager.Contract.NumActiveTranscodersDEPRECATED(&_BondingManager.CallOpts) +} + +// NumActiveTranscodersDEPRECATED is a free data retrieval call binding the contract method 0x3c725cbb. +// +// Solidity: function numActiveTranscodersDEPRECATED() constant returns(uint256) +func (_BondingManager *BondingManagerCallerSession) NumActiveTranscodersDEPRECATED() (*big.Int, error) { + return _BondingManager.Contract.NumActiveTranscodersDEPRECATED(&_BondingManager.CallOpts) } // PendingFees is a free data retrieval call binding the contract method 0xf595f1cc. @@ -977,6 +947,27 @@ func (_BondingManager *BondingManagerTransactorSession) Bond(_amount *big.Int, _ return _BondingManager.Contract.Bond(&_BondingManager.TransactOpts, _amount, _to) } +// BondWithHint is a paid mutator transaction binding the contract method 0x6bd9add4. +// +// Solidity: function bondWithHint(uint256 _amount, address _to, address _oldDelegateNewPosPrev, address _oldDelegateNewPosNext, address _currDelegateNewPosPrev, address _currDelegateNewPosNext) returns() +func (_BondingManager *BondingManagerTransactor) BondWithHint(opts *bind.TransactOpts, _amount *big.Int, _to common.Address, _oldDelegateNewPosPrev common.Address, _oldDelegateNewPosNext common.Address, _currDelegateNewPosPrev common.Address, _currDelegateNewPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "bondWithHint", _amount, _to, _oldDelegateNewPosPrev, _oldDelegateNewPosNext, _currDelegateNewPosPrev, _currDelegateNewPosNext) +} + +// BondWithHint is a paid mutator transaction binding the contract method 0x6bd9add4. +// +// Solidity: function bondWithHint(uint256 _amount, address _to, address _oldDelegateNewPosPrev, address _oldDelegateNewPosNext, address _currDelegateNewPosPrev, address _currDelegateNewPosNext) returns() +func (_BondingManager *BondingManagerSession) BondWithHint(_amount *big.Int, _to common.Address, _oldDelegateNewPosPrev common.Address, _oldDelegateNewPosNext common.Address, _currDelegateNewPosPrev common.Address, _currDelegateNewPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.BondWithHint(&_BondingManager.TransactOpts, _amount, _to, _oldDelegateNewPosPrev, _oldDelegateNewPosNext, _currDelegateNewPosPrev, _currDelegateNewPosNext) +} + +// BondWithHint is a paid mutator transaction binding the contract method 0x6bd9add4. +// +// Solidity: function bondWithHint(uint256 _amount, address _to, address _oldDelegateNewPosPrev, address _oldDelegateNewPosNext, address _currDelegateNewPosPrev, address _currDelegateNewPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) BondWithHint(_amount *big.Int, _to common.Address, _oldDelegateNewPosPrev common.Address, _oldDelegateNewPosNext common.Address, _currDelegateNewPosPrev common.Address, _currDelegateNewPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.BondWithHint(&_BondingManager.TransactOpts, _amount, _to, _oldDelegateNewPosPrev, _oldDelegateNewPosNext, _currDelegateNewPosPrev, _currDelegateNewPosNext) +} + // ClaimEarnings is a paid mutator transaction binding the contract method 0x24b1babf. // // Solidity: function claimEarnings(uint256 _endRound) returns() @@ -1040,6 +1031,48 @@ func (_BondingManager *BondingManagerTransactorSession) RebondFromUnbonded(_to c return _BondingManager.Contract.RebondFromUnbonded(&_BondingManager.TransactOpts, _to, _unbondingLockId) } +// RebondFromUnbondedWithHint is a paid mutator transaction binding the contract method 0x0584a373. +// +// Solidity: function rebondFromUnbondedWithHint(address _to, uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactor) RebondFromUnbondedWithHint(opts *bind.TransactOpts, _to common.Address, _unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "rebondFromUnbondedWithHint", _to, _unbondingLockId, _newPosPrev, _newPosNext) +} + +// RebondFromUnbondedWithHint is a paid mutator transaction binding the contract method 0x0584a373. +// +// Solidity: function rebondFromUnbondedWithHint(address _to, uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerSession) RebondFromUnbondedWithHint(_to common.Address, _unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RebondFromUnbondedWithHint(&_BondingManager.TransactOpts, _to, _unbondingLockId, _newPosPrev, _newPosNext) +} + +// RebondFromUnbondedWithHint is a paid mutator transaction binding the contract method 0x0584a373. +// +// Solidity: function rebondFromUnbondedWithHint(address _to, uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) RebondFromUnbondedWithHint(_to common.Address, _unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RebondFromUnbondedWithHint(&_BondingManager.TransactOpts, _to, _unbondingLockId, _newPosPrev, _newPosNext) +} + +// RebondWithHint is a paid mutator transaction binding the contract method 0x7fc4606f. +// +// Solidity: function rebondWithHint(uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactor) RebondWithHint(opts *bind.TransactOpts, _unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "rebondWithHint", _unbondingLockId, _newPosPrev, _newPosNext) +} + +// RebondWithHint is a paid mutator transaction binding the contract method 0x7fc4606f. +// +// Solidity: function rebondWithHint(uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerSession) RebondWithHint(_unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RebondWithHint(&_BondingManager.TransactOpts, _unbondingLockId, _newPosPrev, _newPosNext) +} + +// RebondWithHint is a paid mutator transaction binding the contract method 0x7fc4606f. +// +// Solidity: function rebondWithHint(uint256 _unbondingLockId, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) RebondWithHint(_unbondingLockId *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RebondWithHint(&_BondingManager.TransactOpts, _unbondingLockId, _newPosPrev, _newPosNext) +} + // Reward is a paid mutator transaction binding the contract method 0x228cb733. // // Solidity: function reward() returns() @@ -1061,25 +1094,25 @@ func (_BondingManager *BondingManagerTransactorSession) Reward() (*types.Transac return _BondingManager.Contract.Reward(&_BondingManager.TransactOpts) } -// SetActiveTranscoders is a paid mutator transaction binding the contract method 0x242ed69f. +// RewardWithHint is a paid mutator transaction binding the contract method 0x81871056. // -// Solidity: function setActiveTranscoders() returns() -func (_BondingManager *BondingManagerTransactor) SetActiveTranscoders(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BondingManager.contract.Transact(opts, "setActiveTranscoders") +// Solidity: function rewardWithHint(address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactor) RewardWithHint(opts *bind.TransactOpts, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "rewardWithHint", _newPosPrev, _newPosNext) } -// SetActiveTranscoders is a paid mutator transaction binding the contract method 0x242ed69f. +// RewardWithHint is a paid mutator transaction binding the contract method 0x81871056. // -// Solidity: function setActiveTranscoders() returns() -func (_BondingManager *BondingManagerSession) SetActiveTranscoders() (*types.Transaction, error) { - return _BondingManager.Contract.SetActiveTranscoders(&_BondingManager.TransactOpts) +// Solidity: function rewardWithHint(address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerSession) RewardWithHint(_newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RewardWithHint(&_BondingManager.TransactOpts, _newPosPrev, _newPosNext) } -// SetActiveTranscoders is a paid mutator transaction binding the contract method 0x242ed69f. +// RewardWithHint is a paid mutator transaction binding the contract method 0x81871056. // -// Solidity: function setActiveTranscoders() returns() -func (_BondingManager *BondingManagerTransactorSession) SetActiveTranscoders() (*types.Transaction, error) { - return _BondingManager.Contract.SetActiveTranscoders(&_BondingManager.TransactOpts) +// Solidity: function rewardWithHint(address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) RewardWithHint(_newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.RewardWithHint(&_BondingManager.TransactOpts, _newPosPrev, _newPosNext) } // SetController is a paid mutator transaction binding the contract method 0x92eefe9b. @@ -1103,6 +1136,27 @@ func (_BondingManager *BondingManagerTransactorSession) SetController(_controlle return _BondingManager.Contract.SetController(&_BondingManager.TransactOpts, _controller) } +// SetCurrentRoundTotalActiveStake is a paid mutator transaction binding the contract method 0x713f2216. +// +// Solidity: function setCurrentRoundTotalActiveStake() returns() +func (_BondingManager *BondingManagerTransactor) SetCurrentRoundTotalActiveStake(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "setCurrentRoundTotalActiveStake") +} + +// SetCurrentRoundTotalActiveStake is a paid mutator transaction binding the contract method 0x713f2216. +// +// Solidity: function setCurrentRoundTotalActiveStake() returns() +func (_BondingManager *BondingManagerSession) SetCurrentRoundTotalActiveStake() (*types.Transaction, error) { + return _BondingManager.Contract.SetCurrentRoundTotalActiveStake(&_BondingManager.TransactOpts) +} + +// SetCurrentRoundTotalActiveStake is a paid mutator transaction binding the contract method 0x713f2216. +// +// Solidity: function setCurrentRoundTotalActiveStake() returns() +func (_BondingManager *BondingManagerTransactorSession) SetCurrentRoundTotalActiveStake() (*types.Transaction, error) { + return _BondingManager.Contract.SetCurrentRoundTotalActiveStake(&_BondingManager.TransactOpts) +} + // SetMaxEarningsClaimsRounds is a paid mutator transaction binding the contract method 0x72d9f13d. // // Solidity: function setMaxEarningsClaimsRounds(uint256 _maxEarningsClaimsRounds) returns() @@ -1145,27 +1199,6 @@ func (_BondingManager *BondingManagerTransactorSession) SetNumActiveTranscoders( return _BondingManager.Contract.SetNumActiveTranscoders(&_BondingManager.TransactOpts, _numActiveTranscoders) } -// SetNumTranscoders is a paid mutator transaction binding the contract method 0x60c79d00. -// -// 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(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(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(uint64 _unbondingPeriod) returns() @@ -1208,25 +1241,46 @@ func (_BondingManager *BondingManagerTransactorSession) SlashTranscoder(_transco return _BondingManager.Contract.SlashTranscoder(&_BondingManager.TransactOpts, _transcoder, _finder, _slashAmount, _finderFee) } -// Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. +// Transcoder is a paid mutator transaction binding the contract method 0x43d3461a. // -// 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) +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare) returns() +func (_BondingManager *BondingManagerTransactor) Transcoder(opts *bind.TransactOpts, _rewardCut *big.Int, _feeShare *big.Int) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "transcoder", _rewardCut, _feeShare) } -// Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. +// Transcoder is a paid mutator transaction binding the contract method 0x43d3461a. // -// 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) +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare) returns() +func (_BondingManager *BondingManagerSession) Transcoder(_rewardCut *big.Int, _feeShare *big.Int) (*types.Transaction, error) { + return _BondingManager.Contract.Transcoder(&_BondingManager.TransactOpts, _rewardCut, _feeShare) } -// Transcoder is a paid mutator transaction binding the contract method 0x85aaff62. +// Transcoder is a paid mutator transaction binding the contract method 0x43d3461a. // -// 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) +// Solidity: function transcoder(uint256 _rewardCut, uint256 _feeShare) returns() +func (_BondingManager *BondingManagerTransactorSession) Transcoder(_rewardCut *big.Int, _feeShare *big.Int) (*types.Transaction, error) { + return _BondingManager.Contract.Transcoder(&_BondingManager.TransactOpts, _rewardCut, _feeShare) +} + +// TranscoderWithHint is a paid mutator transaction binding the contract method 0x3550aa10. +// +// Solidity: function transcoderWithHint(uint256 _rewardCut, uint256 _feeShare, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactor) TranscoderWithHint(opts *bind.TransactOpts, _rewardCut *big.Int, _feeShare *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "transcoderWithHint", _rewardCut, _feeShare, _newPosPrev, _newPosNext) +} + +// TranscoderWithHint is a paid mutator transaction binding the contract method 0x3550aa10. +// +// Solidity: function transcoderWithHint(uint256 _rewardCut, uint256 _feeShare, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerSession) TranscoderWithHint(_rewardCut *big.Int, _feeShare *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.TranscoderWithHint(&_BondingManager.TransactOpts, _rewardCut, _feeShare, _newPosPrev, _newPosNext) +} + +// TranscoderWithHint is a paid mutator transaction binding the contract method 0x3550aa10. +// +// Solidity: function transcoderWithHint(uint256 _rewardCut, uint256 _feeShare, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) TranscoderWithHint(_rewardCut *big.Int, _feeShare *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.TranscoderWithHint(&_BondingManager.TransactOpts, _rewardCut, _feeShare, _newPosPrev, _newPosNext) } // Unbond is a paid mutator transaction binding the contract method 0x27de9e32. @@ -1250,6 +1304,27 @@ func (_BondingManager *BondingManagerTransactorSession) Unbond(_amount *big.Int) return _BondingManager.Contract.Unbond(&_BondingManager.TransactOpts, _amount) } +// UnbondWithHint is a paid mutator transaction binding the contract method 0x9500ed9b. +// +// Solidity: function unbondWithHint(uint256 _amount, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactor) UnbondWithHint(opts *bind.TransactOpts, _amount *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.contract.Transact(opts, "unbondWithHint", _amount, _newPosPrev, _newPosNext) +} + +// UnbondWithHint is a paid mutator transaction binding the contract method 0x9500ed9b. +// +// Solidity: function unbondWithHint(uint256 _amount, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerSession) UnbondWithHint(_amount *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.UnbondWithHint(&_BondingManager.TransactOpts, _amount, _newPosPrev, _newPosNext) +} + +// UnbondWithHint is a paid mutator transaction binding the contract method 0x9500ed9b. +// +// Solidity: function unbondWithHint(uint256 _amount, address _newPosPrev, address _newPosNext) returns() +func (_BondingManager *BondingManagerTransactorSession) UnbondWithHint(_amount *big.Int, _newPosPrev common.Address, _newPosNext common.Address) (*types.Transaction, error) { + return _BondingManager.Contract.UnbondWithHint(&_BondingManager.TransactOpts, _amount, _newPosPrev, _newPosNext) +} + // UpdateTranscoderWithFees is a paid mutator transaction binding the contract method 0x3aeb512c. // // Solidity: function updateTranscoderWithFees(address _transcoder, uint256 _fees, uint256 _round) returns() @@ -1465,6 +1540,173 @@ func (_BondingManager *BondingManagerFilterer) WatchBond(opts *bind.WatchOpts, s }), nil } +// ParseBond is a log parse operation binding the contract event 0xe5917769f276ddca9f2ee7c6b0b33e1d1e1b61008010ce622c632dd20d168a23. +// +// Solidity: event Bond(address indexed newDelegate, address indexed oldDelegate, address indexed delegator, uint256 additionalAmount, uint256 bondedAmount) +func (_BondingManager *BondingManagerFilterer) ParseBond(log types.Log) (*BondingManagerBond, error) { + event := new(BondingManagerBond) + if err := _BondingManager.contract.UnpackLog(event, "Bond", log); err != nil { + return nil, err + } + return event, nil +} + +// BondingManagerEarningsClaimedIterator is returned from FilterEarningsClaimed and is used to iterate over the raw logs and unpacked data for EarningsClaimed events raised by the BondingManager contract. +type BondingManagerEarningsClaimedIterator struct { + Event *BondingManagerEarningsClaimed // 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 *BondingManagerEarningsClaimedIterator) 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(BondingManagerEarningsClaimed) + 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(BondingManagerEarningsClaimed) + 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 *BondingManagerEarningsClaimedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BondingManagerEarningsClaimedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BondingManagerEarningsClaimed represents a EarningsClaimed event raised by the BondingManager contract. +type BondingManagerEarningsClaimed struct { + Delegate common.Address + Delegator common.Address + Rewards *big.Int + Fees *big.Int + StartRound *big.Int + EndRound *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEarningsClaimed is a free log retrieval operation binding the contract event 0xd7eab0765b772ea6ea859d5633baf737502198012e930f257f90013d9b211094. +// +// Solidity: event EarningsClaimed(address indexed delegate, address indexed delegator, uint256 rewards, uint256 fees, uint256 startRound, uint256 endRound) +func (_BondingManager *BondingManagerFilterer) FilterEarningsClaimed(opts *bind.FilterOpts, delegate []common.Address, delegator []common.Address) (*BondingManagerEarningsClaimedIterator, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + + logs, sub, err := _BondingManager.contract.FilterLogs(opts, "EarningsClaimed", delegateRule, delegatorRule) + if err != nil { + return nil, err + } + return &BondingManagerEarningsClaimedIterator{contract: _BondingManager.contract, event: "EarningsClaimed", logs: logs, sub: sub}, nil +} + +// WatchEarningsClaimed is a free log subscription operation binding the contract event 0xd7eab0765b772ea6ea859d5633baf737502198012e930f257f90013d9b211094. +// +// Solidity: event EarningsClaimed(address indexed delegate, address indexed delegator, uint256 rewards, uint256 fees, uint256 startRound, uint256 endRound) +func (_BondingManager *BondingManagerFilterer) WatchEarningsClaimed(opts *bind.WatchOpts, sink chan<- *BondingManagerEarningsClaimed, delegate []common.Address, delegator []common.Address) (event.Subscription, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + + logs, sub, err := _BondingManager.contract.WatchLogs(opts, "EarningsClaimed", delegateRule, delegatorRule) + 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(BondingManagerEarningsClaimed) + if err := _BondingManager.contract.UnpackLog(event, "EarningsClaimed", 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 +} + +// ParseEarningsClaimed is a log parse operation binding the contract event 0xd7eab0765b772ea6ea859d5633baf737502198012e930f257f90013d9b211094. +// +// Solidity: event EarningsClaimed(address indexed delegate, address indexed delegator, uint256 rewards, uint256 fees, uint256 startRound, uint256 endRound) +func (_BondingManager *BondingManagerFilterer) ParseEarningsClaimed(log types.Log) (*BondingManagerEarningsClaimed, error) { + event := new(BondingManagerEarningsClaimed) + if err := _BondingManager.contract.UnpackLog(event, "EarningsClaimed", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the BondingManager contract. type BondingManagerParameterUpdateIterator struct { Event *BondingManagerParameterUpdate // Event containing the contract specifics and raw log @@ -1587,6 +1829,17 @@ func (_BondingManager *BondingManagerFilterer) WatchParameterUpdate(opts *bind.W }), nil } +// ParseParameterUpdate is a log parse operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_BondingManager *BondingManagerFilterer) ParseParameterUpdate(log types.Log) (*BondingManagerParameterUpdate, error) { + event := new(BondingManagerParameterUpdate) + if err := _BondingManager.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerRebondIterator is returned from FilterRebond and is used to iterate over the raw logs and unpacked data for Rebond events raised by the BondingManager contract. type BondingManagerRebondIterator struct { Event *BondingManagerRebond // Event containing the contract specifics and raw log @@ -1730,6 +1983,17 @@ func (_BondingManager *BondingManagerFilterer) WatchRebond(opts *bind.WatchOpts, }), nil } +// ParseRebond is a log parse operation binding the contract event 0x9f5b64cc71e1e26ff178caaa7877a04d8ce66fde989251870e80e6fbee690c17. +// +// Solidity: event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount) +func (_BondingManager *BondingManagerFilterer) ParseRebond(log types.Log) (*BondingManagerRebond, error) { + event := new(BondingManagerRebond) + if err := _BondingManager.contract.UnpackLog(event, "Rebond", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerRewardIterator is returned from FilterReward and is used to iterate over the raw logs and unpacked data for Reward events raised by the BondingManager contract. type BondingManagerRewardIterator struct { Event *BondingManagerReward // Event containing the contract specifics and raw log @@ -1863,6 +2127,17 @@ func (_BondingManager *BondingManagerFilterer) WatchReward(opts *bind.WatchOpts, }), nil } +// ParseReward is a log parse operation binding the contract event 0x619caafabdd75649b302ba8419e48cccf64f37f1983ac4727cfb38b57703ffc9. +// +// Solidity: event Reward(address indexed transcoder, uint256 amount) +func (_BondingManager *BondingManagerFilterer) ParseReward(log types.Log) (*BondingManagerReward, error) { + event := new(BondingManagerReward) + if err := _BondingManager.contract.UnpackLog(event, "Reward", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the BondingManager contract. type BondingManagerSetControllerIterator struct { Event *BondingManagerSetController // Event containing the contract specifics and raw log @@ -1985,9 +2260,20 @@ func (_BondingManager *BondingManagerFilterer) WatchSetController(opts *bind.Wat }), nil } -// BondingManagerTranscoderEvictedIterator is returned from FilterTranscoderEvicted and is used to iterate over the raw logs and unpacked data for TranscoderEvicted events raised by the BondingManager contract. -type BondingManagerTranscoderEvictedIterator struct { - Event *BondingManagerTranscoderEvicted // Event containing the contract specifics and raw log +// ParseSetController is a log parse operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_BondingManager *BondingManagerFilterer) ParseSetController(log types.Log) (*BondingManagerSetController, error) { + event := new(BondingManagerSetController) + if err := _BondingManager.contract.UnpackLog(event, "SetController", log); err != nil { + return nil, err + } + return event, nil +} + +// BondingManagerTranscoderActivatedIterator is returned from FilterTranscoderActivated and is used to iterate over the raw logs and unpacked data for TranscoderActivated events raised by the BondingManager contract. +type BondingManagerTranscoderActivatedIterator struct { + Event *BondingManagerTranscoderActivated // 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 @@ -2001,7 +2287,7 @@ type BondingManagerTranscoderEvictedIterator struct { // 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 *BondingManagerTranscoderEvictedIterator) Next() bool { +func (it *BondingManagerTranscoderActivatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2010,7 +2296,7 @@ func (it *BondingManagerTranscoderEvictedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BondingManagerTranscoderEvicted) + it.Event = new(BondingManagerTranscoderActivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2025,7 +2311,7 @@ func (it *BondingManagerTranscoderEvictedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BondingManagerTranscoderEvicted) + it.Event = new(BondingManagerTranscoderActivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2041,51 +2327,52 @@ func (it *BondingManagerTranscoderEvictedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BondingManagerTranscoderEvictedIterator) Error() error { +func (it *BondingManagerTranscoderActivatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BondingManagerTranscoderEvictedIterator) Close() error { +func (it *BondingManagerTranscoderActivatedIterator) Close() error { it.sub.Unsubscribe() return nil } -// BondingManagerTranscoderEvicted represents a TranscoderEvicted event raised by the BondingManager contract. -type BondingManagerTranscoderEvicted struct { - Transcoder common.Address - Raw types.Log // Blockchain specific contextual infos +// BondingManagerTranscoderActivated represents a TranscoderActivated event raised by the BondingManager contract. +type BondingManagerTranscoderActivated struct { + Transcoder common.Address + ActivationRound *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterTranscoderEvicted is a free log retrieval operation binding the contract event 0x0005588101bf85a737dacb8be2233b33113aaa5c5743525cfbfe2f6a77c2f6ff. +// FilterTranscoderActivated is a free log retrieval operation binding the contract event 0x65d72d782835d64c3287844a829608d5abdc7e864cc9affe96d910ab3db665e9. // -// Solidity: event TranscoderEvicted(address indexed transcoder) -func (_BondingManager *BondingManagerFilterer) FilterTranscoderEvicted(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderEvictedIterator, error) { +// Solidity: event TranscoderActivated(address indexed transcoder, uint256 activationRound) +func (_BondingManager *BondingManagerFilterer) FilterTranscoderActivated(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderActivatedIterator, error) { var transcoderRule []interface{} for _, transcoderItem := range transcoder { transcoderRule = append(transcoderRule, transcoderItem) } - logs, sub, err := _BondingManager.contract.FilterLogs(opts, "TranscoderEvicted", transcoderRule) + logs, sub, err := _BondingManager.contract.FilterLogs(opts, "TranscoderActivated", transcoderRule) if err != nil { return nil, err } - return &BondingManagerTranscoderEvictedIterator{contract: _BondingManager.contract, event: "TranscoderEvicted", logs: logs, sub: sub}, nil + return &BondingManagerTranscoderActivatedIterator{contract: _BondingManager.contract, event: "TranscoderActivated", logs: logs, sub: sub}, nil } -// WatchTranscoderEvicted is a free log subscription operation binding the contract event 0x0005588101bf85a737dacb8be2233b33113aaa5c5743525cfbfe2f6a77c2f6ff. +// WatchTranscoderActivated is a free log subscription operation binding the contract event 0x65d72d782835d64c3287844a829608d5abdc7e864cc9affe96d910ab3db665e9. // -// Solidity: event TranscoderEvicted(address indexed transcoder) -func (_BondingManager *BondingManagerFilterer) WatchTranscoderEvicted(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderEvicted, transcoder []common.Address) (event.Subscription, error) { +// Solidity: event TranscoderActivated(address indexed transcoder, uint256 activationRound) +func (_BondingManager *BondingManagerFilterer) WatchTranscoderActivated(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderActivated, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} for _, transcoderItem := range transcoder { transcoderRule = append(transcoderRule, transcoderItem) } - logs, sub, err := _BondingManager.contract.WatchLogs(opts, "TranscoderEvicted", transcoderRule) + logs, sub, err := _BondingManager.contract.WatchLogs(opts, "TranscoderActivated", transcoderRule) if err != nil { return nil, err } @@ -2095,8 +2382,8 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderEvicted(opts *bind select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BondingManagerTranscoderEvicted) - if err := _BondingManager.contract.UnpackLog(event, "TranscoderEvicted", log); err != nil { + event := new(BondingManagerTranscoderActivated) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderActivated", log); err != nil { return err } event.Raw = log @@ -2117,9 +2404,20 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderEvicted(opts *bind }), nil } -// BondingManagerTranscoderResignedIterator is returned from FilterTranscoderResigned and is used to iterate over the raw logs and unpacked data for TranscoderResigned events raised by the BondingManager contract. -type BondingManagerTranscoderResignedIterator struct { - Event *BondingManagerTranscoderResigned // Event containing the contract specifics and raw log +// ParseTranscoderActivated is a log parse operation binding the contract event 0x65d72d782835d64c3287844a829608d5abdc7e864cc9affe96d910ab3db665e9. +// +// Solidity: event TranscoderActivated(address indexed transcoder, uint256 activationRound) +func (_BondingManager *BondingManagerFilterer) ParseTranscoderActivated(log types.Log) (*BondingManagerTranscoderActivated, error) { + event := new(BondingManagerTranscoderActivated) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderActivated", log); err != nil { + return nil, err + } + return event, nil +} + +// BondingManagerTranscoderDeactivatedIterator is returned from FilterTranscoderDeactivated and is used to iterate over the raw logs and unpacked data for TranscoderDeactivated events raised by the BondingManager contract. +type BondingManagerTranscoderDeactivatedIterator struct { + Event *BondingManagerTranscoderDeactivated // 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 @@ -2133,7 +2431,7 @@ type BondingManagerTranscoderResignedIterator struct { // 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 *BondingManagerTranscoderResignedIterator) Next() bool { +func (it *BondingManagerTranscoderDeactivatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2142,7 +2440,7 @@ func (it *BondingManagerTranscoderResignedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BondingManagerTranscoderResigned) + it.Event = new(BondingManagerTranscoderDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2157,7 +2455,7 @@ func (it *BondingManagerTranscoderResignedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BondingManagerTranscoderResigned) + it.Event = new(BondingManagerTranscoderDeactivated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2173,51 +2471,52 @@ func (it *BondingManagerTranscoderResignedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BondingManagerTranscoderResignedIterator) Error() error { +func (it *BondingManagerTranscoderDeactivatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BondingManagerTranscoderResignedIterator) Close() error { +func (it *BondingManagerTranscoderDeactivatedIterator) Close() error { it.sub.Unsubscribe() return nil } -// BondingManagerTranscoderResigned represents a TranscoderResigned event raised by the BondingManager contract. -type BondingManagerTranscoderResigned struct { - Transcoder common.Address - Raw types.Log // Blockchain specific contextual infos +// BondingManagerTranscoderDeactivated represents a TranscoderDeactivated event raised by the BondingManager contract. +type BondingManagerTranscoderDeactivated struct { + Transcoder common.Address + DeactivationRound *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterTranscoderResigned is a free log retrieval operation binding the contract event 0xc6be59bdc33151833b6dbb6823a9bddecde3c685a1bf4d253d20b4a93fbae56c. +// FilterTranscoderDeactivated is a free log retrieval operation binding the contract event 0xfee3e693fc72d0a0a673805f3e606c551f4c677b9072444b90dd2d0406bc995c. // -// Solidity: event TranscoderResigned(address indexed transcoder) -func (_BondingManager *BondingManagerFilterer) FilterTranscoderResigned(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderResignedIterator, error) { +// Solidity: event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound) +func (_BondingManager *BondingManagerFilterer) FilterTranscoderDeactivated(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderDeactivatedIterator, error) { var transcoderRule []interface{} for _, transcoderItem := range transcoder { transcoderRule = append(transcoderRule, transcoderItem) } - logs, sub, err := _BondingManager.contract.FilterLogs(opts, "TranscoderResigned", transcoderRule) + logs, sub, err := _BondingManager.contract.FilterLogs(opts, "TranscoderDeactivated", transcoderRule) if err != nil { return nil, err } - return &BondingManagerTranscoderResignedIterator{contract: _BondingManager.contract, event: "TranscoderResigned", logs: logs, sub: sub}, nil + return &BondingManagerTranscoderDeactivatedIterator{contract: _BondingManager.contract, event: "TranscoderDeactivated", logs: logs, sub: sub}, nil } -// WatchTranscoderResigned is a free log subscription operation binding the contract event 0xc6be59bdc33151833b6dbb6823a9bddecde3c685a1bf4d253d20b4a93fbae56c. +// WatchTranscoderDeactivated is a free log subscription operation binding the contract event 0xfee3e693fc72d0a0a673805f3e606c551f4c677b9072444b90dd2d0406bc995c. // -// Solidity: event TranscoderResigned(address indexed transcoder) -func (_BondingManager *BondingManagerFilterer) WatchTranscoderResigned(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderResigned, transcoder []common.Address) (event.Subscription, error) { +// Solidity: event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound) +func (_BondingManager *BondingManagerFilterer) WatchTranscoderDeactivated(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderDeactivated, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} for _, transcoderItem := range transcoder { transcoderRule = append(transcoderRule, transcoderItem) } - logs, sub, err := _BondingManager.contract.WatchLogs(opts, "TranscoderResigned", transcoderRule) + logs, sub, err := _BondingManager.contract.WatchLogs(opts, "TranscoderDeactivated", transcoderRule) if err != nil { return nil, err } @@ -2227,8 +2526,8 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderResigned(opts *bin select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BondingManagerTranscoderResigned) - if err := _BondingManager.contract.UnpackLog(event, "TranscoderResigned", log); err != nil { + event := new(BondingManagerTranscoderDeactivated) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderDeactivated", log); err != nil { return err } event.Raw = log @@ -2249,6 +2548,17 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderResigned(opts *bin }), nil } +// ParseTranscoderDeactivated is a log parse operation binding the contract event 0xfee3e693fc72d0a0a673805f3e606c551f4c677b9072444b90dd2d0406bc995c. +// +// Solidity: event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound) +func (_BondingManager *BondingManagerFilterer) ParseTranscoderDeactivated(log types.Log) (*BondingManagerTranscoderDeactivated, error) { + event := new(BondingManagerTranscoderDeactivated) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderDeactivated", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerTranscoderSlashedIterator is returned from FilterTranscoderSlashed and is used to iterate over the raw logs and unpacked data for TranscoderSlashed events raised by the BondingManager contract. type BondingManagerTranscoderSlashedIterator struct { Event *BondingManagerTranscoderSlashed // Event containing the contract specifics and raw log @@ -2384,6 +2694,17 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderSlashed(opts *bind }), nil } +// ParseTranscoderSlashed is a log parse operation binding the contract event 0xf4b71fed8e2c9a8c67c388bc6d35ad20b9368a24eed6d565459f2b277b6c0c22. +// +// Solidity: event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward) +func (_BondingManager *BondingManagerFilterer) ParseTranscoderSlashed(log types.Log) (*BondingManagerTranscoderSlashed, error) { + event := new(BondingManagerTranscoderSlashed) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderSlashed", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerTranscoderUpdateIterator is returned from FilterTranscoderUpdate and is used to iterate over the raw logs and unpacked data for TranscoderUpdate events raised by the BondingManager contract. type BondingManagerTranscoderUpdateIterator struct { Event *BondingManagerTranscoderUpdate // Event containing the contract specifics and raw log @@ -2453,17 +2774,15 @@ func (it *BondingManagerTranscoderUpdateIterator) Close() error { // BondingManagerTranscoderUpdate represents a TranscoderUpdate event raised by the BondingManager contract. type BondingManagerTranscoderUpdate struct { - Transcoder common.Address - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int - Registered bool - Raw types.Log // Blockchain specific contextual infos + Transcoder common.Address + RewardCut *big.Int + FeeShare *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterTranscoderUpdate is a free log retrieval operation binding the contract event 0xe01026d5db477d9ceaec44dc8efd731e76bcbc51256aecba7d28dd1cb4968be7. +// FilterTranscoderUpdate is a free log retrieval operation binding the contract event 0x7346854431dbb3eb8e373c604abf89e90f4865b8447e1e2834d7b3e4677bf544. // -// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered) +// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare) func (_BondingManager *BondingManagerFilterer) FilterTranscoderUpdate(opts *bind.FilterOpts, transcoder []common.Address) (*BondingManagerTranscoderUpdateIterator, error) { var transcoderRule []interface{} @@ -2478,9 +2797,9 @@ func (_BondingManager *BondingManagerFilterer) FilterTranscoderUpdate(opts *bind return &BondingManagerTranscoderUpdateIterator{contract: _BondingManager.contract, event: "TranscoderUpdate", logs: logs, sub: sub}, nil } -// WatchTranscoderUpdate is a free log subscription operation binding the contract event 0xe01026d5db477d9ceaec44dc8efd731e76bcbc51256aecba7d28dd1cb4968be7. +// WatchTranscoderUpdate is a free log subscription operation binding the contract event 0x7346854431dbb3eb8e373c604abf89e90f4865b8447e1e2834d7b3e4677bf544. // -// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered) +// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare) func (_BondingManager *BondingManagerFilterer) WatchTranscoderUpdate(opts *bind.WatchOpts, sink chan<- *BondingManagerTranscoderUpdate, transcoder []common.Address) (event.Subscription, error) { var transcoderRule []interface{} @@ -2520,6 +2839,17 @@ func (_BondingManager *BondingManagerFilterer) WatchTranscoderUpdate(opts *bind. }), nil } +// ParseTranscoderUpdate is a log parse operation binding the contract event 0x7346854431dbb3eb8e373c604abf89e90f4865b8447e1e2834d7b3e4677bf544. +// +// Solidity: event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare) +func (_BondingManager *BondingManagerFilterer) ParseTranscoderUpdate(log types.Log) (*BondingManagerTranscoderUpdate, error) { + event := new(BondingManagerTranscoderUpdate) + if err := _BondingManager.contract.UnpackLog(event, "TranscoderUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerUnbondIterator is returned from FilterUnbond and is used to iterate over the raw logs and unpacked data for Unbond events raised by the BondingManager contract. type BondingManagerUnbondIterator struct { Event *BondingManagerUnbond // Event containing the contract specifics and raw log @@ -2664,6 +2994,17 @@ func (_BondingManager *BondingManagerFilterer) WatchUnbond(opts *bind.WatchOpts, }), nil } +// ParseUnbond is a log parse operation binding the contract event 0x2d5d98d189bee5496a08db2a5948cb7e5e786f09d17d0c3f228eb41776c24a06. +// +// Solidity: event Unbond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) +func (_BondingManager *BondingManagerFilterer) ParseUnbond(log types.Log) (*BondingManagerUnbond, error) { + event := new(BondingManagerUnbond) + if err := _BondingManager.contract.UnpackLog(event, "Unbond", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerWithdrawFeesIterator is returned from FilterWithdrawFees and is used to iterate over the raw logs and unpacked data for WithdrawFees events raised by the BondingManager contract. type BondingManagerWithdrawFeesIterator struct { Event *BondingManagerWithdrawFees // Event containing the contract specifics and raw log @@ -2796,6 +3137,17 @@ func (_BondingManager *BondingManagerFilterer) WatchWithdrawFees(opts *bind.Watc }), nil } +// ParseWithdrawFees is a log parse operation binding the contract event 0xd3719f04262b628e1d01a6ed24707f542cda51f144b5271149c7d0419436d00c. +// +// Solidity: event WithdrawFees(address indexed delegator) +func (_BondingManager *BondingManagerFilterer) ParseWithdrawFees(log types.Log) (*BondingManagerWithdrawFees, error) { + event := new(BondingManagerWithdrawFees) + if err := _BondingManager.contract.UnpackLog(event, "WithdrawFees", log); err != nil { + return nil, err + } + return event, nil +} + // BondingManagerWithdrawStakeIterator is returned from FilterWithdrawStake and is used to iterate over the raw logs and unpacked data for WithdrawStake events raised by the BondingManager contract. type BondingManagerWithdrawStakeIterator struct { Event *BondingManagerWithdrawStake // Event containing the contract specifics and raw log @@ -2930,3 +3282,14 @@ func (_BondingManager *BondingManagerFilterer) WatchWithdrawStake(opts *bind.Wat } }), nil } + +// ParseWithdrawStake is a log parse operation binding the contract event 0x1340f1a8f3d456a649e1a12071dfa15655e3d09252131d0f980c3b405cc8dd2e. +// +// Solidity: event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound) +func (_BondingManager *BondingManagerFilterer) ParseWithdrawStake(log types.Log) (*BondingManagerWithdrawStake, error) { + event := new(BondingManagerWithdrawStake) + if err := _BondingManager.contract.UnpackLog(event, "WithdrawStake", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/controller.go b/eth/contracts/controller.go index f09721d314..b23abcb227 100644 --- a/eth/contracts/controller.go +++ b/eth/contracts/controller.go @@ -28,7 +28,7 @@ var ( ) // 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\"}]" +const ControllerABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"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\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"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,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes20\",\"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,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_contractAddress\",\"type\":\"address\"},{\"internalType\":\"bytes20\",\"name\":\"_gitCommitHash\",\"type\":\"bytes20\"}],\"name\":\"setContractInfo\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"updateController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"getContractInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes20\",\"name\":\"\",\"type\":\"bytes20\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_id\",\"type\":\"bytes32\"}],\"name\":\"getContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // Controller is an auto generated Go binding around an Ethereum contract. type Controller struct { @@ -526,6 +526,17 @@ func (_Controller *ControllerFilterer) WatchOwnershipTransferred(opts *bind.Watc }), nil } +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Controller *ControllerFilterer) ParseOwnershipTransferred(log types.Log) (*ControllerOwnershipTransferred, error) { + event := new(ControllerOwnershipTransferred) + if err := _Controller.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + return event, nil +} + // ControllerPauseIterator is returned from FilterPause and is used to iterate over the raw logs and unpacked data for Pause events raised by the Controller contract. type ControllerPauseIterator struct { Event *ControllerPause // Event containing the contract specifics and raw log @@ -647,6 +658,17 @@ func (_Controller *ControllerFilterer) WatchPause(opts *bind.WatchOpts, sink cha }), nil } +// ParsePause is a log parse operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625. +// +// Solidity: event Pause() +func (_Controller *ControllerFilterer) ParsePause(log types.Log) (*ControllerPause, error) { + event := new(ControllerPause) + if err := _Controller.contract.UnpackLog(event, "Pause", log); err != nil { + return nil, err + } + return event, nil +} + // ControllerSetContractInfoIterator is returned from FilterSetContractInfo and is used to iterate over the raw logs and unpacked data for SetContractInfo events raised by the Controller contract. type ControllerSetContractInfoIterator struct { Event *ControllerSetContractInfo // Event containing the contract specifics and raw log @@ -771,6 +793,17 @@ func (_Controller *ControllerFilterer) WatchSetContractInfo(opts *bind.WatchOpts }), nil } +// ParseSetContractInfo is a log parse operation binding the contract event 0xf9a6cf519167d81bc5cb3d26c60c0c9a19704aa908c148e82a861b570f4cd2d7. +// +// Solidity: event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash) +func (_Controller *ControllerFilterer) ParseSetContractInfo(log types.Log) (*ControllerSetContractInfo, error) { + event := new(ControllerSetContractInfo) + if err := _Controller.contract.UnpackLog(event, "SetContractInfo", log); err != nil { + return nil, err + } + return event, nil +} + // ControllerUnpauseIterator is returned from FilterUnpause and is used to iterate over the raw logs and unpacked data for Unpause events raised by the Controller contract. type ControllerUnpauseIterator struct { Event *ControllerUnpause // Event containing the contract specifics and raw log @@ -891,3 +924,14 @@ func (_Controller *ControllerFilterer) WatchUnpause(opts *bind.WatchOpts, sink c } }), nil } + +// ParseUnpause is a log parse operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33. +// +// Solidity: event Unpause() +func (_Controller *ControllerFilterer) ParseUnpause(log types.Log) (*ControllerUnpause, error) { + event := new(ControllerUnpause) + if err := _Controller.contract.UnpackLog(event, "Unpause", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/livepeerToken.go b/eth/contracts/livepeerToken.go index b471bbecde..320cb91067 100644 --- a/eth/contracts/livepeerToken.go +++ b/eth/contracts/livepeerToken.go @@ -28,7 +28,7 @@ var ( ) // 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\":\"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\"}]" +const LivepeerTokenABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"mintingFinished\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finishMinting\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"burner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MintFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}]" // LivepeerToken is an auto generated Go binding around an Ethereum contract. type LivepeerToken struct { @@ -200,28 +200,28 @@ func (_LivepeerToken *LivepeerTokenCallerSession) Allowance(owner common.Address // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// Solidity: function balanceOf(address owner) constant returns(uint256) -func (_LivepeerToken *LivepeerTokenCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCaller) BalanceOf(opts *bind.CallOpts, account 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", account) return *ret0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// 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) +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, account) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // -// 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) +// Solidity: function balanceOf(address account) constant returns(uint256) +func (_LivepeerToken *LivepeerTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _LivepeerToken.Contract.BalanceOf(&_LivepeerToken.CallOpts, account) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. @@ -534,44 +534,44 @@ func (_LivepeerToken *LivepeerTokenTransactorSession) Mint(_to common.Address, _ // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// 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) +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "transfer", recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// 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) +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // -// 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) +// Solidity: function transfer(address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.Transfer(&_LivepeerToken.TransactOpts, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// 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) +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.contract.Transact(opts, "transferFrom", sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// 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) +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // -// 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) +// Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) +func (_LivepeerToken *LivepeerTokenTransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { + return _LivepeerToken.Contract.TransferFrom(&_LivepeerToken.TransactOpts, sender, recipient, amount) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. @@ -737,6 +737,17 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchApproval(opts *bind.WatchOpts, }), nil } +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_LivepeerToken *LivepeerTokenFilterer) ParseApproval(log types.Log) (*LivepeerTokenApproval, error) { + event := new(LivepeerTokenApproval) + if err := _LivepeerToken.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the LivepeerToken contract. type LivepeerTokenBurnIterator struct { Event *LivepeerTokenBurn // Event containing the contract specifics and raw log @@ -870,6 +881,17 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchBurn(opts *bind.WatchOpts, sin }), nil } +// ParseBurn is a log parse operation binding the contract event 0xcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5. +// +// Solidity: event Burn(address indexed burner, uint256 value) +func (_LivepeerToken *LivepeerTokenFilterer) ParseBurn(log types.Log) (*LivepeerTokenBurn, error) { + event := new(LivepeerTokenBurn) + if err := _LivepeerToken.contract.UnpackLog(event, "Burn", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the LivepeerToken contract. type LivepeerTokenMintIterator struct { Event *LivepeerTokenMint // Event containing the contract specifics and raw log @@ -1003,6 +1025,17 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchMint(opts *bind.WatchOpts, sin }), nil } +// ParseMint is a log parse operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. +// +// Solidity: event Mint(address indexed to, uint256 amount) +func (_LivepeerToken *LivepeerTokenFilterer) ParseMint(log types.Log) (*LivepeerTokenMint, error) { + event := new(LivepeerTokenMint) + if err := _LivepeerToken.contract.UnpackLog(event, "Mint", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenMintFinishedIterator is returned from FilterMintFinished and is used to iterate over the raw logs and unpacked data for MintFinished events raised by the LivepeerToken contract. type LivepeerTokenMintFinishedIterator struct { Event *LivepeerTokenMintFinished // Event containing the contract specifics and raw log @@ -1124,6 +1157,17 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchMintFinished(opts *bind.WatchO }), nil } +// ParseMintFinished is a log parse operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. +// +// Solidity: event MintFinished() +func (_LivepeerToken *LivepeerTokenFilterer) ParseMintFinished(log types.Log) (*LivepeerTokenMintFinished, error) { + event := new(LivepeerTokenMintFinished) + if err := _LivepeerToken.contract.UnpackLog(event, "MintFinished", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the LivepeerToken contract. type LivepeerTokenOwnershipTransferredIterator struct { Event *LivepeerTokenOwnershipTransferred // Event containing the contract specifics and raw log @@ -1265,6 +1309,17 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchOwnershipTransferred(opts *bin }), nil } +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_LivepeerToken *LivepeerTokenFilterer) ParseOwnershipTransferred(log types.Log) (*LivepeerTokenOwnershipTransferred, error) { + event := new(LivepeerTokenOwnershipTransferred) + if err := _LivepeerToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the LivepeerToken contract. type LivepeerTokenTransferIterator struct { Event *LivepeerTokenTransfer // Event containing the contract specifics and raw log @@ -1406,3 +1461,14 @@ func (_LivepeerToken *LivepeerTokenFilterer) WatchTransfer(opts *bind.WatchOpts, } }), nil } + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_LivepeerToken *LivepeerTokenFilterer) ParseTransfer(log types.Log) (*LivepeerTokenTransfer, error) { + event := new(LivepeerTokenTransfer) + if err := _LivepeerToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/livepeerTokenFaucet.go b/eth/contracts/livepeerTokenFaucet.go index 47947a4fe9..80392d1b1b 100644 --- a/eth/contracts/livepeerTokenFaucet.go +++ b/eth/contracts/livepeerTokenFaucet.go @@ -28,7 +28,7 @@ var ( ) // 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\"}]" +const LivepeerTokenFaucetABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"requestWait\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nextValidRequest\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"requestAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contractILivepeerToken\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_requestAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_requestWait\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Request\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"addToWhitelist\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"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\"}]" // LivepeerTokenFaucet is an auto generated Go binding around an Ethereum contract. type LivepeerTokenFaucet struct { @@ -553,6 +553,17 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) WatchOwnershipTransferr }), nil } +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) ParseOwnershipTransferred(log types.Log) (*LivepeerTokenFaucetOwnershipTransferred, error) { + event := new(LivepeerTokenFaucetOwnershipTransferred) + if err := _LivepeerTokenFaucet.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + return event, nil +} + // LivepeerTokenFaucetRequestIterator is returned from FilterRequest and is used to iterate over the raw logs and unpacked data for Request events raised by the LivepeerTokenFaucet contract. type LivepeerTokenFaucetRequestIterator struct { Event *LivepeerTokenFaucetRequest // Event containing the contract specifics and raw log @@ -685,3 +696,14 @@ func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) WatchRequest(opts *bind } }), nil } + +// ParseRequest is a log parse operation binding the contract event 0xe31c60e37ab1301f69f01b436a1d13486e6c16cc22c888a08c0e64a39230b6ac. +// +// Solidity: event Request(address indexed to, uint256 amount) +func (_LivepeerTokenFaucet *LivepeerTokenFaucetFilterer) ParseRequest(log types.Log) (*LivepeerTokenFaucetRequest, error) { + event := new(LivepeerTokenFaucetRequest) + if err := _LivepeerTokenFaucet.contract.UnpackLog(event, "Request", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/livepeerVerifier.go b/eth/contracts/livepeerVerifier.go deleted file mode 100644 index 2e522b0fa3..0000000000 --- a/eth/contracts/livepeerVerifier.go +++ /dev/null @@ -1,1125 +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" -) - -// 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\":\"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 { - LivepeerVerifierCaller // Read-only binding to the contract - LivepeerVerifierTransactor // Write-only binding to the contract - LivepeerVerifierFilterer // Log filterer for contract events -} - -// LivepeerVerifierCaller is an auto generated read-only Go binding around an Ethereum contract. -type LivepeerVerifierCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LivepeerVerifierTransactor is an auto generated write-only Go binding around an Ethereum contract. -type LivepeerVerifierTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LivepeerVerifierFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type LivepeerVerifierFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LivepeerVerifierSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type LivepeerVerifierSession struct { - Contract *LivepeerVerifier // 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 -} - -// LivepeerVerifierCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type LivepeerVerifierCallerSession struct { - Contract *LivepeerVerifierCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// LivepeerVerifierTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type LivepeerVerifierTransactorSession struct { - Contract *LivepeerVerifierTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// LivepeerVerifierRaw is an auto generated low-level Go binding around an Ethereum contract. -type LivepeerVerifierRaw struct { - Contract *LivepeerVerifier // Generic contract binding to access the raw methods on -} - -// LivepeerVerifierCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type LivepeerVerifierCallerRaw struct { - Contract *LivepeerVerifierCaller // Generic read-only contract binding to access the raw methods on -} - -// LivepeerVerifierTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type LivepeerVerifierTransactorRaw struct { - Contract *LivepeerVerifierTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewLivepeerVerifier creates a new instance of LivepeerVerifier, bound to a specific deployed contract. -func NewLivepeerVerifier(address common.Address, backend bind.ContractBackend) (*LivepeerVerifier, error) { - contract, err := bindLivepeerVerifier(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &LivepeerVerifier{LivepeerVerifierCaller: LivepeerVerifierCaller{contract: contract}, LivepeerVerifierTransactor: LivepeerVerifierTransactor{contract: contract}, LivepeerVerifierFilterer: LivepeerVerifierFilterer{contract: contract}}, nil -} - -// NewLivepeerVerifierCaller creates a new read-only instance of LivepeerVerifier, bound to a specific deployed contract. -func NewLivepeerVerifierCaller(address common.Address, caller bind.ContractCaller) (*LivepeerVerifierCaller, error) { - contract, err := bindLivepeerVerifier(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &LivepeerVerifierCaller{contract: contract}, nil -} - -// NewLivepeerVerifierTransactor creates a new write-only instance of LivepeerVerifier, bound to a specific deployed contract. -func NewLivepeerVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*LivepeerVerifierTransactor, error) { - contract, err := bindLivepeerVerifier(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &LivepeerVerifierTransactor{contract: contract}, nil -} - -// NewLivepeerVerifierFilterer creates a new log filterer instance of LivepeerVerifier, bound to a specific deployed contract. -func NewLivepeerVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*LivepeerVerifierFilterer, error) { - contract, err := bindLivepeerVerifier(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &LivepeerVerifierFilterer{contract: contract}, nil -} - -// bindLivepeerVerifier binds a generic wrapper to an already deployed contract. -func bindLivepeerVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(LivepeerVerifierABI)) - 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 (_LivepeerVerifier *LivepeerVerifierRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LivepeerVerifier.Contract.LivepeerVerifierCaller.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 (_LivepeerVerifier *LivepeerVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LivepeerVerifier.Contract.LivepeerVerifierTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LivepeerVerifier *LivepeerVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LivepeerVerifier.Contract.LivepeerVerifierTransactor.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 (_LivepeerVerifier *LivepeerVerifierCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LivepeerVerifier.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 (_LivepeerVerifier *LivepeerVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LivepeerVerifier.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LivepeerVerifier *LivepeerVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LivepeerVerifier.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 (_LivepeerVerifier *LivepeerVerifierCaller) Controller(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _LivepeerVerifier.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 (_LivepeerVerifier *LivepeerVerifierSession) Controller() (common.Address, error) { - return _LivepeerVerifier.Contract.Controller(&_LivepeerVerifier.CallOpts) -} - -// Controller is a free data retrieval call binding the contract method 0xf77c4791. -// -// Solidity: function controller() constant returns(address) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) Controller() (common.Address, error) { - return _LivepeerVerifier.Contract.Controller(&_LivepeerVerifier.CallOpts) -} - -// GetPrice is a free data retrieval call binding the contract method 0x98d5fdca. -// -// Solidity: function getPrice() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierCaller) GetPrice(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _LivepeerVerifier.contract.Call(opts, out, "getPrice") - return *ret0, err -} - -// GetPrice is a free data retrieval call binding the contract method 0x98d5fdca. -// -// Solidity: function getPrice() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierSession) GetPrice() (*big.Int, error) { - return _LivepeerVerifier.Contract.GetPrice(&_LivepeerVerifier.CallOpts) -} - -// GetPrice is a free data retrieval call binding the contract method 0x98d5fdca. -// -// Solidity: function getPrice() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) GetPrice() (*big.Int, error) { - return _LivepeerVerifier.Contract.GetPrice(&_LivepeerVerifier.CallOpts) -} - -// RequestCount is a free data retrieval call binding the contract method 0x5badbe4c. -// -// Solidity: function requestCount() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierCaller) RequestCount(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _LivepeerVerifier.contract.Call(opts, out, "requestCount") - return *ret0, err -} - -// RequestCount is a free data retrieval call binding the contract method 0x5badbe4c. -// -// Solidity: function requestCount() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierSession) RequestCount() (*big.Int, error) { - return _LivepeerVerifier.Contract.RequestCount(&_LivepeerVerifier.CallOpts) -} - -// RequestCount is a free data retrieval call binding the contract method 0x5badbe4c. -// -// Solidity: function requestCount() constant returns(uint256) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) RequestCount() (*big.Int, error) { - return _LivepeerVerifier.Contract.RequestCount(&_LivepeerVerifier.CallOpts) -} - -// Requests is a free data retrieval call binding the contract method 0x81d12c58. -// -// 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 - SegmentNumber *big.Int - CommitHash [32]byte -}, error) { - ret := new(struct { - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - CommitHash [32]byte - }) - out := ret - err := _LivepeerVerifier.contract.Call(opts, out, "requests", arg0) - return *ret, err -} - -// Requests is a free data retrieval call binding the contract method 0x81d12c58. -// -// 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 - SegmentNumber *big.Int - CommitHash [32]byte -}, error) { - return _LivepeerVerifier.Contract.Requests(&_LivepeerVerifier.CallOpts, arg0) -} - -// Requests is a free data retrieval call binding the contract method 0x81d12c58. -// -// 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 - SegmentNumber *big.Int - CommitHash [32]byte -}, error) { - return _LivepeerVerifier.Contract.Requests(&_LivepeerVerifier.CallOpts, arg0) -} - -// Solver is a free data retrieval call binding the contract method 0x49a7a26d. -// -// 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, "solver") - return *ret0, err -} - -// Solver is a free data retrieval call binding the contract method 0x49a7a26d. -// -// Solidity: function solver() constant returns(address) -func (_LivepeerVerifier *LivepeerVerifierSession) Solver() (common.Address, error) { - return _LivepeerVerifier.Contract.Solver(&_LivepeerVerifier.CallOpts) -} - -// Solver is a free data retrieval call binding the contract method 0x49a7a26d. -// -// 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. -// -// Solidity: function verificationCodeHash() constant returns(string) -func (_LivepeerVerifier *LivepeerVerifierCaller) VerificationCodeHash(opts *bind.CallOpts) (string, error) { - var ( - ret0 = new(string) - ) - out := ret0 - err := _LivepeerVerifier.contract.Call(opts, out, "verificationCodeHash") - return *ret0, err -} - -// VerificationCodeHash is a free data retrieval call binding the contract method 0x41af1524. -// -// Solidity: function verificationCodeHash() constant returns(string) -func (_LivepeerVerifier *LivepeerVerifierSession) VerificationCodeHash() (string, error) { - return _LivepeerVerifier.Contract.VerificationCodeHash(&_LivepeerVerifier.CallOpts) -} - -// VerificationCodeHash is a free data retrieval call binding the contract method 0x41af1524. -// -// Solidity: function verificationCodeHash() constant returns(string) -func (_LivepeerVerifier *LivepeerVerifierCallerSession) VerificationCodeHash() (string, error) { - return _LivepeerVerifier.Contract.VerificationCodeHash(&_LivepeerVerifier.CallOpts) -} - -// Callback is a paid mutator transaction binding the contract method 0x9842a37c. -// -// 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(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(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) -} - -// SetController is a paid mutator transaction binding the contract method 0x92eefe9b. -// -// 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(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(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(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(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(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(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(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(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) -} - -// LivepeerVerifierCallbackIterator is returned from FilterCallback and is used to iterate over the raw logs and unpacked data for Callback events raised by the LivepeerVerifier contract. -type LivepeerVerifierCallbackIterator struct { - Event *LivepeerVerifierCallback // 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 *LivepeerVerifierCallbackIterator) 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(LivepeerVerifierCallback) - 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(LivepeerVerifierCallback) - 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 *LivepeerVerifierCallbackIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LivepeerVerifierCallbackIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LivepeerVerifierCallback represents a Callback event raised by the LivepeerVerifier contract. -type LivepeerVerifierCallback struct { - RequestId *big.Int - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - Result bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCallback is a free log retrieval operation binding the contract event 0xaa22eba262859195ec25c1d3c94f98248add6d1374bd46df08c78470225df8d3. -// -// 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{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - 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 := _LivepeerVerifier.contract.FilterLogs(opts, "Callback", requestIdRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &LivepeerVerifierCallbackIterator{contract: _LivepeerVerifier.contract, event: "Callback", logs: logs, sub: sub}, nil -} - -// WatchCallback is a free log subscription operation binding the contract event 0xaa22eba262859195ec25c1d3c94f98248add6d1374bd46df08c78470225df8d3. -// -// 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{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - 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 := _LivepeerVerifier.contract.WatchLogs(opts, "Callback", requestIdRule, 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(LivepeerVerifierCallback) - if err := _LivepeerVerifier.contract.UnpackLog(event, "Callback", 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 -} - -// LivepeerVerifierParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the LivepeerVerifier contract. -type LivepeerVerifierParameterUpdateIterator struct { - Event *LivepeerVerifierParameterUpdate // 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 *LivepeerVerifierParameterUpdateIterator) 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(LivepeerVerifierParameterUpdate) - 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(LivepeerVerifierParameterUpdate) - 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 *LivepeerVerifierParameterUpdateIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LivepeerVerifierParameterUpdateIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LivepeerVerifierParameterUpdate represents a ParameterUpdate event raised by the LivepeerVerifier contract. -type LivepeerVerifierParameterUpdate 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 (_LivepeerVerifier *LivepeerVerifierFilterer) FilterParameterUpdate(opts *bind.FilterOpts) (*LivepeerVerifierParameterUpdateIterator, error) { - - logs, sub, err := _LivepeerVerifier.contract.FilterLogs(opts, "ParameterUpdate") - if err != nil { - return nil, err - } - return &LivepeerVerifierParameterUpdateIterator{contract: _LivepeerVerifier.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 (_LivepeerVerifier *LivepeerVerifierFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierParameterUpdate) (event.Subscription, error) { - - logs, sub, err := _LivepeerVerifier.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(LivepeerVerifierParameterUpdate) - if err := _LivepeerVerifier.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 -} - -// LivepeerVerifierSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the LivepeerVerifier contract. -type LivepeerVerifierSetControllerIterator struct { - Event *LivepeerVerifierSetController // 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 *LivepeerVerifierSetControllerIterator) 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(LivepeerVerifierSetController) - 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(LivepeerVerifierSetController) - 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 *LivepeerVerifierSetControllerIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LivepeerVerifierSetControllerIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LivepeerVerifierSetController represents a SetController event raised by the LivepeerVerifier contract. -type LivepeerVerifierSetController 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 (_LivepeerVerifier *LivepeerVerifierFilterer) FilterSetController(opts *bind.FilterOpts) (*LivepeerVerifierSetControllerIterator, error) { - - logs, sub, err := _LivepeerVerifier.contract.FilterLogs(opts, "SetController") - if err != nil { - return nil, err - } - return &LivepeerVerifierSetControllerIterator{contract: _LivepeerVerifier.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 (_LivepeerVerifier *LivepeerVerifierFilterer) WatchSetController(opts *bind.WatchOpts, sink chan<- *LivepeerVerifierSetController) (event.Subscription, error) { - - logs, sub, err := _LivepeerVerifier.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(LivepeerVerifierSetController) - if err := _LivepeerVerifier.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 -} - -// 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 - - 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 *LivepeerVerifierVerifyRequestIterator) 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(LivepeerVerifierVerifyRequest) - 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(LivepeerVerifierVerifyRequest) - 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 *LivepeerVerifierVerifyRequestIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LivepeerVerifierVerifyRequestIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LivepeerVerifierVerifyRequest represents a VerifyRequest event raised by the LivepeerVerifier contract. -type LivepeerVerifierVerifyRequest struct { - RequestId *big.Int - JobId *big.Int - ClaimId *big.Int - SegmentNumber *big.Int - TranscodingOptions string - DataStorageHash string - DataHash [32]byte - TranscodedDataHash [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterVerifyRequest is a free log retrieval operation binding the contract event 0xf68da1a7e850796ae5473e78db07307108751eec3461dddf5ef610db7dfaaf56. -// -// 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{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - 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 := _LivepeerVerifier.contract.FilterLogs(opts, "VerifyRequest", requestIdRule, jobIdRule, claimIdRule) - if err != nil { - return nil, err - } - return &LivepeerVerifierVerifyRequestIterator{contract: _LivepeerVerifier.contract, event: "VerifyRequest", logs: logs, sub: sub}, nil -} - -// WatchVerifyRequest is a free log subscription operation binding the contract event 0xf68da1a7e850796ae5473e78db07307108751eec3461dddf5ef610db7dfaaf56. -// -// 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{} - for _, requestIdItem := range requestId { - requestIdRule = append(requestIdRule, requestIdItem) - } - 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 := _LivepeerVerifier.contract.WatchLogs(opts, "VerifyRequest", requestIdRule, 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(LivepeerVerifierVerifyRequest) - if err := _LivepeerVerifier.contract.UnpackLog(event, "VerifyRequest", 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/minter.go b/eth/contracts/minter.go index 390503dabc..55a9809e26 100644 --- a/eth/contracts/minter.go +++ b/eth/contracts/minter.go @@ -28,7 +28,7 @@ var ( ) // 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\":\"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\"}]" +const MinterABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"currentMintedTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetBondingRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentMintableTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflationChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inflation\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_inflation\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_inflationChange\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentMintableTokens\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentInflation\",\"type\":\"uint256\"}],\"name\":\"SetCurrentRewardTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_targetBondingRate\",\"type\":\"uint256\"}],\"name\":\"setTargetBondingRate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_inflationChange\",\"type\":\"uint256\"}],\"name\":\"setInflationChange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIMinter\",\"name\":\"_newMinter\",\"type\":\"address\"}],\"name\":\"migrateToNewMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_fracNum\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fracDenom\",\"type\":\"uint256\"}],\"name\":\"createReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedTransferTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedBurnTokens\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"trustedWithdrawETH\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositETH\",\"outputs\":[{\"internalType\":\"bool\",\"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\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // Minter is an auto generated Go binding around an Ethereum contract. type Minter struct { @@ -375,6 +375,27 @@ func (_Minter *MinterTransactorSession) CreateReward(_fracNum *big.Int, _fracDen 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(address _newMinter) returns() @@ -480,27 +501,6 @@ func (_Minter *MinterTransactorSession) SetTargetBondingRate(_targetBondingRate 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(uint256 _amount) returns() @@ -522,27 +522,6 @@ func (_Minter *MinterTransactorSession) TrustedBurnTokens(_amount *big.Int) (*ty 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(address _to, uint256 _amount) returns() @@ -707,6 +686,17 @@ func (_Minter *MinterFilterer) WatchParameterUpdate(opts *bind.WatchOpts, sink c }), nil } +// ParseParameterUpdate is a log parse operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_Minter *MinterFilterer) ParseParameterUpdate(log types.Log) (*MinterParameterUpdate, error) { + event := new(MinterParameterUpdate) + if err := _Minter.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // MinterSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the Minter contract. type MinterSetControllerIterator struct { Event *MinterSetController // Event containing the contract specifics and raw log @@ -829,6 +819,17 @@ func (_Minter *MinterFilterer) WatchSetController(opts *bind.WatchOpts, sink cha }), nil } +// ParseSetController is a log parse operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_Minter *MinterFilterer) ParseSetController(log types.Log) (*MinterSetController, error) { + event := new(MinterSetController) + if err := _Minter.contract.UnpackLog(event, "SetController", log); err != nil { + return nil, err + } + return event, nil +} + // MinterSetCurrentRewardTokensIterator is returned from FilterSetCurrentRewardTokens and is used to iterate over the raw logs and unpacked data for SetCurrentRewardTokens events raised by the Minter contract. type MinterSetCurrentRewardTokensIterator struct { Event *MinterSetCurrentRewardTokens // Event containing the contract specifics and raw log @@ -951,3 +952,14 @@ func (_Minter *MinterFilterer) WatchSetCurrentRewardTokens(opts *bind.WatchOpts, } }), nil } + +// ParseSetCurrentRewardTokens is a log parse operation binding the contract event 0x39567a366345edf17f50c1967a31b597745186c4632f34c4f8ebe06b6890784d. +// +// Solidity: event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation) +func (_Minter *MinterFilterer) ParseSetCurrentRewardTokens(log types.Log) (*MinterSetCurrentRewardTokens, error) { + event := new(MinterSetCurrentRewardTokens) + if err := _Minter.contract.UnpackLog(event, "SetCurrentRewardTokens", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/roundsManager.go b/eth/contracts/roundsManager.go index 576f8c4eda..8a22977313 100644 --- a/eth/contracts/roundsManager.go +++ b/eth/contracts/roundsManager.go @@ -28,7 +28,7 @@ var ( ) // 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\":true,\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"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\":\"_round\",\"type\":\"uint256\"}],\"name\":\"blockHashForRound\",\"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\"}]" +const RoundsManagerABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"lastRoundLengthUpdateRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lastRoundLengthUpdateStartBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lastInitializedRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"roundLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"roundLockAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"round\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"NewRound\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_roundLength\",\"type\":\"uint256\"}],\"name\":\"setRoundLength\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"blockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"blockHashForRound\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRound\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundStartBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentRoundLocked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // RoundsManager is an auto generated Go binding around an Ethereum contract. type RoundsManager struct { @@ -753,6 +753,17 @@ func (_RoundsManager *RoundsManagerFilterer) WatchNewRound(opts *bind.WatchOpts, }), nil } +// ParseNewRound is a log parse operation binding the contract event 0x22f2fc17c5daf07db2379b3a03a8ef20a183f761097a58fce219c8a14619e786. +// +// Solidity: event NewRound(uint256 indexed round, bytes32 blockHash) +func (_RoundsManager *RoundsManagerFilterer) ParseNewRound(log types.Log) (*RoundsManagerNewRound, error) { + event := new(RoundsManagerNewRound) + if err := _RoundsManager.contract.UnpackLog(event, "NewRound", log); err != nil { + return nil, err + } + return event, nil +} + // RoundsManagerParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the RoundsManager contract. type RoundsManagerParameterUpdateIterator struct { Event *RoundsManagerParameterUpdate // Event containing the contract specifics and raw log @@ -875,6 +886,17 @@ func (_RoundsManager *RoundsManagerFilterer) WatchParameterUpdate(opts *bind.Wat }), nil } +// ParseParameterUpdate is a log parse operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_RoundsManager *RoundsManagerFilterer) ParseParameterUpdate(log types.Log) (*RoundsManagerParameterUpdate, error) { + event := new(RoundsManagerParameterUpdate) + if err := _RoundsManager.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // RoundsManagerSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the RoundsManager contract. type RoundsManagerSetControllerIterator struct { Event *RoundsManagerSetController // Event containing the contract specifics and raw log @@ -996,3 +1018,14 @@ func (_RoundsManager *RoundsManagerFilterer) WatchSetController(opts *bind.Watch } }), nil } + +// ParseSetController is a log parse operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_RoundsManager *RoundsManagerFilterer) ParseSetController(log types.Log) (*RoundsManagerSetController, error) { + event := new(RoundsManagerSetController) + if err := _RoundsManager.contract.UnpackLog(event, "SetController", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/serviceRegistry.go b/eth/contracts/serviceRegistry.go index 30004c0d75..56d1f6ba72 100644 --- a/eth/contracts/serviceRegistry.go +++ b/eth/contracts/serviceRegistry.go @@ -28,7 +28,7 @@ var ( ) // ServiceRegistryABI is the input ABI used to generate the binding from. -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\"}]" +const ServiceRegistryABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"serviceURI\",\"type\":\"string\"}],\"name\":\"ServiceURIUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"string\",\"name\":\"_serviceURI\",\"type\":\"string\"}],\"name\":\"setServiceURI\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getServiceURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" // ServiceRegistry is an auto generated Go binding around an Ethereum contract. type ServiceRegistry struct { @@ -414,6 +414,17 @@ func (_ServiceRegistry *ServiceRegistryFilterer) WatchParameterUpdate(opts *bind }), nil } +// ParseParameterUpdate is a log parse operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_ServiceRegistry *ServiceRegistryFilterer) ParseParameterUpdate(log types.Log) (*ServiceRegistryParameterUpdate, error) { + event := new(ServiceRegistryParameterUpdate) + if err := _ServiceRegistry.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // ServiceRegistryServiceURIUpdateIterator is returned from FilterServiceURIUpdate and is used to iterate over the raw logs and unpacked data for ServiceURIUpdate events raised by the ServiceRegistry contract. type ServiceRegistryServiceURIUpdateIterator struct { Event *ServiceRegistryServiceURIUpdate // Event containing the contract specifics and raw log @@ -547,6 +558,17 @@ func (_ServiceRegistry *ServiceRegistryFilterer) WatchServiceURIUpdate(opts *bin }), nil } +// ParseServiceURIUpdate is a log parse operation binding the contract event 0xfbb63068732c85741c9f8e61caffaabe038d577bfafd2d2dcc0e352a4f653a4c. +// +// Solidity: event ServiceURIUpdate(address indexed addr, string serviceURI) +func (_ServiceRegistry *ServiceRegistryFilterer) ParseServiceURIUpdate(log types.Log) (*ServiceRegistryServiceURIUpdate, error) { + event := new(ServiceRegistryServiceURIUpdate) + if err := _ServiceRegistry.contract.UnpackLog(event, "ServiceURIUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // ServiceRegistrySetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the ServiceRegistry contract. type ServiceRegistrySetControllerIterator struct { Event *ServiceRegistrySetController // Event containing the contract specifics and raw log @@ -668,3 +690,14 @@ func (_ServiceRegistry *ServiceRegistryFilterer) WatchSetController(opts *bind.W } }), nil } + +// ParseSetController is a log parse operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_ServiceRegistry *ServiceRegistryFilterer) ParseSetController(log types.Log) (*ServiceRegistrySetController, error) { + event := new(ServiceRegistrySetController) + if err := _ServiceRegistry.contract.UnpackLog(event, "SetController", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/contracts/ticketBroker.go b/eth/contracts/ticketBroker.go index f0f6d434f9..6bfe5884bd 100644 --- a/eth/contracts/ticketBroker.go +++ b/eth/contracts/ticketBroker.go @@ -1,7 +1,5 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -// Generated with a `go-ethereum` fork supporting ABIV2 -// https://github.com/ethereum/go-ethereum/pull/18491. package contracts @@ -30,7 +28,7 @@ var ( ) // TicketBrokerABI is the input ABI used to generate the binding from. -const TicketBrokerABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"freezePeriod\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\":true,\"inputs\":[{\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimedReserve\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_depositAmount\",\"type\":\"uint256\"},{\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"fundDepositAndReserve\",\"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\":true,\"inputs\":[{\"name\":\"_reserveHolder\",\"type\":\"address\"}],\"name\":\"getReserveInfo\",\"outputs\":[{\"components\":[{\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\"},{\"name\":\"thawRound\",\"type\":\"uint256\"}],\"name\":\"info\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundReserve\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimableReserve\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ticketValidityPeriod\",\"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\":false,\"inputs\":[],\"name\":\"unlock\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"cancelUnlock\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"components\":[{\"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\":\"_tickets\",\"type\":\"tuple[]\"},{\"name\":\"_sigs\",\"type\":\"bytes[]\"},{\"name\":\"_recipientRands\",\"type\":\"uint256[]\"}],\"name\":\"batchRedeemWinningTickets\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"getSenderInfo\",\"outputs\":[{\"components\":[{\"name\":\"deposit\",\"type\":\"uint256\"},{\"name\":\"withdrawBlock\",\"type\":\"uint256\"}],\"name\":\"sender\",\"type\":\"tuple\"},{\"components\":[{\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"name\":\"state\",\"type\":\"uint8\"},{\"name\":\"thawRound\",\"type\":\"uint256\"}],\"name\":\"reserve\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"components\":[{\"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\":\"_ticket\",\"type\":\"tuple\"},{\"name\":\"_sig\",\"type\":\"bytes\"},{\"name\":\"_recipientRand\",\"type\":\"uint256\"}],\"name\":\"redeemWinningTicket\",\"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\":\"_freezePeriod\",\"type\":\"uint256\"},{\"name\":\"_unlockPeriod\",\"type\":\"uint256\"},{\"name\":\"_ticketValidityPeriod\",\"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\":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\":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\":\"reserve\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"claimant\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"claimant\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"freezeRound\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"recipientsInFreezeRound\",\"type\":\"uint256\"}],\"name\":\"ReserveFrozen\",\"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\":\"_freezePeriod\",\"type\":\"uint256\"}],\"name\":\"setFreezePeriod\",\"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\":\"_ticketValidityPeriod\",\"type\":\"uint256\"}],\"name\":\"setTicketValidityPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +const TicketBrokerABI = "[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isUnlockInProgress\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"unlockPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimedReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_depositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"fundDepositAndReserve\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedTickets\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"}],\"name\":\"getReserveInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedInCurrentRound\",\"type\":\"uint256\"}],\"internalType\":\"structMReserve.ReserveInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"fundReserve\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimableReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ticketValidityPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientRandHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"internalType\":\"structMTicketBrokerCore.Ticket[]\",\"name\":\"_tickets\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"_sigs\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_recipientRands\",\"type\":\"uint256[]\"}],\"name\":\"batchRedeemWinningTickets\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"getSenderInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"internalType\":\"structMixinTicketBrokerCore.Sender\",\"name\":\"sender\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedInCurrentRound\",\"type\":\"uint256\"}],\"internalType\":\"structMReserve.ReserveInfo\",\"name\":\"reserve\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientRandHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"internalType\":\"structMTicketBrokerCore.Ticket\",\"name\":\"_ticket\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_sig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_recipientRand\",\"type\":\"uint256\"}],\"name\":\"redeemWinningTicket\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contractIController\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DepositFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"recipientRand\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"name\":\"WinningTicketRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WinningTicketTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startRound\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endRound\",\"type\":\"uint256\"}],\"name\":\"Unlock\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"UnlockCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"claimant\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_unlockPeriod\",\"type\":\"uint256\"}],\"name\":\"setUnlockPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ticketValidityPeriod\",\"type\":\"uint256\"}],\"name\":\"setTicketValidityPeriod\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // TicketBroker is an auto generated Go binding around an Ethereum contract. type TicketBroker struct { @@ -174,13 +172,6 @@ func (_TicketBroker *TicketBrokerTransactorRaw) Transact(opts *bind.TransactOpts return _TicketBroker.Contract.contract.Transact(opts, method, params...) } -// Struct0 is an auto generated low-level Go binding around an user-defined struct. -type Struct0 struct { - FundsRemaining *big.Int - State uint8 - ThawRound *big.Int -} - // Struct1 is an auto generated low-level Go binding around an user-defined struct. type Struct1 struct { Recipient common.Address @@ -192,10 +183,10 @@ type Struct1 struct { AuxData []byte } -// Struct2 is an auto generated low-level Go binding around an user-defined struct. -type Struct2 struct { +// Struct0 is an auto generated low-level Go binding around an user-defined struct. +type Struct0 struct { Deposit *big.Int - WithdrawBlock *big.Int + WithdrawRound *big.Int } // ClaimableReserve is a free data retrieval call binding the contract method 0x81779f38. @@ -276,32 +267,6 @@ func (_TicketBroker *TicketBrokerCallerSession) Controller() (common.Address, er return _TicketBroker.Contract.Controller(&_TicketBroker.CallOpts) } -// FreezePeriod is a free data retrieval call binding the contract method 0x0a3cb663. -// -// Solidity: function freezePeriod() constant returns(uint256) -func (_TicketBroker *TicketBrokerCaller) FreezePeriod(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _TicketBroker.contract.Call(opts, out, "freezePeriod") - return *ret0, err -} - -// FreezePeriod is a free data retrieval call binding the contract method 0x0a3cb663. -// -// Solidity: function freezePeriod() constant returns(uint256) -func (_TicketBroker *TicketBrokerSession) FreezePeriod() (*big.Int, error) { - return _TicketBroker.Contract.FreezePeriod(&_TicketBroker.CallOpts) -} - -// FreezePeriod is a free data retrieval call binding the contract method 0x0a3cb663. -// -// Solidity: function freezePeriod() constant returns(uint256) -func (_TicketBroker *TicketBrokerCallerSession) FreezePeriod() (*big.Int, error) { - return _TicketBroker.Contract.FreezePeriod(&_TicketBroker.CallOpts) -} - // GetReserveInfo is a free data retrieval call binding the contract method 0x5b6333eb. // // Solidity: function getReserveInfo(address _reserveHolder) constant returns(Struct0 info) @@ -330,13 +295,13 @@ func (_TicketBroker *TicketBrokerCallerSession) GetReserveInfo(_reserveHolder co // GetSenderInfo is a free data retrieval call binding the contract method 0xe1a589da. // -// Solidity: function getSenderInfo(address _sender) constant returns(Struct2 sender, Struct0 reserve) +// Solidity: function getSenderInfo(address _sender) constant returns(Struct0 sender, Struct0 reserve) func (_TicketBroker *TicketBrokerCaller) GetSenderInfo(opts *bind.CallOpts, _sender common.Address) (struct { - Sender Struct2 + Sender Struct0 Reserve Struct0 }, error) { ret := new(struct { - Sender Struct2 + Sender Struct0 Reserve Struct0 }) out := ret @@ -346,9 +311,9 @@ func (_TicketBroker *TicketBrokerCaller) GetSenderInfo(opts *bind.CallOpts, _sen // GetSenderInfo is a free data retrieval call binding the contract method 0xe1a589da. // -// Solidity: function getSenderInfo(address _sender) constant returns(Struct2 sender, Struct0 reserve) +// Solidity: function getSenderInfo(address _sender) constant returns(Struct0 sender, Struct0 reserve) func (_TicketBroker *TicketBrokerSession) GetSenderInfo(_sender common.Address) (struct { - Sender Struct2 + Sender Struct0 Reserve Struct0 }, error) { return _TicketBroker.Contract.GetSenderInfo(&_TicketBroker.CallOpts, _sender) @@ -356,9 +321,9 @@ func (_TicketBroker *TicketBrokerSession) GetSenderInfo(_sender common.Address) // GetSenderInfo is a free data retrieval call binding the contract method 0xe1a589da. // -// Solidity: function getSenderInfo(address _sender) constant returns(Struct2 sender, Struct0 reserve) +// Solidity: function getSenderInfo(address _sender) constant returns(Struct0 sender, Struct0 reserve) func (_TicketBroker *TicketBrokerCallerSession) GetSenderInfo(_sender common.Address) (struct { - Sender Struct2 + Sender Struct0 Reserve Struct0 }, error) { return _TicketBroker.Contract.GetSenderInfo(&_TicketBroker.CallOpts, _sender) @@ -496,21 +461,21 @@ func (_TicketBroker *TicketBrokerCallerSession) UsedTickets(arg0 [32]byte) (bool // BatchRedeemWinningTickets is a paid mutator transaction binding the contract method 0xd01b808e. // -// Solidity: function batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[] _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() +// Solidity: function batchRedeemWinningTickets([]Struct1 _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() func (_TicketBroker *TicketBrokerTransactor) BatchRedeemWinningTickets(opts *bind.TransactOpts, _tickets []Struct1, _sigs [][]byte, _recipientRands []*big.Int) (*types.Transaction, error) { return _TicketBroker.contract.Transact(opts, "batchRedeemWinningTickets", _tickets, _sigs, _recipientRands) } // BatchRedeemWinningTickets is a paid mutator transaction binding the contract method 0xd01b808e. // -// Solidity: function batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[] _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() +// Solidity: function batchRedeemWinningTickets([]Struct1 _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() func (_TicketBroker *TicketBrokerSession) BatchRedeemWinningTickets(_tickets []Struct1, _sigs [][]byte, _recipientRands []*big.Int) (*types.Transaction, error) { return _TicketBroker.Contract.BatchRedeemWinningTickets(&_TicketBroker.TransactOpts, _tickets, _sigs, _recipientRands) } // BatchRedeemWinningTickets is a paid mutator transaction binding the contract method 0xd01b808e. // -// Solidity: function batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[] _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() +// Solidity: function batchRedeemWinningTickets([]Struct1 _tickets, bytes[] _sigs, uint256[] _recipientRands) returns() func (_TicketBroker *TicketBrokerTransactorSession) BatchRedeemWinningTickets(_tickets []Struct1, _sigs [][]byte, _recipientRands []*big.Int) (*types.Transaction, error) { return _TicketBroker.Contract.BatchRedeemWinningTickets(&_TicketBroker.TransactOpts, _tickets, _sigs, _recipientRands) } @@ -641,27 +606,6 @@ func (_TicketBroker *TicketBrokerTransactorSession) SetController(_controller co return _TicketBroker.Contract.SetController(&_TicketBroker.TransactOpts, _controller) } -// SetFreezePeriod is a paid mutator transaction binding the contract method 0x57120165. -// -// Solidity: function setFreezePeriod(uint256 _freezePeriod) returns() -func (_TicketBroker *TicketBrokerTransactor) SetFreezePeriod(opts *bind.TransactOpts, _freezePeriod *big.Int) (*types.Transaction, error) { - return _TicketBroker.contract.Transact(opts, "setFreezePeriod", _freezePeriod) -} - -// SetFreezePeriod is a paid mutator transaction binding the contract method 0x57120165. -// -// Solidity: function setFreezePeriod(uint256 _freezePeriod) returns() -func (_TicketBroker *TicketBrokerSession) SetFreezePeriod(_freezePeriod *big.Int) (*types.Transaction, error) { - return _TicketBroker.Contract.SetFreezePeriod(&_TicketBroker.TransactOpts, _freezePeriod) -} - -// SetFreezePeriod is a paid mutator transaction binding the contract method 0x57120165. -// -// Solidity: function setFreezePeriod(uint256 _freezePeriod) returns() -func (_TicketBroker *TicketBrokerTransactorSession) SetFreezePeriod(_freezePeriod *big.Int) (*types.Transaction, error) { - return _TicketBroker.Contract.SetFreezePeriod(&_TicketBroker.TransactOpts, _freezePeriod) -} - // SetTicketValidityPeriod is a paid mutator transaction binding the contract method 0xc9297808. // // Solidity: function setTicketValidityPeriod(uint256 _ticketValidityPeriod) returns() @@ -879,6 +823,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchDepositFunded(opts *bind.WatchOp }), nil } +// ParseDepositFunded is a log parse operation binding the contract event 0x5159e237d952190e68d5215430f305831be7c9c8776d1377c76679ae4773413f. +// +// Solidity: event DepositFunded(address indexed sender, uint256 amount) +func (_TicketBroker *TicketBrokerFilterer) ParseDepositFunded(log types.Log) (*TicketBrokerDepositFunded, error) { + event := new(TicketBrokerDepositFunded) + if err := _TicketBroker.contract.UnpackLog(event, "DepositFunded", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerParameterUpdateIterator is returned from FilterParameterUpdate and is used to iterate over the raw logs and unpacked data for ParameterUpdate events raised by the TicketBroker contract. type TicketBrokerParameterUpdateIterator struct { Event *TicketBrokerParameterUpdate // Event containing the contract specifics and raw log @@ -1001,6 +956,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchParameterUpdate(opts *bind.Watch }), nil } +// ParseParameterUpdate is a log parse operation binding the contract event 0x9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674. +// +// Solidity: event ParameterUpdate(string param) +func (_TicketBroker *TicketBrokerFilterer) ParseParameterUpdate(log types.Log) (*TicketBrokerParameterUpdate, error) { + event := new(TicketBrokerParameterUpdate) + if err := _TicketBroker.contract.UnpackLog(event, "ParameterUpdate", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerReserveClaimedIterator is returned from FilterReserveClaimed and is used to iterate over the raw logs and unpacked data for ReserveClaimed events raised by the TicketBroker contract. type TicketBrokerReserveClaimedIterator struct { Event *TicketBrokerReserveClaimed // Event containing the contract specifics and raw log @@ -1135,147 +1101,15 @@ func (_TicketBroker *TicketBrokerFilterer) WatchReserveClaimed(opts *bind.WatchO }), nil } -// TicketBrokerReserveFrozenIterator is returned from FilterReserveFrozen and is used to iterate over the raw logs and unpacked data for ReserveFrozen events raised by the TicketBroker contract. -type TicketBrokerReserveFrozenIterator struct { - Event *TicketBrokerReserveFrozen // 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 *TicketBrokerReserveFrozenIterator) 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(TicketBrokerReserveFrozen) - 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(TicketBrokerReserveFrozen) - 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 *TicketBrokerReserveFrozenIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TicketBrokerReserveFrozenIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TicketBrokerReserveFrozen represents a ReserveFrozen event raised by the TicketBroker contract. -type TicketBrokerReserveFrozen struct { - ReserveHolder common.Address - Claimant common.Address - FreezeRound *big.Int - RecipientsInFreezeRound *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterReserveFrozen is a free log retrieval operation binding the contract event 0xe5c52595a06d488d02e042cf2ad7b203d4020e8ea0dfa5cc841f80e413fdd042. -// -// Solidity: event ReserveFrozen(address indexed reserveHolder, address indexed claimant, uint256 freezeRound, uint256 recipientsInFreezeRound) -func (_TicketBroker *TicketBrokerFilterer) FilterReserveFrozen(opts *bind.FilterOpts, reserveHolder []common.Address, claimant []common.Address) (*TicketBrokerReserveFrozenIterator, error) { - - var reserveHolderRule []interface{} - for _, reserveHolderItem := range reserveHolder { - reserveHolderRule = append(reserveHolderRule, reserveHolderItem) - } - var claimantRule []interface{} - for _, claimantItem := range claimant { - claimantRule = append(claimantRule, claimantItem) - } - - logs, sub, err := _TicketBroker.contract.FilterLogs(opts, "ReserveFrozen", reserveHolderRule, claimantRule) - if err != nil { - return nil, err - } - return &TicketBrokerReserveFrozenIterator{contract: _TicketBroker.contract, event: "ReserveFrozen", logs: logs, sub: sub}, nil -} - -// WatchReserveFrozen is a free log subscription operation binding the contract event 0xe5c52595a06d488d02e042cf2ad7b203d4020e8ea0dfa5cc841f80e413fdd042. +// ParseReserveClaimed is a log parse operation binding the contract event 0x5c2b394723f408a40a60335e24b71829642e35f350cebe2036a96a66e895ea98. // -// Solidity: event ReserveFrozen(address indexed reserveHolder, address indexed claimant, uint256 freezeRound, uint256 recipientsInFreezeRound) -func (_TicketBroker *TicketBrokerFilterer) WatchReserveFrozen(opts *bind.WatchOpts, sink chan<- *TicketBrokerReserveFrozen, reserveHolder []common.Address, claimant []common.Address) (event.Subscription, error) { - - var reserveHolderRule []interface{} - for _, reserveHolderItem := range reserveHolder { - reserveHolderRule = append(reserveHolderRule, reserveHolderItem) - } - var claimantRule []interface{} - for _, claimantItem := range claimant { - claimantRule = append(claimantRule, claimantItem) - } - - logs, sub, err := _TicketBroker.contract.WatchLogs(opts, "ReserveFrozen", reserveHolderRule, claimantRule) - if err != nil { +// Solidity: event ReserveClaimed(address indexed reserveHolder, address claimant, uint256 amount) +func (_TicketBroker *TicketBrokerFilterer) ParseReserveClaimed(log types.Log) (*TicketBrokerReserveClaimed, error) { + event := new(TicketBrokerReserveClaimed) + if err := _TicketBroker.contract.UnpackLog(event, "ReserveClaimed", log); 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(TicketBrokerReserveFrozen) - if err := _TicketBroker.contract.UnpackLog(event, "ReserveFrozen", 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 + return event, nil } // TicketBrokerReserveFundedIterator is returned from FilterReserveFunded and is used to iterate over the raw logs and unpacked data for ReserveFunded events raised by the TicketBroker contract. @@ -1411,6 +1245,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchReserveFunded(opts *bind.WatchOp }), nil } +// ParseReserveFunded is a log parse operation binding the contract event 0xb52b99b9e83551fcbd069b559cc3e823e2a1a3bad8ece46561ea77524394c850. +// +// Solidity: event ReserveFunded(address indexed reserveHolder, uint256 amount) +func (_TicketBroker *TicketBrokerFilterer) ParseReserveFunded(log types.Log) (*TicketBrokerReserveFunded, error) { + event := new(TicketBrokerReserveFunded) + if err := _TicketBroker.contract.UnpackLog(event, "ReserveFunded", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerSetControllerIterator is returned from FilterSetController and is used to iterate over the raw logs and unpacked data for SetController events raised by the TicketBroker contract. type TicketBrokerSetControllerIterator struct { Event *TicketBrokerSetController // Event containing the contract specifics and raw log @@ -1533,6 +1378,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchSetController(opts *bind.WatchOp }), nil } +// ParseSetController is a log parse operation binding the contract event 0x4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70. +// +// Solidity: event SetController(address controller) +func (_TicketBroker *TicketBrokerFilterer) ParseSetController(log types.Log) (*TicketBrokerSetController, error) { + event := new(TicketBrokerSetController) + if err := _TicketBroker.contract.UnpackLog(event, "SetController", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerUnlockIterator is returned from FilterUnlock and is used to iterate over the raw logs and unpacked data for Unlock events raised by the TicketBroker contract. type TicketBrokerUnlockIterator struct { Event *TicketBrokerUnlock // Event containing the contract specifics and raw log @@ -1603,14 +1459,14 @@ func (it *TicketBrokerUnlockIterator) Close() error { // TicketBrokerUnlock represents a Unlock event raised by the TicketBroker contract. type TicketBrokerUnlock struct { Sender common.Address - StartBlock *big.Int - EndBlock *big.Int + StartRound *big.Int + EndRound *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) +// Solidity: event Unlock(address indexed sender, uint256 startRound, uint256 endRound) func (_TicketBroker *TicketBrokerFilterer) FilterUnlock(opts *bind.FilterOpts, sender []common.Address) (*TicketBrokerUnlockIterator, error) { var senderRule []interface{} @@ -1627,7 +1483,7 @@ func (_TicketBroker *TicketBrokerFilterer) FilterUnlock(opts *bind.FilterOpts, s // WatchUnlock is a free log subscription operation binding the contract event 0xf7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c2004. // -// Solidity: event Unlock(address indexed sender, uint256 startBlock, uint256 endBlock) +// Solidity: event Unlock(address indexed sender, uint256 startRound, uint256 endRound) func (_TicketBroker *TicketBrokerFilterer) WatchUnlock(opts *bind.WatchOpts, sink chan<- *TicketBrokerUnlock, sender []common.Address) (event.Subscription, error) { var senderRule []interface{} @@ -1667,6 +1523,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchUnlock(opts *bind.WatchOpts, sin }), nil } +// ParseUnlock is a log parse operation binding the contract event 0xf7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c2004. +// +// Solidity: event Unlock(address indexed sender, uint256 startRound, uint256 endRound) +func (_TicketBroker *TicketBrokerFilterer) ParseUnlock(log types.Log) (*TicketBrokerUnlock, error) { + event := new(TicketBrokerUnlock) + if err := _TicketBroker.contract.UnpackLog(event, "Unlock", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerUnlockCancelledIterator is returned from FilterUnlockCancelled and is used to iterate over the raw logs and unpacked data for UnlockCancelled events raised by the TicketBroker contract. type TicketBrokerUnlockCancelledIterator struct { Event *TicketBrokerUnlockCancelled // Event containing the contract specifics and raw log @@ -1799,6 +1666,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchUnlockCancelled(opts *bind.Watch }), nil } +// ParseUnlockCancelled is a log parse operation binding the contract event 0xfa044b7b93a40365dc68049797c2eb06918523d694e5d56e406cac3eb35578e5. +// +// Solidity: event UnlockCancelled(address indexed sender) +func (_TicketBroker *TicketBrokerFilterer) ParseUnlockCancelled(log types.Log) (*TicketBrokerUnlockCancelled, error) { + event := new(TicketBrokerUnlockCancelled) + if err := _TicketBroker.contract.UnpackLog(event, "UnlockCancelled", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerWinningTicketRedeemedIterator is returned from FilterWinningTicketRedeemed and is used to iterate over the raw logs and unpacked data for WinningTicketRedeemed events raised by the TicketBroker contract. type TicketBrokerWinningTicketRedeemedIterator struct { Event *TicketBrokerWinningTicketRedeemed // Event containing the contract specifics and raw log @@ -1945,6 +1823,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchWinningTicketRedeemed(opts *bind }), nil } +// ParseWinningTicketRedeemed is a log parse 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 (_TicketBroker *TicketBrokerFilterer) ParseWinningTicketRedeemed(log types.Log) (*TicketBrokerWinningTicketRedeemed, error) { + event := new(TicketBrokerWinningTicketRedeemed) + if err := _TicketBroker.contract.UnpackLog(event, "WinningTicketRedeemed", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerWinningTicketTransferIterator is returned from FilterWinningTicketTransfer and is used to iterate over the raw logs and unpacked data for WinningTicketTransfer events raised by the TicketBroker contract. type TicketBrokerWinningTicketTransferIterator struct { Event *TicketBrokerWinningTicketTransfer // Event containing the contract specifics and raw log @@ -2087,6 +1976,17 @@ func (_TicketBroker *TicketBrokerFilterer) WatchWinningTicketTransfer(opts *bind }), nil } +// ParseWinningTicketTransfer is a log parse operation binding the contract event 0x8b87351a208c06e3ceee59d80725fd77a23b4129e1b51ca231fc89b40712649c. +// +// Solidity: event WinningTicketTransfer(address indexed sender, address indexed recipient, uint256 amount) +func (_TicketBroker *TicketBrokerFilterer) ParseWinningTicketTransfer(log types.Log) (*TicketBrokerWinningTicketTransfer, error) { + event := new(TicketBrokerWinningTicketTransfer) + if err := _TicketBroker.contract.UnpackLog(event, "WinningTicketTransfer", log); err != nil { + return nil, err + } + return event, nil +} + // TicketBrokerWithdrawalIterator is returned from FilterWithdrawal and is used to iterate over the raw logs and unpacked data for Withdrawal events raised by the TicketBroker contract. type TicketBrokerWithdrawalIterator struct { Event *TicketBrokerWithdrawal // Event containing the contract specifics and raw log @@ -2220,3 +2120,14 @@ func (_TicketBroker *TicketBrokerFilterer) WatchWithdrawal(opts *bind.WatchOpts, } }), nil } + +// ParseWithdrawal is a log parse operation binding the contract event 0xdf273cb619d95419a9cd0ec88123a0538c85064229baa6363788f743fff90deb. +// +// Solidity: event Withdrawal(address indexed sender, uint256 deposit, uint256 reserve) +func (_TicketBroker *TicketBrokerFilterer) ParseWithdrawal(log types.Log) (*TicketBrokerWithdrawal, error) { + event := new(TicketBrokerWithdrawal) + if err := _TicketBroker.contract.UnpackLog(event, "Withdrawal", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/eth/roundinitializer.go b/eth/roundinitializer.go index c704865ea9..dfef2da3f7 100644 --- a/eth/roundinitializer.go +++ b/eth/roundinitializer.go @@ -127,7 +127,7 @@ func (r *RoundInitializer) shouldInitialize(epochSeed *big.Int) (bool, error) { return false, err } - numActive, err := r.client.NumActiveTranscoders() + numActive, err := r.client.GetTranscoderPoolMaxSize() if err != nil { return false, err } diff --git a/eth/roundinitializer_test.go b/eth/roundinitializer_test.go index 8f5657d71e..ab0e66a794 100644 --- a/eth/roundinitializer_test.go +++ b/eth/roundinitializer_test.go @@ -95,9 +95,9 @@ func TestRoundInitializer_ShouldInitialize(t *testing.T) { assert.False(ok) // Test error getting max active set size - expErr = errors.New("NumActiveTranscoders error") + expErr = errors.New("GetTranscoderPoolMaxSize error") client.On("RegisteredTranscoders").Return(nil, nil).Once() - client.On("NumActiveTranscoders").Return(nil, expErr).Once() + client.On("GetTranscoderPoolMaxSize").Return(nil, expErr).Once() ok, err = initializer.shouldInitialize(nil) assert.EqualError(err, expErr.Error()) @@ -105,7 +105,7 @@ func TestRoundInitializer_ShouldInitialize(t *testing.T) { // Test active set is empty because no registered transcoders client.On("RegisteredTranscoders").Return([]*lpTypes.Transcoder{}, nil).Once() - client.On("NumActiveTranscoders").Return(big.NewInt(2), nil).Once() + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(2), nil).Once() ok, err = initializer.shouldInitialize(nil) assert.Nil(err) @@ -116,7 +116,7 @@ func TestRoundInitializer_ShouldInitialize(t *testing.T) { &lpTypes.Transcoder{}, } client.On("RegisteredTranscoders").Return(registered, nil).Once() - client.On("NumActiveTranscoders").Return(big.NewInt(0), nil).Once() + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(0), nil).Once() ok, err = initializer.shouldInitialize(nil) assert.Nil(err) @@ -131,7 +131,7 @@ func TestRoundInitializer_ShouldInitialize(t *testing.T) { &lpTypes.Transcoder{Address: ethcommon.BytesToAddress([]byte("bar"))}, } client.On("RegisteredTranscoders").Return(registered, nil).Once() - client.On("NumActiveTranscoders").Return(big.NewInt(2), nil).Once() + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(2), nil).Once() ok, err = initializer.shouldInitialize(nil) assert.Nil(err) @@ -140,14 +140,14 @@ func TestRoundInitializer_ShouldInitialize(t *testing.T) { // Test that caller is not in active set but it is registered registered = append(registered, &lpTypes.Transcoder{Address: caller}) client.On("RegisteredTranscoders").Return(registered, nil) - client.On("NumActiveTranscoders").Return(big.NewInt(2), nil).Once() + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(2), nil).Once() ok, err = initializer.shouldInitialize(nil) assert.Nil(err) assert.False(ok) // Test caller not selected - client.On("NumActiveTranscoders").Return(big.NewInt(3), nil) + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(3), nil) seed := big.NewInt(3) ok, err = initializer.shouldInitialize(seed) @@ -216,7 +216,7 @@ func TestRoundInitializer_TryInitialize(t *testing.T) { &lpTypes.Transcoder{Address: ethcommon.BytesToAddress([]byte("jar"))}, } client.On("RegisteredTranscoders").Return(registered, nil).Once() - client.On("NumActiveTranscoders").Return(big.NewInt(2), nil) + client.On("GetTranscoderPoolMaxSize").Return(big.NewInt(2), nil) err = initializer.tryInitialize() assert.Nil(err) diff --git a/eth/stubclient.go b/eth/stubclient.go index 16f92b2422..3b83826c56 100644 --- a/eth/stubclient.go +++ b/eth/stubclient.go @@ -55,8 +55,8 @@ func (m *MockClient) RegisteredTranscoders() ([]*lpTypes.Transcoder, error) { return args.Get(0).([]*lpTypes.Transcoder), args.Error(1) } -// NumActiveTranscoders returns the max size of the active set -func (m *MockClient) NumActiveTranscoders() (*big.Int, error) { +// GetTranscoderPoolMaxSize returns the max size of the active set +func (m *MockClient) GetTranscoderPoolMaxSize() (*big.Int, error) { args := m.Called() return mockBigInt(args, 0), args.Error(1) } @@ -116,11 +116,11 @@ func (m *MockClient) Withdraw() (*types.Transaction, error) { func (m *MockClient) Senders(addr common.Address) (sender struct { Deposit *big.Int - WithdrawBlock *big.Int + WithdrawRound *big.Int }, err error) { args := m.Called(addr) sender.Deposit = mockBigInt(args, 0) - sender.WithdrawBlock = mockBigInt(args, 1) + sender.WithdrawRound = mockBigInt(args, 1) err = args.Error(2) return @@ -178,7 +178,7 @@ type stubTranscoder struct { } func (e *StubClient) Setup(password string, gasLimit uint64, gasPrice *big.Int) error { return nil } -func (e *StubClient) Account() accounts.Account { return accounts.Account{} } +func (e *StubClient) Account() accounts.Account { return accounts.Account{Address: e.TranscoderAddress} } func (e *StubClient) Backend() (*ethclient.Client, error) { return nil, ErrMissingBackend } // Rounds @@ -208,7 +208,7 @@ func (e *StubClient) GetServiceURI(addr common.Address) (string, error) // Staking -func (e *StubClient) Transcoder(blockRewardCut *big.Int, feeShare *big.Int, pricePerSegment *big.Int) (*types.Transaction, error) { +func (e *StubClient) Transcoder(blockRewardCut, feeShare *big.Int) (*types.Transaction, error) { return nil, nil } func (e *StubClient) Reward() (*types.Transaction, error) { return nil, nil } @@ -273,7 +273,7 @@ func (e *StubClient) IsUsedTicket(ticket *pm.Ticket) (bool, error) { } func (e *StubClient) Senders(addr ethcommon.Address) (sender struct { Deposit *big.Int - WithdrawBlock *big.Int + WithdrawRound *big.Int }, err error) { return } @@ -288,14 +288,13 @@ func (e *StubClient) UnlockPeriod() (*big.Int, error) { } // 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) 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) GetTranscoderPoolMaxSize() (*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 diff --git a/eth/types/contracts.go b/eth/types/contracts.go index 36c4c70895..94369223c1 100644 --- a/eth/types/contracts.go +++ b/eth/types/contracts.go @@ -13,18 +13,14 @@ var ( ) type Transcoder struct { - Address common.Address - ServiceURI string - LastRewardRound *big.Int - RewardCut *big.Int - FeeShare *big.Int - PricePerSegment *big.Int - PendingRewardCut *big.Int - PendingFeeShare *big.Int - PendingPricePerSegment *big.Int - DelegatedStake *big.Int - Active bool - Status string + Address common.Address + ServiceURI string + LastRewardRound *big.Int + RewardCut *big.Int + FeeShare *big.Int + DelegatedStake *big.Int + Active bool + Status string } func ParseTranscoderStatus(s uint8) (string, error) { diff --git a/eth/watchers/roundswatcher.go b/eth/watchers/roundswatcher.go index 61e370bacd..6384fad391 100644 --- a/eth/watchers/roundswatcher.go +++ b/eth/watchers/roundswatcher.go @@ -7,6 +7,7 @@ import ( ethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" "github.com/livepeer/go-livepeer/eth/contracts" "github.com/golang/glog" @@ -23,6 +24,9 @@ type RoundsWatcher struct { quit chan struct{} + subFeed event.Feed + subScope event.SubscriptionScope // Subscription scope tracking current live listeners + watcher BlockWatcher lpEth eth.LivepeerEthClient dec *EventDecoder @@ -107,9 +111,18 @@ func (rw *RoundsWatcher) Watch() error { } } +// Subscribe allows one to subscribe to the block events emitted by the Watcher. +// To unsubscribe, simply call `Unsubscribe` on the returned subscription. +// The sink channel should have ample buffer space to avoid blocking other subscribers. +// Slow subscribers are not dropped. +func (rw *RoundsWatcher) Subscribe(sink chan<- types.Log) event.Subscription { + return rw.subScope.Track(rw.subFeed.Subscribe(sink)) +} + // Stop watching for NewRound events func (rw *RoundsWatcher) Stop() { close(rw.quit) + rw.subScope.Close() } func (rw *RoundsWatcher) handleBlockEvents(events []*blockwatch.Event) { @@ -140,6 +153,9 @@ func (rw *RoundsWatcher) handleLog(log types.Log) error { if err := rw.dec.Decode("NewRound", log, &nr); err != nil { return fmt.Errorf("unable to decode event: %v", err) } + + rw.subFeed.Send(log) + if log.Removed { lr, err := rw.lpEth.LastInitializedRound() if err != nil { diff --git a/eth/watchers/senderwatcher.go b/eth/watchers/senderwatcher.go index 317575c911..b6fd17b17f 100644 --- a/eth/watchers/senderwatcher.go +++ b/eth/watchers/senderwatcher.go @@ -21,19 +21,22 @@ type SenderWatcher struct { mu sync.RWMutex quit chan struct{} watcher BlockWatcher + rw EventWatcher lpEth eth.LivepeerEthClient dec *EventDecoder } // NewSenderWatcher initiates a new SenderWatcher -func NewSenderWatcher(ticketBrokerAddr ethcommon.Address, watcher BlockWatcher, lpEth eth.LivepeerEthClient) (*SenderWatcher, error) { +func NewSenderWatcher(ticketBrokerAddr ethcommon.Address, watcher BlockWatcher, lpEth eth.LivepeerEthClient, rw EventWatcher) (*SenderWatcher, error) { dec, err := NewEventDecoder(ticketBrokerAddr, contracts.TicketBrokerABI) if err != nil { return nil, err } + return &SenderWatcher{ quit: make(chan struct{}), watcher: watcher, + rw: rw, lpEth: lpEth, senders: make(map[ethcommon.Address]*pm.SenderInfo), claimedReserve: make(map[ethcommon.Address]*big.Int), @@ -41,7 +44,7 @@ func NewSenderWatcher(ticketBrokerAddr ethcommon.Address, watcher BlockWatcher, }, nil } -// GetSenderInfo returns the senderInfo for a sender +// GetSenderInfo returns information about a sender's deposit and reserve // if values for a sender are not cached an RPC call to a remote ethereum node will be made to initialize the cache func (sw *SenderWatcher) GetSenderInfo(addr ethcommon.Address) (*pm.SenderInfo, error) { sw.mu.RLock() @@ -64,7 +67,7 @@ func (sw *SenderWatcher) setSenderInfo(addr ethcommon.Address, info *pm.SenderIn sw.senders[addr] = info } -// ClaimedReserve returns the amount claimed from a sender's reserve +// ClaimedReserve returns the amount claimed from a sender's reserve by the node operator func (sw *SenderWatcher) ClaimedReserve(reserveHolder ethcommon.Address, claimant ethcommon.Address) (*big.Int, error) { sw.mu.RLock() claimed := sw.claimedReserve[reserveHolder] @@ -84,9 +87,14 @@ func (sw *SenderWatcher) ClaimedReserve(reserveHolder ethcommon.Address, claiman // Watch starts the event watching loop func (sw *SenderWatcher) Watch() { + roundEvents := make(chan types.Log, 10) + roundSub := sw.rw.Subscribe(roundEvents) + defer roundSub.Unsubscribe() + events := make(chan []*blockwatch.Event, 10) sub := sw.watcher.Subscribe(events) defer sub.Unsubscribe() + for { select { case <-sw.quit: @@ -95,6 +103,8 @@ func (sw *SenderWatcher) Watch() { glog.Error(err) case events := <-events: sw.handleBlockEvents(events) + case roundEvent := <-roundEvents: + sw.handleRoundEvent(roundEvent) } } } @@ -157,20 +167,7 @@ func (sw *SenderWatcher) handleLog(log types.Log) error { } sender = reserveFunded.ReserveHolder if info, ok := sw.senders[sender]; ok && !log.Removed { - info.Reserve.Add(info.Reserve, reserveFunded.Amount) - // if a thawed reserve is funded we flush claimedReserve for a sender and set it to NotFrozen - // making an RPC call here is suboptimal but doesn't happen frequently - var currentRound *big.Int - if info.ThawRound.Int64() != 0 { - currentRound, err = sw.lpEth.CurrentRound() - if err != nil { - return err - } - if info.ThawRound.Cmp(currentRound) < 0 { - info.ReserveState = pm.NotFrozen - sw.claimedReserve[sender] = big.NewInt(0) - } - } + info.Reserve.FundsRemaining.Add(info.Reserve.FundsRemaining, reserveFunded.Amount) } case "Withdrawal": var withdrawal contracts.TicketBrokerWithdrawal @@ -180,7 +177,8 @@ func (sw *SenderWatcher) handleLog(log types.Log) error { sender = withdrawal.Sender if info, ok := sw.senders[sender]; ok && !log.Removed { info.Deposit = big.NewInt(0) - info.Reserve = big.NewInt(0) + info.Reserve.FundsRemaining = big.NewInt(0) + info.Reserve.ClaimedInCurrentRound = big.NewInt(0) sw.claimedReserve[sender] = big.NewInt(0) } case "WinningTicketTransfer": @@ -195,34 +193,25 @@ func (sw *SenderWatcher) handleLog(log types.Log) error { // See if amount > deposit if info.Deposit.Cmp(amount) < 0 { // Draw from reserve - // ReserveFrozen will be handled in it's own event log handler diff := new(big.Int).Sub(amount, info.Deposit) info.Deposit = big.NewInt(0) - if claimed, ok := sw.claimedReserve[sender]; ok { - claimed.Add(claimed, diff) - } else { - sw.claimedReserve[sender] = diff + // Substract the difference from the remaining reserve + info.Reserve.FundsRemaining.Sub(info.Reserve.FundsRemaining, diff) + // Add the difference to the amount claimed from the reserve in the current round + info.Reserve.ClaimedInCurrentRound.Add(info.Reserve.ClaimedInCurrentRound, diff) + // if ticket recipient is the node operator, add to amount the recipient has claimed from a reserve + if sw.lpEth.Account().Address == winningTicketTransfer.Recipient { + if claimed, ok := sw.claimedReserve[sender]; ok { + claimed.Add(claimed, diff) + } else { + sw.claimedReserve[sender] = diff + } } } else { // Draw from deposit info.Deposit.Sub(info.Deposit, amount) } } - case "ReserveFrozen": - // Set reserveStatus and thawround - var reserveFrozen contracts.TicketBrokerReserveFrozen - if err := sw.dec.Decode("ReserveFrozen", log, &reserveFrozen); err != nil { - return fmt.Errorf("failed to decode ReserveFrozen event: %v", err) - } - sender = reserveFrozen.ReserveHolder - if info, ok := sw.senders[sender]; ok && !log.Removed { - info.ReserveState = pm.Frozen - // TODO: fetch freezePeriod instead of hardcoding or use a const - // TODO: how to handle unthaw - // frozen checks will have to be against ReserveFrozen and ThawRound < CurrentRound - // But how do we handle state updates when the reserve thaws? - info.ThawRound.Add(reserveFrozen.FreezeRound, big.NewInt(2)) - } case "Unlock": // Set withdraw block var unlock contracts.TicketBrokerUnlock @@ -231,17 +220,17 @@ func (sw *SenderWatcher) handleLog(log types.Log) error { } sender = unlock.Sender if info, ok := sw.senders[sender]; ok && !log.Removed { - info.WithdrawBlock = unlock.EndBlock + info.WithdrawRound = unlock.EndRound } case "UnlockCancelled": - // Unset withdrawblock + // Unset withdrawRound var unlockCancelled contracts.TicketBrokerUnlockCancelled if err := sw.dec.Decode("UnlockCancelled", log, &unlockCancelled); err != nil { return fmt.Errorf("failed to decode UnlockCancelled event: %v", err) } sender = unlockCancelled.Sender if info, ok := sw.senders[sender]; ok && !log.Removed { - info.WithdrawBlock = big.NewInt(0) + info.WithdrawRound = big.NewInt(0) } default: return nil @@ -257,3 +246,34 @@ func (sw *SenderWatcher) handleLog(log types.Log) error { return nil } + +func (sw *SenderWatcher) handleRoundEvent(log types.Log) error { + sw.mu.Lock() + defer sw.mu.Unlock() + + for sender, info := range sw.senders { + if log.Removed { + i, err := sw.lpEth.GetSenderInfo(sender) + if err != nil { + return fmt.Errorf("GetSenderInfo RPC call to remote node failed: %v", err) + } + info = i + } else { + info.Reserve.ClaimedInCurrentRound = big.NewInt(0) + } + } + + for sender := range sw.claimedReserve { + if log.Removed { + c, err := sw.lpEth.ClaimedReserve(sender, sw.lpEth.Account().Address) + if err != nil { + return fmt.Errorf("ClaimedReserve RPC call to remote node failed: %v", err) + } + sw.claimedReserve[sender] = c + } else { + sw.claimedReserve[sender] = big.NewInt(0) + } + } + + return nil +} diff --git a/eth/watchers/senderwatcher_test.go b/eth/watchers/senderwatcher_test.go index 4e9cb59892..7d5ee1cf24 100644 --- a/eth/watchers/senderwatcher_test.go +++ b/eth/watchers/senderwatcher_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/livepeer/go-livepeer/eth" "github.com/livepeer/go-livepeer/eth/blockwatch" @@ -22,15 +23,20 @@ func TestGetAndSetSenderInfo(t *testing.T) { lpEth: ð.StubClient{ SenderInfo: &pm.SenderInfo{ Deposit: big.NewInt(10), - Reserve: big.NewInt(5), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(5), + ClaimedInCurrentRound: big.NewInt(0), + }, }, }, } info := &pm.SenderInfo{ - Deposit: big.NewInt(1000000000000000000), - Reserve: big.NewInt(1000000000000000000), - ReserveState: pm.NotFrozen, + Deposit: big.NewInt(1000000000000000000), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(1000000000000000000), + ClaimedInCurrentRound: big.NewInt(0), + }, } sender := pm.RandAddress() @@ -45,17 +51,20 @@ func TestGetAndSetSenderInfo(t *testing.T) { info, err = sw.GetSenderInfo(sender) assert.Nil(err) assert.Zero(info.Deposit.Cmp(big.NewInt(10))) - assert.Zero(info.Reserve.Cmp(big.NewInt(5))) + assert.Zero(info.Reserve.FundsRemaining.Cmp(big.NewInt(5))) info = sw.senders[sender] assert.Zero(info.Deposit.Cmp(big.NewInt(10))) - assert.Zero(info.Reserve.Cmp(big.NewInt(5))) + assert.Zero(info.Reserve.FundsRemaining.Cmp(big.NewInt(5))) } func TestSenderWatcher_Clear(t *testing.T) { assert := assert.New(t) stubClientSenderInfo := &pm.SenderInfo{ Deposit: big.NewInt(10), - Reserve: big.NewInt(5), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(5), + ClaimedInCurrentRound: big.NewInt(0), + }, } sw := &SenderWatcher{ senders: make(map[ethcommon.Address]*pm.SenderInfo), @@ -65,9 +74,11 @@ func TestSenderWatcher_Clear(t *testing.T) { }, } info := &pm.SenderInfo{ - Deposit: big.NewInt(1000000000000000000), - Reserve: big.NewInt(1000000000000000000), - ReserveState: pm.NotFrozen, + Deposit: big.NewInt(1000000000000000000), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(1000000000000000000), + ClaimedInCurrentRound: big.NewInt(0), + }, } sender := pm.RandAddress() @@ -101,7 +112,10 @@ func TestSenderWatcher_ClaimedReserve(t *testing.T) { require := require.New(t) lpEth := ð.StubClient{} watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) require.Nil(err) // if not existant on map; make RPC call and init the map @@ -132,7 +146,10 @@ func TestSenderWatcher_WatchAndStop(t *testing.T) { assert := assert.New(t) lpEth := ð.StubClient{} watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) go sw.Watch() @@ -143,18 +160,20 @@ func TestSenderWatcher_WatchAndStop(t *testing.T) { } func TestSenderWatcher_HandleLog(t *testing.T) { + assert := assert.New(t) lpEth := ð.StubClient{} watcher := &stubBlockWatcher{} - rw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) - require.Nil(t, err) - assert := assert.New(t) + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) + assert.Nil(err) // Test unknown event log := newStubBaseLog() log.Topics = []ethcommon.Hash{ethcommon.BytesToHash([]byte("foo"))} - err = rw.handleLog(log) + err = sw.handleLog(log) assert.Nil(err) } @@ -164,11 +183,17 @@ func TestFundDepositEvent(t *testing.T) { lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ Deposit: big.NewInt(10), - Reserve: big.NewInt(5), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(5), + ClaimedInCurrentRound: big.NewInt(0), + }, }, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) header := defaultMiniHeader() @@ -224,16 +249,20 @@ func TestFundReserveEvent(t *testing.T) { assert := assert.New(t) startDeposit := big.NewInt(10) startReserve := big.NewInt(5) - startThawR := big.NewInt(1) lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ - Deposit: big.NewInt(10), - Reserve: big.NewInt(5), - ThawRound: big.NewInt(1), + Deposit: big.NewInt(10), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(5), + ClaimedInCurrentRound: big.NewInt(0), + }, }, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) header := defaultMiniHeader() @@ -263,8 +292,7 @@ func TestFundReserveEvent(t *testing.T) { info, ok := sw.senders[stubSender] assert.True(ok) assert.Equal(info.Deposit, startDeposit) - assert.Equal(info.Reserve, startReserve) - assert.Equal(info.ThawRound, startThawR) + assert.Equal(info.Reserve.FundsRemaining, startReserve) // If map entry exists parse event log blockEvent.Type = blockwatch.Added @@ -273,7 +301,7 @@ func TestFundReserveEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) - assert.Zero(info.Reserve.Cmp(expectedReserve)) + assert.Zero(info.Reserve.FundsRemaining.Cmp(expectedReserve)) // If we don't care about the address, don't handle the event s := pm.RandAddress() @@ -294,11 +322,17 @@ func TestWithdrawalEvent(t *testing.T) { lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ Deposit: big.NewInt(10), - Reserve: big.NewInt(5), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(5), + ClaimedInCurrentRound: big.NewInt(0), + }, }, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) header := defaultMiniHeader() @@ -328,7 +362,7 @@ func TestWithdrawalEvent(t *testing.T) { info, ok := sw.senders[stubSender] assert.True(ok) assert.Zero(info.Deposit.Cmp(startDeposit)) - assert.Zero(info.Reserve.Cmp(startReserve)) + assert.Zero(info.Reserve.FundsRemaining.Cmp(startReserve)) // If map entry exists parse event log blockEvent.Type = blockwatch.Added @@ -338,7 +372,7 @@ func TestWithdrawalEvent(t *testing.T) { info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) assert.Zero(info.Deposit.Cmp(big.NewInt(0))) - assert.Zero(info.Reserve.Cmp(big.NewInt(0))) + assert.Zero(info.Reserve.FundsRemaining.Cmp(big.NewInt(0))) // If we don't care about the address, don't handle the event s := pm.RandAddress() @@ -354,21 +388,29 @@ func TestWithdrawalEvent(t *testing.T) { func TestWinningTicketTransferEvent(t *testing.T) { assert := assert.New(t) - require := require.New(t) deposit, _ := new(big.Int).SetString("10000000000000000000", 10) reserve, _ := new(big.Int).SetString("5000000000000000000", 10) startDeposit, _ := new(big.Int).SetString("10000000000000000000", 10) startReserve, _ := new(big.Int).SetString("5000000000000000000", 10) + faceValue := big.NewInt(200000000000) + senderInfo := &pm.SenderInfo{ Deposit: deposit, - Reserve: reserve, + Reserve: &pm.ReserveInfo{ + FundsRemaining: reserve, + ClaimedInCurrentRound: big.NewInt(0), + }, } lpEth := ð.StubClient{ - SenderInfo: senderInfo, + SenderInfo: senderInfo, + TranscoderAddress: stubClaimant, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) - require.Nil(err) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) + assert.Nil(err) header := defaultMiniHeader() newWinningTicketEvent := newStubWinningTicketLog() @@ -397,19 +439,18 @@ func TestWinningTicketTransferEvent(t *testing.T) { info, ok = sw.senders[stubSender] assert.True(ok) assert.Equal(info.Deposit, startDeposit) - assert.Equal(info.Reserve, startReserve) + assert.Equal(info.Reserve.FundsRemaining, startReserve) // If map entry exists parse event log // ticket amount is 200 gwei // init the map entry blockEvent.Type = blockwatch.Added - faceValue := big.NewInt(200000000000) watcher.sink <- []*blockwatch.Event{blockEvent} time.Sleep(2 * time.Millisecond) info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) assert.Zero(startDeposit.Sub(startDeposit, faceValue).Cmp(info.Deposit)) - assert.Zero(startReserve.Cmp(info.Reserve)) + assert.Zero(startReserve.Cmp(info.Reserve.FundsRemaining)) // Test facevalue > deposit senderInfo.Deposit = big.NewInt(100000000000) @@ -422,6 +463,7 @@ func TestWinningTicketTransferEvent(t *testing.T) { assert.Zero(info.Deposit.Int64()) diff := new(big.Int).Sub(faceValue, big.NewInt(100000000000)) assert.Equal(claimed, diff) + assert.Equal(diff, info.Reserve.ClaimedInCurrentRound) // If we don't care about the address, don't handle the event s := pm.RandAddress() @@ -433,24 +475,39 @@ func TestWinningTicketTransferEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) _, ok = sw.senders[s] assert.False(ok) + + // If ticket recipient is not stubClaimant, don't alter ClaimedReserve for stubClaimant + beforeClaimed, err := sw.ClaimedReserve(stubSender, stubClaimant) + randRecipient := pm.RandAddress() + var randRecipientTopic [32]byte + copy(randRecipientTopic[:], common.LeftPadBytes(randRecipient.Bytes(), 32)[:]) + blockEvent.BlockHeader.Logs[1].Topics[2] = randRecipientTopic + watcher.sink <- []*blockwatch.Event{blockEvent} + time.Sleep(2 * time.Millisecond) + afterClaimed, err := sw.ClaimedReserve(stubSender, stubClaimant) + assert.Nil(err) + assert.Equal(beforeClaimed, afterClaimed) + } -func TestReserveFrozenEvent(t *testing.T) { +func TestUnlockEvent(t *testing.T) { assert := assert.New(t) - startThawR := big.NewInt(10) + startWithdrawRound := big.NewInt(5) lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ - ThawRound: big.NewInt(10), - ReserveState: pm.Frozen, + WithdrawRound: big.NewInt(5), }, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) header := defaultMiniHeader() - newReserveFrozenEvent := newStubReserveFrozenLog() - header.Logs = append(header.Logs, newReserveFrozenEvent) + newUnlockEvent := newStubUnlockLog() + header.Logs = append(header.Logs, newUnlockEvent) blockEvent := &blockwatch.Event{ Type: blockwatch.Added, @@ -474,8 +531,7 @@ func TestReserveFrozenEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) info, ok := sw.senders[stubSender] assert.True(ok) - assert.Equal(info.ReserveState, pm.Frozen) - assert.Zero(startThawR.Cmp(info.ThawRound)) + assert.Zero(info.WithdrawRound.Cmp(startWithdrawRound)) // If map entry exists parse event log blockEvent.Type = blockwatch.Added @@ -483,37 +539,37 @@ func TestReserveFrozenEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) - assert.Equal(info.ReserveState, pm.Frozen) - expectedThawRound := new(big.Int).Add(new(big.Int).SetBytes(newReserveFrozenEvent.Data[:32]), big.NewInt(2)) - assert.Zero(expectedThawRound.Cmp(info.ThawRound)) + assert.Zero(info.WithdrawRound.Cmp(big.NewInt(150))) // If we don't care about the address, don't handle the event s := pm.RandAddress() sender := ethcommon.LeftPadBytes(s.Bytes(), 32) var senderTopic ethcommon.Hash copy(senderTopic[:], sender[:]) - newReserveFrozenEvent.Topics[1] = senderTopic + newUnlockEvent.Topics[1] = senderTopic watcher.sink <- []*blockwatch.Event{blockEvent} time.Sleep(2 * time.Millisecond) _, ok = sw.senders[s] assert.False(ok) } -func TestUnlockEvent(t *testing.T) { +func TestUnlockCancelledEvent(t *testing.T) { assert := assert.New(t) - startWithdrawBlock := big.NewInt(5) lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ - WithdrawBlock: big.NewInt(5), + WithdrawRound: big.NewInt(10), }, } watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) header := defaultMiniHeader() - newUnlockEvent := newStubUnlockLog() - header.Logs = append(header.Logs, newUnlockEvent) + newUnlockCancelledEvent := newStubUnlockCancelledLog() + header.Logs = append(header.Logs, newUnlockCancelledEvent) blockEvent := &blockwatch.Event{ Type: blockwatch.Added, @@ -537,7 +593,7 @@ func TestUnlockEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) info, ok := sw.senders[stubSender] assert.True(ok) - assert.Zero(info.WithdrawBlock.Cmp(startWithdrawBlock)) + assert.Zero(info.WithdrawRound.Cmp(big.NewInt(10))) // If map entry exists parse event log blockEvent.Type = blockwatch.Added @@ -545,75 +601,110 @@ func TestUnlockEvent(t *testing.T) { time.Sleep(2 * time.Millisecond) info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) - assert.Zero(info.WithdrawBlock.Cmp(big.NewInt(150))) + assert.Zero(info.WithdrawRound.Int64()) // If we don't care about the address, don't handle the event s := pm.RandAddress() sender := ethcommon.LeftPadBytes(s.Bytes(), 32) var senderTopic ethcommon.Hash copy(senderTopic[:], sender[:]) - newUnlockEvent.Topics[1] = senderTopic + newUnlockCancelledEvent.Topics[1] = senderTopic watcher.sink <- []*blockwatch.Event{blockEvent} time.Sleep(2 * time.Millisecond) _, ok = sw.senders[s] assert.False(ok) } -func TestUnlockCancelledEvent(t *testing.T) { +// Test RoundsWatcher Subscription log added and log removed +func TestNewRoundEvent_LogAdded(t *testing.T) { assert := assert.New(t) + require := require.New(t) lpEth := ð.StubClient{ SenderInfo: &pm.SenderInfo{ - WithdrawBlock: big.NewInt(10), + Reserve: &pm.ReserveInfo{ + ClaimedInCurrentRound: big.NewInt(1000), + }, }, + ClaimedAmount: big.NewInt(1000), } + watcher := &stubBlockWatcher{} - sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth) + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) assert.Nil(err) - header := defaultMiniHeader() - newUnlockCancelledEvent := newStubUnlockCancelledLog() - header.Logs = append(header.Logs, newUnlockCancelledEvent) + // set initial values + info, err := sw.GetSenderInfo(stubSender) + require.Nil(err) + claimed, err := sw.ClaimedReserve(stubSender, stubClaimant) + require.Nil(err) - blockEvent := &blockwatch.Event{ - Type: blockwatch.Added, - BlockHeader: header, - } + newRoundEvent := newStubNewRoundLog() go sw.Watch() defer sw.Stop() time.Sleep(2 * time.Millisecond) - // If map entry is nil don't handle event - watcher.sink <- []*blockwatch.Event{blockEvent} - time.Sleep(2 * time.Millisecond) - _, ok := sw.senders[stubSender] - assert.False(ok) + rw.sink <- newRoundEvent - // if block removed, make RPC call - blockEvent.Type = blockwatch.Removed - sw.senders[stubSender] = &pm.SenderInfo{} - watcher.sink <- []*blockwatch.Event{blockEvent} time.Sleep(2 * time.Millisecond) - info, ok := sw.senders[stubSender] - assert.True(ok) - assert.Zero(info.WithdrawBlock.Cmp(big.NewInt(10))) - // If map entry exists parse event log - blockEvent.Type = blockwatch.Added - watcher.sink <- []*blockwatch.Event{blockEvent} - time.Sleep(2 * time.Millisecond) info, err = sw.GetSenderInfo(stubSender) assert.Nil(err) - assert.Zero(info.WithdrawBlock.Int64()) + assert.Zero(info.Reserve.ClaimedInCurrentRound.Int64()) + claimed, err = sw.ClaimedReserve(stubSender, stubClaimant) + assert.Nil(err) + assert.Zero(claimed.Int64()) +} - // If we don't care about the address, don't handle the event - s := pm.RandAddress() - sender := ethcommon.LeftPadBytes(s.Bytes(), 32) - var senderTopic ethcommon.Hash - copy(senderTopic[:], sender[:]) - newUnlockCancelledEvent.Topics[1] = senderTopic - watcher.sink <- []*blockwatch.Event{blockEvent} +func TestNewRoundEvent_LogRemoved(t *testing.T) { + assert := assert.New(t) + require := require.New(t) + lpEth := ð.StubClient{ + SenderInfo: &pm.SenderInfo{ + Reserve: &pm.ReserveInfo{ + ClaimedInCurrentRound: big.NewInt(1000), + }, + }, + ClaimedAmount: big.NewInt(1000), + } + + watcher := &stubBlockWatcher{} + + rw := &stubRoundsWatcher{} + + sw, err := NewSenderWatcher(stubTicketBrokerAddr, watcher, lpEth, rw) + assert.Nil(err) + + newRoundEvent := newStubNewRoundLog() + + // set initial values + info, err := sw.GetSenderInfo(stubSender) + require.Nil(err) + claimed, err := sw.ClaimedReserve(stubSender, stubClaimant) + require.Nil(err) + + // change stub RPC call values + expectedClaimedInCurrentRound := big.NewInt(500) + expectedClaimedAmount := big.NewInt(2000) + lpEth.SenderInfo.Reserve.ClaimedInCurrentRound = expectedClaimedInCurrentRound + lpEth.ClaimedAmount = expectedClaimedAmount + + newRoundEvent.Removed = true + + go sw.Watch() + defer sw.Stop() time.Sleep(2 * time.Millisecond) - _, ok = sw.senders[s] - assert.False(ok) + + rw.sink <- newRoundEvent + time.Sleep(2 * time.Millisecond) + + info, err = sw.GetSenderInfo(stubSender) + assert.Nil(err) + assert.Equal(info.Reserve.ClaimedInCurrentRound, expectedClaimedInCurrentRound) + claimed, err = sw.ClaimedReserve(stubSender, stubClaimant) + assert.Nil(err) + assert.Equal(claimed, expectedClaimedAmount) } diff --git a/eth/watchers/stub.go b/eth/watchers/stub.go index 42c844c2cb..f6a248bb34 100644 --- a/eth/watchers/stub.go +++ b/eth/watchers/stub.go @@ -153,7 +153,7 @@ func newStubWinningTicketLog() types.Log { sender := common.LeftPadBytes(stubSender.Bytes(), 32) var senderTopic [32]byte copy(senderTopic[:], sender[:]) - recipient := common.LeftPadBytes(pm.RandAddress().Bytes(), 32) + recipient := common.LeftPadBytes(stubClaimant.Bytes(), 32) var recipientTopic [32]byte copy(recipientTopic[:], recipient[:]) log.Topics = []common.Hash{ @@ -167,27 +167,6 @@ func newStubWinningTicketLog() types.Log { return log } -func newStubReserveFrozenLog() types.Log { - log := newStubBaseLog() - log.Address = stubTicketBrokerAddr - holder := common.LeftPadBytes(stubSender.Bytes(), 32) - claimant := common.LeftPadBytes(pm.RandAddress().Bytes(), 32) - var holderTopic [32]byte - copy(holderTopic[:], holder[:]) - var claimantTopic [32]byte - copy(claimantTopic[:], claimant[:]) - log.Topics = []common.Hash{ - crypto.Keccak256Hash([]byte("ReserveFrozen(address,address,uint256,uint256)")), - holderTopic, - claimantTopic, - } - var data []byte - data = append(data, common.LeftPadBytes(big.NewInt(5).Bytes(), 32)...) - data = append(data, common.LeftPadBytes(big.NewInt(25).Bytes(), 32)...) - log.Data = data - return log -} - func newStubUnlockLog() types.Log { log := newStubBaseLog() log.Address = stubTicketBrokerAddr @@ -315,3 +294,14 @@ func defaultMiniHeader() *blockwatch.MiniHeader { block.Logs = []types.Log{log} return block } + +type stubRoundsWatcher struct { + sink chan<- types.Log + sub *stubSubscription +} + +func (rw *stubRoundsWatcher) Subscribe(sink chan<- types.Log) event.Subscription { + rw.sink = sink + rw.sub = &stubSubscription{errCh: make(<-chan error)} + return rw.sub +} diff --git a/eth/watchers/types.go b/eth/watchers/types.go index 23ad32b501..c7327e86bc 100644 --- a/eth/watchers/types.go +++ b/eth/watchers/types.go @@ -1,6 +1,7 @@ package watchers import ( + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" "github.com/livepeer/go-livepeer/eth/blockwatch" ) @@ -8,3 +9,7 @@ import ( type BlockWatcher interface { Subscribe(sink chan<- []*blockwatch.Event) event.Subscription } + +type EventWatcher interface { + Subscribe(sink chan<- types.Log) event.Subscription +} diff --git a/go.mod b/go.mod index 14e7992684..c67cd4b11c 100644 --- a/go.mod +++ b/go.mod @@ -3,112 +3,66 @@ module github.com/livepeer/go-livepeer go 1.13 require ( - cloud.google.com/go v0.38.0 contrib.go.opencensus.io/exporter/prometheus v0.1.0 - github.com/BurntSushi/toml v0.3.1 - github.com/OneOfOne/xxhash v1.2.2 - github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc - github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf - github.com/allegro/bigcache v1.2.1 - github.com/apilayer/freegeoip v3.5.0+incompatible - github.com/aristanetworks/goarista v0.0.0-20190909155222-05df9ecbb0dc + github.com/allegro/bigcache v1.2.1 // indirect + github.com/apilayer/freegeoip v3.5.0+incompatible // indirect + github.com/aristanetworks/goarista v0.0.0-20190909155222-05df9ecbb0dc // indirect github.com/aws/aws-sdk-go v1.23.19 github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 // indirect github.com/cenkalti/backoff v2.2.1+incompatible - github.com/cespare/cp v1.1.1 - github.com/cespare/xxhash v1.1.0 - github.com/chzyer/logex v1.1.10 - github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e - github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 - github.com/client9/misspell v0.3.4 - github.com/deckarep/golang-set v1.7.1 - github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 + github.com/cespare/cp v1.1.1 // indirect + github.com/deckarep/golang-set v1.7.1 // indirect github.com/docker/docker v1.13.1 // indirect - github.com/edsrzf/mmap-go v1.0.0 - github.com/elastic/gosigar v0.10.5 + github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/elastic/gosigar v0.10.5 // indirect github.com/ethereum/go-ethereum v1.9.3 - github.com/fatih/color v1.7.0 + github.com/fatih/color v1.7.0 // indirect // replace example.com/some/dependency => example.com/some/dependency-fork v1.2.3 - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 + github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect // github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect - github.com/gballet/go-libpcsclite v0.0.0-20190403181518-312b5175032f - github.com/go-logfmt/logfmt v0.4.0 - github.com/go-stack/stack v1.8.0 + github.com/gballet/go-libpcsclite v0.0.0-20190403181518-312b5175032f // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b - github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 github.com/golang/protobuf v1.3.2 - github.com/golang/snappy v0.0.1 - github.com/google/btree v1.0.0 - github.com/google/gofuzz v1.0.0 - github.com/google/martian v2.1.0+incompatible - github.com/google/uuid v1.0.0 - github.com/googleapis/gax-go v2.0.2+incompatible - github.com/googleapis/gax-go/v2 v2.0.5 - github.com/gorilla/websocket v1.4.1 - github.com/hashicorp/golang-lru v0.5.3 - github.com/howeyc/fsnotify v0.9.0 - github.com/huin/goupnp v1.0.0 - github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 - github.com/influxdata/influxdb v1.7.8 - github.com/jackpal/go-nat-pmp v1.0.1 - github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af - github.com/json-iterator/go v1.1.7 - github.com/julienschmidt/httprouter v1.2.0 + github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/howeyc/fsnotify v0.9.0 // indirect + github.com/huin/goupnp v1.0.0 // indirect + github.com/influxdata/influxdb v1.7.8 // indirect + github.com/jackpal/go-nat-pmp v1.0.1 // indirect github.com/karalabe/hid v1.0.0 // indirect - github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 github.com/kr/pretty v0.1.0 // indirect - github.com/livepeer/joy4 v0.1.1 github.com/livepeer/lpms v0.0.0-20191004153601-83352b59757e github.com/livepeer/m3u8 v0.11.0 - github.com/mattn/go-colorable v0.1.2 - github.com/mattn/go-isatty v0.0.8 - github.com/mattn/go-runewidth v0.0.3 + github.com/mattn/go-colorable v0.1.2 // indirect github.com/mattn/go-sqlite3 v1.11.0 - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd - github.com/modern-go/reflect2 v1.0.1 - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 - github.com/oklog/ulid v1.3.1 + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/olekukonko/tablewriter v0.0.1 - github.com/oschwald/maxminddb-golang v1.5.0 - github.com/pborman/uuid v1.2.0 - github.com/peterh/liner v1.1.0 + github.com/oschwald/maxminddb-golang v1.5.0 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/peterh/liner v1.1.0 // indirect github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 - github.com/prometheus/procfs v0.0.3 - github.com/prometheus/tsdb v0.10.0 - github.com/rjeczalik/notify v0.9.2 - github.com/robertkrimen/otto v0.0.0-20180617131154-15f95af6e78d - github.com/rs/cors v1.7.0 - github.com/sirupsen/logrus v1.2.0 - github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 - github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 - github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 - github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 - github.com/stretchr/objx v0.2.0 + github.com/prometheus/tsdb v0.10.0 // indirect + github.com/rjeczalik/notify v0.9.2 // indirect + github.com/robertkrimen/otto v0.0.0-20180617131154-15f95af6e78d // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 // indirect + github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect + github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect + github.com/stretchr/objx v0.2.0 // indirect github.com/stretchr/testify v1.4.0 github.com/syndtr/goleveldb v1.0.0 // indirect - github.com/tyler-smith/go-bip39 v1.0.2 + github.com/tyler-smith/go-bip39 v1.0.2 // indirect github.com/urfave/cli v1.20.0 - github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 + github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect go.opencensus.io v0.22.1 - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/lint v0.0.0-20190409202823-959b441ac422 golang.org/x/net v0.0.0-20190909003024-a7b16738d86b - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - golang.org/x/text v0.3.2 - google.golang.org/api v0.10.0 - google.golang.org/appengine v1.5.0 + google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect google.golang.org/grpc v1.23.0 - gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 - gopkg.in/fatih/set.v0 v0.2.1 - gopkg.in/natefinch/lumberjack.v2 v2.0.0 - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff // indirect - gopkg.in/sourcemap.v1 v1.0.5 + gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/urfave/cli.v1 v1.0.0-00010101000000-000000000000 // indirect - gopkg.in/yaml.v2 v2.2.2 ) replace github.com/ethereum/go-ethereum => github.com/livepeer/go-ethereum v1.8.4-0.20190523183241-7e95cbcfcd82 diff --git a/go.sum b/go.sum index 7a0c4b6caf..7f376ab599 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,7 @@ cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= contrib.go.opencensus.io/exporter/prometheus v0.1.0 h1:SByaIoWwNgMdPSgl5sMqM2KDE5H/ukPWBRo314xiDvg= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -41,12 +37,6 @@ github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= @@ -86,38 +76,21 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/howeyc/fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY= @@ -127,8 +100,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/influxdata/influxdb v1.7.8 h1:oXd5TjXzU1b+xyFaH/8Ij+nCoUgyuO3ZDpgCuo62yg0= github.com/influxdata/influxdb v1.7.8/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA= @@ -140,8 +111,6 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karalabe/hid v1.0.0 h1:+/CIMNXhSU/zIJgnIvBD2nKHxS/bnRHhhs9xBryLpPo= @@ -244,7 +213,6 @@ github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8 github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -273,30 +241,22 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jKqfv2zpuSqZLgdm7ZmjI= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190909003024-a7b16738d86b h1:XfVGCX+0T4WOStkaOsJRllbsiImhB2jgVBGc9L0lPGc= golang.org/x/net v0.0.0-20190909003024-a7b16738d86b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -311,33 +271,21 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.10.0 h1:7tmAxx3oKE98VMZ+SBZzvYYWRQ9HODBxmC8mXUsraSQ= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg= @@ -351,12 +299,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fatih/set.v0 v0.2.1 h1:Xvyyp7LXu34P0ROhCyfXkmQCAoOUKb1E2JS9I7SE5CY= -gopkg.in/fatih/set.v0 v0.2.1/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff h1:uuol9OUzSvZntY1v963NAbVd7A+PHLMz1FlCe3Lorcs= @@ -369,7 +313,5 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pm/broker.go b/pm/broker.go index 8b089c0fe8..2829a91599 100644 --- a/pm/broker.go +++ b/pm/broker.go @@ -7,38 +7,25 @@ import ( "github.com/ethereum/go-ethereum/core/types" ) -// ReserveState represents the state of a reserve -type ReserveState uint8 - -const ( - // NotFrozen is the state when the reserve is not frozen - NotFrozen ReserveState = iota - - // Frozen is the state when the reserve has been frozen but not yet thawed - Frozen - - // Thawed is the state when the reserve was frozen and is now thawed (i.e. the freeze period is over) - Thawed -) - // SenderInfo contains information about a sender tracked by a Broker type SenderInfo struct { // Deposit is the amount of funds the sender has in its deposit Deposit *big.Int - // WithdrawBlock is the block that the sender can withdraw its deposit and reserve if - // the reserve has not been frozen - WithdrawBlock *big.Int + // WithdrawRound is the round that the sender can withdraw its deposit and reserve + WithdrawRound *big.Int - // Reserve is the amount of funds the sender has in its reserve - Reserve *big.Int + // ReserveInfo is a struct containing details about a sender's reserve + Reserve *ReserveInfo +} - // ReserveState is the state of the sender's reserve - ReserveState ReserveState +// ReserveInfo holds information about a sender's reserve +type ReserveInfo struct { + // FundsRemaining is the amount of funds the sender has left in its reserve + FundsRemaining *big.Int - // ThawRound is the round that the sender can withdraw its deposit and reserve if - // the reserve has been frozen - ThawRound *big.Int + // ClaimedInCurrentRound is the total amount of funds claimed from the sender's reserve in the current round + ClaimedInCurrentRound *big.Int } // Broker is an interface which serves as an abstraction over an on-chain diff --git a/pm/sendermonitor.go b/pm/sendermonitor.go index 4a5e6682d0..c9d391e994 100644 --- a/pm/sendermonitor.go +++ b/pm/sendermonitor.go @@ -201,7 +201,8 @@ func (sm *senderMonitor) reserveAlloc(addr ethcommon.Address) (*big.Int, error) if poolSize.Cmp(big.NewInt(0)) == 0 { return big.NewInt(0), nil } - return new(big.Int).Sub(new(big.Int).Div(info.Reserve, poolSize), claimed), nil + reserve := new(big.Int).Add(info.Reserve.FundsRemaining, info.Reserve.ClaimedInCurrentRound) + return new(big.Int).Sub(new(big.Int).Div(reserve, poolSize), claimed), nil } // ensureCache is a helper that checks if a remote sender is initialized diff --git a/pm/sendermonitor_test.go b/pm/sendermonitor_test.go index 021d78807d..96d2a85a5c 100644 --- a/pm/sendermonitor_test.go +++ b/pm/sendermonitor_test.go @@ -29,10 +29,11 @@ func TestMaxFloat(t *testing.T) { addr := RandAddress() smgr.info[addr] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(500), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(500), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr] = big.NewInt(100) rm.transcoderPoolSize = big.NewInt(50) @@ -51,10 +52,11 @@ func TestMaxFloat(t *testing.T) { // Test value cached smgr.err = nil - reserve := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) + reserve := new(big.Int).Add(smgr.info[addr].Reserve.FundsRemaining, smgr.info[addr].Reserve.ClaimedInCurrentRound) + reserveAlloc := new(big.Int).Sub(new(big.Int).Div(reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) mf, err := sm.MaxFloat(addr) - assert.Equal(reserve, mf) + assert.Equal(reserveAlloc, mf) } func TestSubFloat(t *testing.T) { @@ -62,10 +64,11 @@ func TestSubFloat(t *testing.T) { addr := RandAddress() smgr.info[addr] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(500), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(500), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr] = big.NewInt(100) rm.transcoderPoolSize = big.NewInt(50) @@ -76,13 +79,14 @@ func TestSubFloat(t *testing.T) { assert := assert.New(t) require := require.New(t) - reserve := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) + reserve := new(big.Int).Add(smgr.info[addr].Reserve.FundsRemaining, smgr.info[addr].Reserve.ClaimedInCurrentRound) + reserveAlloc := new(big.Int).Sub(new(big.Int).Div(reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) amount := big.NewInt(5) sm.SubFloat(addr, amount) mf, err := sm.MaxFloat(addr) require.Nil(err) - assert.Equal(new(big.Int).Sub(reserve, amount), mf) + assert.Equal(new(big.Int).Sub(reserveAlloc, amount), mf) assert.True(em.AcceptErr(claimant)) @@ -94,7 +98,7 @@ func TestSubFloat(t *testing.T) { mf, err = sm.MaxFloat(addr) require.Nil(err) assert.Equal( - new(big.Int).Sub(reserve, new(big.Int).Mul(amount, big.NewInt(2))), + new(big.Int).Sub(reserveAlloc, new(big.Int).Mul(amount, big.NewInt(2))), mf, ) @@ -106,10 +110,11 @@ func TestAddFloat(t *testing.T) { addr := RandAddress() smgr.info[addr] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(500), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(500), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr] = big.NewInt(100) rm.transcoderPoolSize = big.NewInt(1) @@ -131,7 +136,8 @@ func TestAddFloat(t *testing.T) { // Test value not cached and insufficient pendingAmount error smgr.err = nil - reserve := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) + reserve := new(big.Int).Add(smgr.info[addr].Reserve.FundsRemaining, smgr.info[addr].Reserve.ClaimedInCurrentRound) + reserveAlloc := new(big.Int).Sub(new(big.Int).Div(reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) amount := big.NewInt(20) err = sm.AddFloat(addr, amount) @@ -146,11 +152,12 @@ func TestAddFloat(t *testing.T) { mf, err := sm.MaxFloat(addr) require.Nil(err) - assert.Equal(mf, reserve) + assert.Equal(mf, reserveAlloc) // Test cached value update - smgr.info[addr].Reserve = big.NewInt(1000) - reserve = new(big.Int).Sub(new(big.Int).Div(smgr.info[addr].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) + smgr.info[addr].Reserve.FundsRemaining = big.NewInt(1000) + reserve = new(big.Int).Add(smgr.info[addr].Reserve.FundsRemaining, smgr.info[addr].Reserve.ClaimedInCurrentRound) + reserveAlloc = new(big.Int).Sub(new(big.Int).Div(reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) sm.SubFloat(addr, amount) @@ -162,7 +169,7 @@ func TestAddFloat(t *testing.T) { mf, err = sm.MaxFloat(addr) require.Nil(err) - assert.Equal(reserve, mf) + assert.Equal(reserveAlloc, mf) assert.True(em.acceptable) } @@ -171,10 +178,11 @@ func TestQueueTicketAndSignalMaxFloat(t *testing.T) { addr := RandAddress() smgr.info[addr] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(5000), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(5000), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr] = big.NewInt(100) sm := NewSenderMonitor(claimant, b, smgr, rm, 5*time.Minute, 3600, em) @@ -206,10 +214,11 @@ func TestQueueTicketAndSignalMaxFloat(t *testing.T) { addr2 := RandAddress() smgr.info[addr2] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(5000), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(5000), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr2] = big.NewInt(100) @@ -254,18 +263,20 @@ func TestCleanup(t *testing.T) { addr2 := RandAddress() smgr.info[addr1] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(500), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(500), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr1] = big.NewInt(100) smgr.info[addr2] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(500), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(500), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr2] = big.NewInt(100) @@ -291,18 +302,20 @@ func TestCleanup(t *testing.T) { reserve2 := big.NewInt(1000) smgr.info[addr1] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: reserve2, - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: reserve2, + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr1] = big.NewInt(100) smgr.info[addr2] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: reserve2, - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: reserve2, + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr2] = big.NewInt(100) @@ -311,7 +324,8 @@ func TestCleanup(t *testing.T) { mf2, err := sm.MaxFloat(addr2) require.Nil(err) - expectedAlloc := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr1].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr1]) + expectedReserve := new(big.Int).Add(smgr.info[addr1].Reserve.FundsRemaining, smgr.info[addr1].Reserve.ClaimedInCurrentRound) + expectedAlloc := new(big.Int).Sub(new(big.Int).Div(expectedReserve, rm.transcoderPoolSize), smgr.claimedReserve[addr1]) assert.Equal(expectedAlloc, mf1) assert.Equal(expectedAlloc, mf2) @@ -331,7 +345,7 @@ func TestCleanup(t *testing.T) { // - Use cached value for addr1 because it was accessed recently via MaxFloat() // - Use new value for addr2 because it was cleaned up reserve3 := big.NewInt(100) - smgr.info[addr2].Reserve = reserve3 + smgr.info[addr2].Reserve.FundsRemaining = reserve3 sm.(*senderMonitor).cleanup() @@ -340,7 +354,8 @@ func TestCleanup(t *testing.T) { mf2, err = sm.MaxFloat(addr2) require.Nil(err) - expectedAlloc2 := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr2].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr2]) + expectedReserve2 := new(big.Int).Add(smgr.info[addr2].Reserve.FundsRemaining, smgr.info[addr2].Reserve.ClaimedInCurrentRound) + expectedAlloc2 := new(big.Int).Sub(new(big.Int).Div(expectedReserve2, rm.transcoderPoolSize), smgr.claimedReserve[addr2]) assert.Equal(expectedAlloc, mf1) assert.Equal(expectedAlloc2, mf2) @@ -359,7 +374,7 @@ func TestCleanup(t *testing.T) { // - Use new value for addr1 because it was cleaned up // - Use cached value for addr2 because it was accessed recently via AddFloat() reserve4 := big.NewInt(101) - smgr.info[addr1].Reserve = reserve4 + smgr.info[addr1].Reserve.FundsRemaining = reserve4 sm.(*senderMonitor).cleanup() @@ -368,7 +383,8 @@ func TestCleanup(t *testing.T) { mf2, err = sm.MaxFloat(addr2) require.Nil(err) - expectedAlloc3 := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr1].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr1]) + expectedReserve3 := new(big.Int).Add(smgr.info[addr1].Reserve.FundsRemaining, smgr.info[addr1].Reserve.ClaimedInCurrentRound) + expectedAlloc3 := new(big.Int).Sub(new(big.Int).Div(expectedReserve3, rm.transcoderPoolSize), smgr.claimedReserve[addr1]) assert.Equal(expectedAlloc3, mf1) assert.Equal(expectedAlloc2, mf2) @@ -387,7 +403,7 @@ func TestCleanup(t *testing.T) { // - Use cached value for addr1 because it was accessed recently via SubFloat() // - Use new value for addr2 because it was cleaned up reserve5 := big.NewInt(999) - smgr.info[addr2].Reserve = reserve5 + smgr.info[addr2].Reserve.FundsRemaining = reserve5 sm.(*senderMonitor).cleanup() @@ -396,7 +412,8 @@ func TestCleanup(t *testing.T) { mf2, err = sm.MaxFloat(addr2) require.Nil(err) - expectedAlloc4 := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr2].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr2]) + expectedReserve4 := new(big.Int).Add(smgr.info[addr2].Reserve.FundsRemaining, smgr.info[addr2].Reserve.ClaimedInCurrentRound) + expectedAlloc4 := new(big.Int).Sub(new(big.Int).Div(expectedReserve4, rm.transcoderPoolSize), smgr.claimedReserve[addr2]) assert.Equal(expectedAlloc3, mf1) assert.Equal(expectedAlloc4, mf2) } @@ -407,10 +424,11 @@ func TestReserveAlloc(t *testing.T) { addr := RandAddress() smgr.info[addr] = &SenderInfo{ Deposit: big.NewInt(500), - Reserve: big.NewInt(5000), - WithdrawBlock: big.NewInt(0), - ReserveState: NotFrozen, - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &ReserveInfo{ + FundsRemaining: big.NewInt(5000), + ClaimedInCurrentRound: big.NewInt(0), + }, } smgr.claimedReserve[addr] = big.NewInt(100) sm := NewSenderMonitor(claimant, b, smgr, rm, 5*time.Minute, 3600, em).(*senderMonitor) @@ -421,7 +439,8 @@ func TestReserveAlloc(t *testing.T) { assert.EqualError(err, smgr.err.Error()) // test reserveAlloc correctly calculated smgr.err = nil - expectedAlloc := new(big.Int).Sub(new(big.Int).Div(smgr.info[addr].Reserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) + expectedReserve := new(big.Int).Add(smgr.info[addr].Reserve.FundsRemaining, smgr.info[addr].Reserve.ClaimedInCurrentRound) + expectedAlloc := new(big.Int).Sub(new(big.Int).Div(expectedReserve, rm.transcoderPoolSize), smgr.claimedReserve[addr]) alloc, err := sm.reserveAlloc(addr) assert.Nil(err) assert.Zero(expectedAlloc.Cmp(alloc)) diff --git a/server/handlers.go b/server/handlers.go index 53d72c219c..d650a5b94c 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -218,10 +218,11 @@ func senderInfoHandler(client eth.LivepeerEthClient) http.Handler { if err.Error() == "ErrNoResult" { info = &pm.SenderInfo{ Deposit: big.NewInt(0), - WithdrawBlock: big.NewInt(0), - Reserve: big.NewInt(0), - ReserveState: pm.ReserveState(0), - ThawRound: big.NewInt(0), + WithdrawRound: big.NewInt(0), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(0), + ClaimedInCurrentRound: big.NewInt(0), + }, } } else { respondWith500(w, fmt.Sprintf("could not query sender info: %v", err)) diff --git a/server/handlers_test.go b/server/handlers_test.go index 1f56fee537..08a7739696 100644 --- a/server/handlers_test.go +++ b/server/handlers_test.go @@ -511,7 +511,7 @@ func TestSenderInfoHandler_GetSenderInfoErrNoResult(t *testing.T) { assert := assert.New(t) assert.Equal(http.StatusOK, resp.StatusCode) - assert.Equal("{\"Deposit\":0,\"WithdrawBlock\":0,\"Reserve\":0,\"ReserveState\":0,\"ThawRound\":0}", strings.TrimSpace(string(body))) + assert.Equal("{\"Deposit\":0,\"WithdrawRound\":0,\"Reserve\":{\"FundsRemaining\":0,\"ClaimedInCurrentRound\":0}}", strings.TrimSpace(string(body))) } func TestSenderInfoHandler_GetSenderInfoOtherError(t *testing.T) { @@ -537,11 +537,11 @@ func TestSenderInfoHandler_Success(t *testing.T) { mockInfo := &pm.SenderInfo{ Deposit: big.NewInt(0), - WithdrawBlock: big.NewInt(102), - Reserve: big.NewInt(104), - ReserveState: pm.ReserveState(1), - ThawRound: big.NewInt(2), - } + WithdrawRound: big.NewInt(102), + Reserve: &pm.ReserveInfo{ + FundsRemaining: big.NewInt(104), + ClaimedInCurrentRound: big.NewInt(0), + }} client.On("Account").Return(accounts.Account{Address: addr}) client.On("GetSenderInfo", addr).Return(mockInfo, nil) @@ -556,10 +556,8 @@ func TestSenderInfoHandler_Success(t *testing.T) { assert := assert.New(t) assert.Equal(http.StatusOK, resp.StatusCode) assert.Equal(mockInfo.Deposit, info.Deposit) - assert.Equal(mockInfo.WithdrawBlock, info.WithdrawBlock) + assert.Equal(mockInfo.WithdrawRound, info.WithdrawRound) assert.Equal(mockInfo.Reserve, info.Reserve) - assert.Equal(mockInfo.ReserveState, info.ReserveState) - assert.Equal(mockInfo.ThawRound, info.ThawRound) } func TestTicketBrokerParamsHandler_MissingClient(t *testing.T) { diff --git a/server/webserver.go b/server/webserver.go index dd0075778c..90b6a89616 100644 --- a/server/webserver.go +++ b/server/webserver.go @@ -305,9 +305,9 @@ func (s *LivepeerServer) cliWebServerHandlers(bindAddr string) *http.ServeMux { } } - glog.Infof("Registering orchestrator %v", s.LivepeerNode.Eth.Account().Address.Hex()) + glog.Infof("Setting orchestrator commission rates %v", s.LivepeerNode.Eth.Account().Address.Hex()) - tx, err := s.LivepeerNode.Eth.Transcoder(eth.FromPerc(blockRewardCut), eth.FromPerc(feeShare), big.NewInt(0)) + tx, err := s.LivepeerNode.Eth.Transcoder(eth.FromPerc(blockRewardCut), eth.FromPerc(feeShare)) if err != nil { glog.Error(err) return @@ -366,32 +366,30 @@ func (s *LivepeerServer) cliWebServerHandlers(bindAddr string) *http.ServeMux { return } - serviceURI := r.FormValue("serviceURI") - if _, err := url.ParseRequestURI(serviceURI); err != nil { + glog.Infof("Setting orchestrator commission rates %v", s.LivepeerNode.Eth.Account().Address.Hex()) + + tx, err := s.LivepeerNode.Eth.Transcoder(eth.FromPerc(blockRewardCut), eth.FromPerc(feeShare)) + if err != nil { glog.Error(err) return } - t, err := s.LivepeerNode.Eth.GetTranscoder(s.LivepeerNode.Eth.Account().Address) + err = s.LivepeerNode.Eth.CheckTx(tx) if err != nil { glog.Error(err) return } - if t.PendingRewardCut.Cmp(eth.FromPerc(blockRewardCut)) != 0 || t.PendingFeeShare.Cmp(eth.FromPerc(feeShare)) != 0 { - glog.Infof("Setting orchestrator config - Reward Cut: %v Fee Share: %v Price: %v", eth.FromPerc(blockRewardCut), eth.FromPerc(feeShare), big.NewInt(0)) - - tx, err := s.LivepeerNode.Eth.Transcoder(eth.FromPerc(blockRewardCut), eth.FromPerc(feeShare), big.NewInt(0)) - if err != nil { - glog.Error(err) - return - } + serviceURI := r.FormValue("serviceURI") + if _, err := url.ParseRequestURI(serviceURI); err != nil { + glog.Error(err) + return + } - err = s.LivepeerNode.Eth.CheckTx(tx) - if err != nil { - glog.Error(err) - return - } + t, err := s.LivepeerNode.Eth.GetTranscoder(s.LivepeerNode.Eth.Account().Address) + if err != nil { + glog.Error(err) + return } if t.ServiceURI != serviceURI { @@ -786,7 +784,7 @@ func (s *LivepeerServer) cliWebServerHandlers(bindAddr string) *http.ServeMux { if s.LivepeerNode.Eth != nil { lp := s.LivepeerNode.Eth - numActiveOrchestrators, err := lp.NumActiveTranscoders() + numActiveOrchestrators, err := lp.GetTranscoderPoolMaxSize() if err != nil { glog.Error(err) return