diff --git a/.gitignore b/.gitignore
index 9e054bad1b..0763d8492c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,4 +38,4 @@ profile.cov
/dashboard/assets/flow-typed
/dashboard/assets/node_modules
/dashboard/assets/stats.json
-/dashboard/assets/public/bundle.js
+/dashboard/assets/bundle.js
diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go
index cbcf4ca924..abcb403db2 100644
--- a/accounts/abi/abi.go
+++ b/accounts/abi/abi.go
@@ -97,7 +97,6 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
Type string
Name string
Constant bool
- Indexed bool
Anonymous bool
Inputs []Argument
Outputs []Argument
diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go
index a7ca7bfc00..ca60cc1b43 100644
--- a/accounts/abi/bind/backend.go
+++ b/accounts/abi/bind/backend.go
@@ -52,12 +52,6 @@ type ContractCaller interface {
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
}
-// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
-type DeployBackend interface {
- TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
-}
-
// PendingContractCaller defines methods to perform contract calls on the pending state.
// Call will try to discover this interface when access to the pending state is requested.
// If the backend does not support the pending state, Call returns ErrNoPendingState.
@@ -90,8 +84,29 @@ type ContractTransactor interface {
SendTransaction(ctx context.Context, tx *types.Transaction) error
}
+// ContractFilterer defines the methods needed to access log events using one-off
+// queries or continuous event subscriptions.
+type ContractFilterer interface {
+ // FilterLogs executes a log filter operation, blocking during execution and
+ // returning all the results in one batch.
+ //
+ // TODO(karalabe): Deprecate when the subscription one can return past data too.
+ FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
+
+ // SubscribeFilterLogs creates a background log filtering operation, returning
+ // a subscription immediately, which can be used to stream the found events.
+ SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
+}
+
+// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
+type DeployBackend interface {
+ TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
+ CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
+}
+
// ContractBackend defines the methods needed to work with contracts on a read-write basis.
type ContractBackend interface {
ContractCaller
ContractTransactor
+ ContractFilterer
}
diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go
index 81c32e4211..1803d3f236 100644
--- a/accounts/abi/bind/backends/simulated.go
+++ b/accounts/abi/bind/backends/simulated.go
@@ -30,11 +30,15 @@ import (
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
+ "github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
+ "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
+ "github.com/ethereum/go-ethereum/rpc"
)
// This nil assignment ensures compile time that SimulatedBackend implements bind.ContractBackend.
@@ -53,6 +57,8 @@ type SimulatedBackend struct {
pendingBlock *types.Block // Currently pending block that will be imported on request
pendingState *state.StateDB // Currently pending state that will be the active on on request
+ events *filters.EventSystem // Event system for filtering log events live
+
config *params.ChainConfig
}
@@ -63,7 +69,13 @@ func NewSimulatedBackend(alloc core.GenesisAlloc) *SimulatedBackend {
genesis := core.Genesis{Config: params.AllEthashProtocolChanges, Alloc: alloc}
genesis.MustCommit(database)
blockchain, _ := core.NewBlockChain(database, genesis.Config, ethash.NewFaker(), vm.Config{})
- backend := &SimulatedBackend{database: database, blockchain: blockchain, config: genesis.Config}
+
+ backend := &SimulatedBackend{
+ database: database,
+ blockchain: blockchain,
+ config: genesis.Config,
+ events: filters.NewEventSystem(new(event.TypeMux), &filterBackend{database, blockchain}, false),
+ }
backend.rollback()
return backend
}
@@ -248,7 +260,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
return hi, nil
}
-// callContract implemens common code between normal and pending contract calls.
+// callContract implements common code between normal and pending contract calls.
// state is modified during execution, make sure to copy it if necessary.
func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, statedb *state.StateDB) ([]byte, uint64, bool, error) {
// Ensure message is initialized properly.
@@ -302,7 +314,69 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
return nil
}
-// JumpTimeInSeconds adds skip seconds to the clock
+// FilterLogs executes a log filter operation, blocking during execution and
+// returning all the results in one batch.
+//
+// TODO(karalabe): Deprecate when the subscription one can return past data too.
+func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
+ // Initialize unset filter boundaried to run from genesis to chain head
+ from := int64(0)
+ if query.FromBlock != nil {
+ from = query.FromBlock.Int64()
+ }
+ to := int64(-1)
+ if query.ToBlock != nil {
+ to = query.ToBlock.Int64()
+ }
+ // Construct and execute the filter
+ filter := filters.New(&filterBackend{b.database, b.blockchain}, from, to, query.Addresses, query.Topics)
+
+ logs, err := filter.Logs(ctx)
+ if err != nil {
+ return nil, err
+ }
+ res := make([]types.Log, len(logs))
+ for i, log := range logs {
+ res[i] = *log
+ }
+ return res, nil
+}
+
+// SubscribeFilterLogs creates a background log filtering operation, returning a
+// subscription immediately, which can be used to stream the found events.
+func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
+ // Subscribe to contract events
+ sink := make(chan []*types.Log)
+
+ sub, err := b.events.SubscribeLogs(query, sink)
+ if err != nil {
+ return nil, err
+ }
+ // Since we're getting logs in batches, we need to flatten them into a plain stream
+ return event.NewSubscription(func(quit <-chan struct{}) error {
+ defer sub.Unsubscribe()
+ for {
+ select {
+ case logs := <-sink:
+ for _, log := range logs {
+ select {
+ case ch <- *log:
+ case err := <-sub.Err():
+ return err
+ case <-quit:
+ return nil
+ }
+ }
+ case err := <-sub.Err():
+ return err
+ case <-quit:
+ return nil
+ }
+ }
+ }), nil
+}
+
+// AdjustTime adds a time shift to the simulated clock.
func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error {
b.mu.Lock()
defer b.mu.Unlock()
@@ -331,3 +405,44 @@ func (m callmsg) GasPrice() *big.Int { return m.CallMsg.GasPrice }
func (m callmsg) Gas() uint64 { return m.CallMsg.Gas }
func (m callmsg) Value() *big.Int { return m.CallMsg.Value }
func (m callmsg) Data() []byte { return m.CallMsg.Data }
+
+// filterBackend implements filters.Backend to support filtering for logs without
+// taking bloom-bits acceleration structures into account.
+type filterBackend struct {
+ db ethdb.Database
+ bc *core.BlockChain
+}
+
+func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
+func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }
+
+func (fb *filterBackend) HeaderByNumber(ctx context.Context, block rpc.BlockNumber) (*types.Header, error) {
+ if block == rpc.LatestBlockNumber {
+ return fb.bc.CurrentHeader(), nil
+ }
+ return fb.bc.GetHeaderByNumber(uint64(block.Int64())), nil
+}
+func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
+ return core.GetBlockReceipts(fb.db, hash, core.GetBlockNumber(fb.db, hash)), nil
+}
+
+func (fb *filterBackend) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) event.Subscription {
+ return event.NewSubscription(func(quit <-chan struct{}) error {
+ <-quit
+ return nil
+ })
+}
+func (fb *filterBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
+ return fb.bc.SubscribeChainEvent(ch)
+}
+func (fb *filterBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
+ return fb.bc.SubscribeRemovedLogsEvent(ch)
+}
+func (fb *filterBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
+ return fb.bc.SubscribeLogsEvent(ch)
+}
+
+func (fb *filterBackend) BloomStatus() (uint64, uint64) { return 4096, 0 }
+func (fb *filterBackend) ServiceFilter(ctx context.Context, ms *bloombits.MatcherSession) {
+ panic("not supported")
+}
diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go
index 2bd683f22f..83ad1c8ae7 100644
--- a/accounts/abi/bind/base.go
+++ b/accounts/abi/bind/base.go
@@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/event"
)
// SignerFn is a signer function callback when a contract requires a method to
@@ -55,6 +56,22 @@ type TransactOpts struct {
Context context.Context // Network context to support cancellation and timeouts (nil = no timeout)
}
+// FilterOpts is the collection of options to fine tune filtering for events
+// within a bound contract.
+type FilterOpts struct {
+ Start uint64 // Start of the queried range
+ End *uint64 // End of the range (nil = latest)
+
+ Context context.Context // Network context to support cancellation and timeouts (nil = no timeout)
+}
+
+// WatchOpts is the collection of options to fine tune subscribing for events
+// within a bound contract.
+type WatchOpts struct {
+ Start *uint64 // Start of the queried range (nil = latest)
+ Context context.Context // Network context to support cancellation and timeouts (nil = no timeout)
+}
+
// BoundContract is the base wrapper object that reflects a contract on the
// Ethereum network. It contains a collection of methods that are used by the
// higher level contract bindings to operate.
@@ -63,16 +80,18 @@ type BoundContract struct {
abi abi.ABI // Reflect based ABI to access the correct Ethereum methods
caller ContractCaller // Read interface to interact with the blockchain
transactor ContractTransactor // Write interface to interact with the blockchain
+ filterer ContractFilterer // Event filtering to interact with the blockchain
}
// NewBoundContract creates a low level contract interface through which calls
// and transactions may be made through.
-func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller, transactor ContractTransactor) *BoundContract {
+func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller, transactor ContractTransactor, filterer ContractFilterer) *BoundContract {
return &BoundContract{
address: address,
abi: abi,
caller: caller,
transactor: transactor,
+ filterer: filterer,
}
}
@@ -80,7 +99,7 @@ func NewBoundContract(address common.Address, abi abi.ABI, caller ContractCaller
// deployment address with a Go wrapper.
func DeployContract(opts *TransactOpts, abi abi.ABI, bytecode []byte, backend ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error) {
// Otherwise try to deploy the contract
- c := NewBoundContract(common.Address{}, abi, backend, backend)
+ c := NewBoundContract(common.Address{}, abi, backend, backend, backend)
input, err := c.abi.Pack("", params...)
if err != nil {
@@ -225,6 +244,104 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
return signedTx, nil
}
+// FilterLogs filters contract logs for past blocks, returning the necessary
+// channels to construct a strongly typed bound iterator on top of them.
+func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error) {
+ // Don't crash on a lazy user
+ if opts == nil {
+ opts = new(FilterOpts)
+ }
+ // Append the event selector to the query parameters and construct the topic set
+ query = append([][]interface{}{{c.abi.Events[name].Id()}}, query...)
+
+ topics, err := makeTopics(query...)
+ if err != nil {
+ return nil, nil, err
+ }
+ // Start the background filtering
+ logs := make(chan types.Log, 128)
+
+ config := ethereum.FilterQuery{
+ Addresses: []common.Address{c.address},
+ Topics: topics,
+ FromBlock: new(big.Int).SetUint64(opts.Start),
+ }
+ if opts.End != nil {
+ config.ToBlock = new(big.Int).SetUint64(*opts.End)
+ }
+ /* TODO(karalabe): Replace the rest of the method below with this when supported
+ sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs)
+ */
+ buff, err := c.filterer.FilterLogs(ensureContext(opts.Context), config)
+ if err != nil {
+ return nil, nil, err
+ }
+ sub, err := event.NewSubscription(func(quit <-chan struct{}) error {
+ for _, log := range buff {
+ select {
+ case logs <- log:
+ case <-quit:
+ return nil
+ }
+ }
+ return nil
+ }), nil
+
+ if err != nil {
+ return nil, nil, err
+ }
+ return logs, sub, nil
+}
+
+// WatchLogs filters subscribes to contract logs for future blocks, returning a
+// subscription object that can be used to tear down the watcher.
+func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error) {
+ // Don't crash on a lazy user
+ if opts == nil {
+ opts = new(WatchOpts)
+ }
+ // Append the event selector to the query parameters and construct the topic set
+ query = append([][]interface{}{{c.abi.Events[name].Id()}}, query...)
+
+ topics, err := makeTopics(query...)
+ if err != nil {
+ return nil, nil, err
+ }
+ // Start the background filtering
+ logs := make(chan types.Log, 128)
+
+ config := ethereum.FilterQuery{
+ Addresses: []common.Address{c.address},
+ Topics: topics,
+ }
+ if opts.Start != nil {
+ config.FromBlock = new(big.Int).SetUint64(*opts.Start)
+ }
+ sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs)
+ if err != nil {
+ return nil, nil, err
+ }
+ return logs, sub, nil
+}
+
+// UnpackLog unpacks a retrieved log into the provided output structure.
+func (c *BoundContract) UnpackLog(out interface{}, event string, log types.Log) error {
+ if len(log.Data) > 0 {
+ if err := c.abi.Unpack(out, event, log.Data); err != nil {
+ return err
+ }
+ }
+ var indexed abi.Arguments
+ for _, arg := range c.abi.Events[event].Inputs {
+ if arg.Indexed {
+ indexed = append(indexed, arg)
+ }
+ }
+ return parseTopics(out, indexed, log.Topics[1:])
+}
+
+// ensureContext is a helper method to ensure a context is not nil, even if the
+// user specified it as such.
func ensureContext(ctx context.Context) context.Context {
if ctx == nil {
return context.TODO()
diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go
index 8175e3cb9b..e31b454812 100644
--- a/accounts/abi/bind/bind.go
+++ b/accounts/abi/bind/bind.go
@@ -63,10 +63,11 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
return r
}, abis[i])
- // Extract the call and transact methods, and sort them alphabetically
+ // Extract the call and transact methods; events; and sort them alphabetically
var (
calls = make(map[string]*tmplMethod)
transacts = make(map[string]*tmplMethod)
+ events = make(map[string]*tmplEvent)
)
for _, original := range evmABI.Methods {
// Normalize the method for capital cases and non-anonymous inputs/outputs
@@ -89,11 +90,33 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
}
// Append the methods to the call or transact lists
if original.Const {
- calls[original.Name] = &tmplMethod{Original: original, Normalized: normalized, Structured: structured(original)}
+ calls[original.Name] = &tmplMethod{Original: original, Normalized: normalized, Structured: structured(original.Outputs)}
} else {
- transacts[original.Name] = &tmplMethod{Original: original, Normalized: normalized, Structured: structured(original)}
+ transacts[original.Name] = &tmplMethod{Original: original, Normalized: normalized, Structured: structured(original.Outputs)}
}
}
+ for _, original := range evmABI.Events {
+ // Skip anonymous events as they don't support explicit filtering
+ if original.Anonymous {
+ continue
+ }
+ // Normalize the event for capital cases and non-anonymous outputs
+ normalized := original
+ normalized.Name = methodNormalizer[lang](original.Name)
+
+ normalized.Inputs = make([]abi.Argument, len(original.Inputs))
+ copy(normalized.Inputs, original.Inputs)
+ for j, input := range normalized.Inputs {
+ // Indexed fields are input, non-indexed ones are outputs
+ if input.Indexed {
+ if input.Name == "" {
+ normalized.Inputs[j].Name = fmt.Sprintf("arg%d", j)
+ }
+ }
+ }
+ // Append the event to the accumulator list
+ events[original.Name] = &tmplEvent{Original: original, Normalized: normalized}
+ }
contracts[types[i]] = &tmplContract{
Type: capitalise(types[i]),
InputABI: strings.Replace(strippedABI, "\"", "\\\"", -1),
@@ -101,6 +124,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
Constructor: evmABI.Constructor,
Calls: calls,
Transacts: transacts,
+ Events: events,
}
}
// Generate the contract template data content and render it
@@ -111,10 +135,11 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
buffer := new(bytes.Buffer)
funcs := map[string]interface{}{
- "bindtype": bindType[lang],
- "namedtype": namedType[lang],
- "capitalise": capitalise,
- "decapitalise": decapitalise,
+ "bindtype": bindType[lang],
+ "bindtopictype": bindTopicType[lang],
+ "namedtype": namedType[lang],
+ "capitalise": capitalise,
+ "decapitalise": decapitalise,
}
tmpl := template.Must(template.New("").Funcs(funcs).Parse(tmplSource[lang]))
if err := tmpl.Execute(buffer, data); err != nil {
@@ -133,7 +158,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
}
// bindType is a set of type binders that convert Solidity types to some supported
-// programming language.
+// programming language types.
var bindType = map[Lang]func(kind abi.Type) string{
LangGo: bindTypeGo,
LangJava: bindTypeJava,
@@ -254,6 +279,33 @@ func bindTypeJava(kind abi.Type) string {
}
}
+// bindTopicType is a set of type binders that convert Solidity types to some
+// supported programming language topic types.
+var bindTopicType = map[Lang]func(kind abi.Type) string{
+ LangGo: bindTopicTypeGo,
+ LangJava: bindTopicTypeJava,
+}
+
+// bindTypeGo converts a Solidity topic type to a Go one. It is almost the same
+// funcionality as for simple types, but dynamic types get converted to hashes.
+func bindTopicTypeGo(kind abi.Type) string {
+ bound := bindTypeGo(kind)
+ if bound == "string" || bound == "[]byte" {
+ bound = "common.Hash"
+ }
+ return bound
+}
+
+// bindTypeGo converts a Solidity topic type to a Java one. It is almost the same
+// funcionality as for simple types, but dynamic types get converted to hashes.
+func bindTopicTypeJava(kind abi.Type) string {
+ bound := bindTypeJava(kind)
+ if bound == "String" || bound == "Bytes" {
+ bound = "Hash"
+ }
+ return bound
+}
+
// namedType is a set of functions that transform language specific types to
// named versions that my be used inside method names.
var namedType = map[Lang]func(string, abi.Type) string{
@@ -321,14 +373,14 @@ func decapitalise(input string) string {
return strings.ToLower(input[:1]) + input[1:]
}
-// structured checks whether a method has enough information to return a proper
-// Go struct or if flat returns are needed.
-func structured(method abi.Method) bool {
- if len(method.Outputs) < 2 {
+// structured checks whether a list of ABI data types has enough information to
+// operate through a proper Go struct or if flat returns are needed.
+func structured(args abi.Arguments) bool {
+ if len(args) < 2 {
return false
}
exists := make(map[string]bool)
- for _, out := range method.Outputs {
+ for _, out := range args {
// If the name is anonymous, we can't organize into a struct
if out.Name == "" {
return false
diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go
index b56477e0c7..c4838e6470 100644
--- a/accounts/abi/bind/bind_test.go
+++ b/accounts/abi/bind/bind_test.go
@@ -148,6 +148,64 @@ var bindTests = []struct {
fmt.Println(str1, str2, res.Str1, res.Str2, err)
}`,
},
+ // Tests that named, anonymous and indexed events are handled correctly
+ {
+ `EventChecker`, ``, ``,
+ `
+ [
+ {"type":"event","name":"empty","inputs":[]},
+ {"type":"event","name":"indexed","inputs":[{"name":"addr","type":"address","indexed":true},{"name":"num","type":"int256","indexed":true}]},
+ {"type":"event","name":"mixed","inputs":[{"name":"addr","type":"address","indexed":true},{"name":"num","type":"int256"}]},
+ {"type":"event","name":"anonymous","anonymous":true,"inputs":[]},
+ {"type":"event","name":"dynamic","inputs":[{"name":"idxStr","type":"string","indexed":true},{"name":"idxDat","type":"bytes","indexed":true},{"name":"str","type":"string"},{"name":"dat","type":"bytes"}]}
+ ]
+ `,
+ `if e, err := NewEventChecker(common.Address{}, nil); e == nil || err != nil {
+ t.Fatalf("binding (%v) nil or error (%v) not nil", e, nil)
+ } else if false { // Don't run, just compile and test types
+ var (
+ err error
+ res bool
+ str string
+ dat []byte
+ hash common.Hash
+ )
+ _, err = e.FilterEmpty(nil)
+ _, err = e.FilterIndexed(nil, []common.Address{}, []*big.Int{})
+
+ mit, err := e.FilterMixed(nil, []common.Address{})
+
+ res = mit.Next() // Make sure the iterator has a Next method
+ err = mit.Error() // Make sure the iterator has an Error method
+ err = mit.Close() // Make sure the iterator has a Close method
+
+ fmt.Println(mit.Event.Raw.BlockHash) // Make sure the raw log is contained within the results
+ fmt.Println(mit.Event.Num) // Make sure the unpacked non-indexed fields are present
+ fmt.Println(mit.Event.Addr) // Make sure the reconstructed indexed fields are present
+
+ dit, err := e.FilterDynamic(nil, []string{}, [][]byte{})
+
+ str = dit.Event.Str // Make sure non-indexed strings retain their type
+ dat = dit.Event.Dat // Make sure non-indexed bytes retain their type
+ hash = dit.Event.IdxStr // Make sure indexed strings turn into hashes
+ hash = dit.Event.IdxDat // Make sure indexed bytes turn into hashes
+
+ sink := make(chan *EventCheckerMixed)
+ sub, err := e.WatchMixed(nil, sink, []common.Address{})
+ defer sub.Unsubscribe()
+
+ event := <-sink
+ fmt.Println(event.Raw.BlockHash) // Make sure the raw log is contained within the results
+ fmt.Println(event.Num) // Make sure the unpacked non-indexed fields are present
+ fmt.Println(event.Addr) // Make sure the reconstructed indexed fields are present
+
+ fmt.Println(res, str, dat, hash, err)
+ }
+ // Run a tiny reflection test to ensure disallowed methods don't appear
+ if _, ok := reflect.TypeOf(&EventChecker{}).MethodByName("FilterAnonymous"); ok {
+ t.Errorf("binding has disallowed method (FilterAnonymous)")
+ }`,
+ },
// Test that contract interactions (deploy, transact and call) generate working code
{
`Interactor`,
@@ -508,6 +566,177 @@ var bindTests = []struct {
fmt.Println(a, b, err)
`,
},
+ // Tests that logs can be successfully filtered and decoded.
+ {
+ `Eventer`,
+ `
+ contract Eventer {
+ event SimpleEvent (
+ address indexed Addr,
+ bytes32 indexed Id,
+ bool indexed Flag,
+ uint Value
+ );
+ function raiseSimpleEvent(address addr, bytes32 id, bool flag, uint value) {
+ SimpleEvent(addr, id, flag, value);
+ }
+
+ event NodataEvent (
+ uint indexed Number,
+ int16 indexed Short,
+ uint32 indexed Long
+ );
+ function raiseNodataEvent(uint number, int16 short, uint32 long) {
+ NodataEvent(number, short, long);
+ }
+
+ event DynamicEvent (
+ string indexed IndexedString,
+ bytes indexed IndexedBytes,
+ string NonIndexedString,
+ bytes NonIndexedBytes
+ );
+ function raiseDynamicEvent(string str, bytes blob) {
+ DynamicEvent(str, blob, str, blob);
+ }
+ }
+ `,
+ `6060604052341561000f57600080fd5b61042c8061001e6000396000f300606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063528300ff1461005c578063630c31e2146100fc578063c7d116dd14610156575b600080fd5b341561006757600080fd5b6100fa600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610194565b005b341561010757600080fd5b610154600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035600019169060200190919080351515906020019091908035906020019091905050610367565b005b341561016157600080fd5b610192600480803590602001909190803560010b90602001909190803563ffffffff169060200190919050506103c3565b005b806040518082805190602001908083835b6020831015156101ca57805182526020820191506020810190506020830392506101a5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020826040518082805190602001908083835b60208310151561022d5780518252602082019150602081019050602083039250610208565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207f3281fd4f5e152dd3385df49104a3f633706e21c9e80672e88d3bcddf33101f008484604051808060200180602001838103835285818151815260200191508051906020019080838360005b838110156102c15780820151818401526020810190506102a6565b50505050905090810190601f1680156102ee5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b8381101561032757808201518184015260208101905061030c565b50505050905090810190601f1680156103545780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a35050565b81151583600019168573ffffffffffffffffffffffffffffffffffffffff167f1f097de4289df643bd9c11011cc61367aa12983405c021056e706eb5ba1250c8846040518082815260200191505060405180910390a450505050565b8063ffffffff168260010b847f3ca7f3a77e5e6e15e781850bc82e32adfa378a2a609370db24b4d0fae10da2c960405160405180910390a45050505600a165627a7a72305820d1f8a8bbddbc5bb29f285891d6ae1eef8420c52afdc05e1573f6114d8e1714710029`,
+ `[{"constant":false,"inputs":[{"name":"str","type":"string"},{"name":"blob","type":"bytes"}],"name":"raiseDynamicEvent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"id","type":"bytes32"},{"name":"flag","type":"bool"},{"name":"value","type":"uint256"}],"name":"raiseSimpleEvent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"number","type":"uint256"},{"name":"short","type":"int16"},{"name":"long","type":"uint32"}],"name":"raiseNodataEvent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"Addr","type":"address"},{"indexed":true,"name":"Id","type":"bytes32"},{"indexed":true,"name":"Flag","type":"bool"},{"indexed":false,"name":"Value","type":"uint256"}],"name":"SimpleEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"Number","type":"uint256"},{"indexed":true,"name":"Short","type":"int16"},{"indexed":true,"name":"Long","type":"uint32"}],"name":"NodataEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"IndexedString","type":"string"},{"indexed":true,"name":"IndexedBytes","type":"bytes"},{"indexed":false,"name":"NonIndexedString","type":"string"},{"indexed":false,"name":"NonIndexedBytes","type":"bytes"}],"name":"DynamicEvent","type":"event"}]`,
+ `
+ // Generate a new random account and a funded simulator
+ key, _ := crypto.GenerateKey()
+ auth := bind.NewKeyedTransactor(key)
+ sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}})
+
+ // Deploy an eventer contract
+ _, _, eventer, err := DeployEventer(auth, sim)
+ if err != nil {
+ t.Fatalf("Failed to deploy eventer contract: %v", err)
+ }
+ sim.Commit()
+
+ // Inject a few events into the contract, gradually more in each block
+ for i := 1; i <= 3; i++ {
+ for j := 1; j <= i; j++ {
+ if _, err := eventer.RaiseSimpleEvent(auth, common.Address{byte(j)}, [32]byte{byte(j)}, true, big.NewInt(int64(10*i+j))); err != nil {
+ t.Fatalf("block %d, event %d: raise failed: %v", i, j, err)
+ }
+ }
+ sim.Commit()
+ }
+ // Test filtering for certain events and ensure they can be found
+ sit, err := eventer.FilterSimpleEvent(nil, []common.Address{common.Address{1}, common.Address{3}}, [][32]byte{{byte(1)}, {byte(2)}, {byte(3)}}, []bool{true})
+ if err != nil {
+ t.Fatalf("failed to filter for simple events: %v", err)
+ }
+ defer sit.Close()
+
+ sit.Next()
+ if sit.Event.Value.Uint64() != 11 || !sit.Event.Flag {
+ t.Errorf("simple log content mismatch: have %v, want {11, true}", sit.Event)
+ }
+ sit.Next()
+ if sit.Event.Value.Uint64() != 21 || !sit.Event.Flag {
+ t.Errorf("simple log content mismatch: have %v, want {21, true}", sit.Event)
+ }
+ sit.Next()
+ if sit.Event.Value.Uint64() != 31 || !sit.Event.Flag {
+ t.Errorf("simple log content mismatch: have %v, want {31, true}", sit.Event)
+ }
+ sit.Next()
+ if sit.Event.Value.Uint64() != 33 || !sit.Event.Flag {
+ t.Errorf("simple log content mismatch: have %v, want {33, true}", sit.Event)
+ }
+
+ if sit.Next() {
+ t.Errorf("unexpected simple event found: %+v", sit.Event)
+ }
+ if err = sit.Error(); err != nil {
+ t.Fatalf("simple event iteration failed: %v", err)
+ }
+ // Test raising and filtering for an event with no data component
+ if _, err := eventer.RaiseNodataEvent(auth, big.NewInt(314), 141, 271); err != nil {
+ t.Fatalf("failed to raise nodata event: %v", err)
+ }
+ sim.Commit()
+
+ nit, err := eventer.FilterNodataEvent(nil, []*big.Int{big.NewInt(314)}, []int16{140, 141, 142}, []uint32{271})
+ if err != nil {
+ t.Fatalf("failed to filter for nodata events: %v", err)
+ }
+ defer nit.Close()
+
+ if !nit.Next() {
+ t.Fatalf("nodata log not found: %v", nit.Error())
+ }
+ if nit.Event.Number.Uint64() != 314 {
+ t.Errorf("nodata log content mismatch: have %v, want 314", nit.Event.Number)
+ }
+ if nit.Next() {
+ t.Errorf("unexpected nodata event found: %+v", nit.Event)
+ }
+ if err = nit.Error(); err != nil {
+ t.Fatalf("nodata event iteration failed: %v", err)
+ }
+ // Test raising and filtering for events with dynamic indexed components
+ if _, err := eventer.RaiseDynamicEvent(auth, "Hello", []byte("World")); err != nil {
+ t.Fatalf("failed to raise dynamic event: %v", err)
+ }
+ sim.Commit()
+
+ dit, err := eventer.FilterDynamicEvent(nil, []string{"Hi", "Hello", "Bye"}, [][]byte{[]byte("World")})
+ if err != nil {
+ t.Fatalf("failed to filter for dynamic events: %v", err)
+ }
+ defer dit.Close()
+
+ if !dit.Next() {
+ t.Fatalf("dynamic log not found: %v", dit.Error())
+ }
+ if dit.Event.NonIndexedString != "Hello" || string(dit.Event.NonIndexedBytes) != "World" || dit.Event.IndexedString != common.HexToHash("0x06b3dfaec148fb1bb2b066f10ec285e7c9bf402ab32aa78a5d38e34566810cd2") || dit.Event.IndexedBytes != common.HexToHash("0xf2208c967df089f60420785795c0a9ba8896b0f6f1867fa7f1f12ad6f79c1a18") {
+ t.Errorf("dynamic log content mismatch: have %v, want {'0x06b3dfaec148fb1bb2b066f10ec285e7c9bf402ab32aa78a5d38e34566810cd2, '0xf2208c967df089f60420785795c0a9ba8896b0f6f1867fa7f1f12ad6f79c1a18', 'Hello', 'World'}", dit.Event)
+ }
+ if dit.Next() {
+ t.Errorf("unexpected dynamic event found: %+v", dit.Event)
+ }
+ if err = dit.Error(); err != nil {
+ t.Fatalf("dynamic event iteration failed: %v", err)
+ }
+ // Test subscribing to an event and raising it afterwards
+ ch := make(chan *EventerSimpleEvent, 16)
+ sub, err := eventer.WatchSimpleEvent(nil, ch, nil, nil, nil)
+ if err != nil {
+ t.Fatalf("failed to subscribe to simple events: %v", err)
+ }
+ if _, err := eventer.RaiseSimpleEvent(auth, common.Address{255}, [32]byte{255}, true, big.NewInt(255)); err != nil {
+ t.Fatalf("failed to raise subscribed simple event: %v", err)
+ }
+ sim.Commit()
+
+ select {
+ case event := <-ch:
+ if event.Value.Uint64() != 255 {
+ t.Errorf("simple log content mismatch: have %v, want 255", event)
+ }
+ case <-time.After(250 * time.Millisecond):
+ t.Fatalf("subscribed simple event didn't arrive")
+ }
+ // Unsubscribe from the event and make sure we're not delivered more
+ sub.Unsubscribe()
+
+ if _, err := eventer.RaiseSimpleEvent(auth, common.Address{254}, [32]byte{254}, true, big.NewInt(254)); err != nil {
+ t.Fatalf("failed to raise subscribed simple event: %v", err)
+ }
+ sim.Commit()
+
+ select {
+ case event := <-ch:
+ t.Fatalf("unsubscribed simple event arrived: %v", event)
+ case <-time.After(250 * time.Millisecond):
+ }
+ `,
+ },
}
// Tests that packages generated by the binder can be successfully compiled and
@@ -559,7 +788,7 @@ func TestBindings(t *testing.T) {
}
}
// Test the entire package and report any failures
- cmd := exec.Command(gocmd, "test", "-v")
+ cmd := exec.Command(gocmd, "test", "-v", "-count", "1")
cmd.Dir = pkg
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("failed to run binding test: %v\n%s", err, out)
diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go
index d07610e7c2..7202ee67a1 100644
--- a/accounts/abi/bind/template.go
+++ b/accounts/abi/bind/template.go
@@ -32,6 +32,7 @@ type tmplContract struct {
Constructor abi.Method // Contract constructor for deploy parametrization
Calls map[string]*tmplMethod // Contract calls that only read state data
Transacts map[string]*tmplMethod // Contract calls that write state data
+ Events map[string]*tmplEvent // Contract events accessors
}
// tmplMethod is a wrapper around an abi.Method that contains a few preprocessed
@@ -39,7 +40,13 @@ type tmplContract struct {
type tmplMethod struct {
Original abi.Method // Original method as parsed by the abi package
Normalized abi.Method // Normalized version of the parsed method (capitalized names, non-anonymous args/returns)
- Structured bool // Whether the returns should be accumulated into a contract
+ Structured bool // Whether the returns should be accumulated into a struct
+}
+
+// tmplEvent is a wrapper around an a
+type tmplEvent struct {
+ Original abi.Event // Original event as parsed by the abi package
+ Normalized abi.Event // Normalized version of the parsed fields
}
// tmplSource is language to template mapping containing all the supported
@@ -75,7 +82,7 @@ package {{.Package}}
if err != nil {
return common.Address{}, nil, nil, err
}
- return address, tx, &{{.Type}}{ {{.Type}}Caller: {{.Type}}Caller{contract: contract}, {{.Type}}Transactor: {{.Type}}Transactor{contract: contract} }, nil
+ return address, tx, &{{.Type}}{ {{.Type}}Caller: {{.Type}}Caller{contract: contract}, {{.Type}}Transactor: {{.Type}}Transactor{contract: contract}, {{.Type}}Filterer: {{.Type}}Filterer{contract: contract} }, nil
}
{{end}}
@@ -83,6 +90,7 @@ package {{.Package}}
type {{.Type}} struct {
{{.Type}}Caller // Read-only binding to the contract
{{.Type}}Transactor // Write-only binding to the contract
+ {{.Type}}Filterer // Log filterer for contract events
}
// {{.Type}}Caller is an auto generated read-only Go binding around an Ethereum contract.
@@ -95,6 +103,11 @@ package {{.Package}}
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
+ // {{.Type}}Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
+ type {{.Type}}Filterer struct {
+ contract *bind.BoundContract // Generic contract wrapper for the low level calls
+ }
+
// {{.Type}}Session is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type {{.Type}}Session struct {
@@ -134,16 +147,16 @@ package {{.Package}}
// New{{.Type}} creates a new instance of {{.Type}}, bound to a specific deployed contract.
func New{{.Type}}(address common.Address, backend bind.ContractBackend) (*{{.Type}}, error) {
- contract, err := bind{{.Type}}(address, backend, backend)
+ contract, err := bind{{.Type}}(address, backend, backend, backend)
if err != nil {
return nil, err
}
- return &{{.Type}}{ {{.Type}}Caller: {{.Type}}Caller{contract: contract}, {{.Type}}Transactor: {{.Type}}Transactor{contract: contract} }, nil
+ return &{{.Type}}{ {{.Type}}Caller: {{.Type}}Caller{contract: contract}, {{.Type}}Transactor: {{.Type}}Transactor{contract: contract}, {{.Type}}Filterer: {{.Type}}Filterer{contract: contract} }, nil
}
// New{{.Type}}Caller creates a new read-only instance of {{.Type}}, bound to a specific deployed contract.
func New{{.Type}}Caller(address common.Address, caller bind.ContractCaller) (*{{.Type}}Caller, error) {
- contract, err := bind{{.Type}}(address, caller, nil)
+ contract, err := bind{{.Type}}(address, caller, nil, nil)
if err != nil {
return nil, err
}
@@ -152,20 +165,29 @@ package {{.Package}}
// New{{.Type}}Transactor creates a new write-only instance of {{.Type}}, bound to a specific deployed contract.
func New{{.Type}}Transactor(address common.Address, transactor bind.ContractTransactor) (*{{.Type}}Transactor, error) {
- contract, err := bind{{.Type}}(address, nil, transactor)
+ contract, err := bind{{.Type}}(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &{{.Type}}Transactor{contract: contract}, nil
}
+ // New{{.Type}}Filterer creates a new log filterer instance of {{.Type}}, bound to a specific deployed contract.
+ func New{{.Type}}Filterer(address common.Address, filterer bind.ContractFilterer) (*{{.Type}}Filterer, error) {
+ contract, err := bind{{.Type}}(address, nil, nil, filterer)
+ if err != nil {
+ return nil, err
+ }
+ return &{{.Type}}Filterer{contract: contract}, nil
+ }
+
// bind{{.Type}} binds a generic wrapper to an already deployed contract.
- func bind{{.Type}}(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
+ func bind{{.Type}}(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader({{.Type}}ABI))
if err != nil {
return nil, err
}
- return bind.NewBoundContract(address, parsed, caller, transactor), nil
+ return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
@@ -263,6 +285,137 @@ package {{.Package}}
return _{{$contract.Type}}.Contract.{{.Normalized.Name}}(&_{{$contract.Type}}.TransactOpts {{range $i, $_ := .Normalized.Inputs}}, {{.Name}}{{end}})
}
{{end}}
+
+ {{range .Events}}
+ // {{$contract.Type}}{{.Normalized.Name}}Iterator is returned from Filter{{.Normalized.Name}} and is used to iterate over the raw logs and unpacked data for {{.Normalized.Name}} events raised by the {{$contract.Type}} contract.
+ type {{$contract.Type}}{{.Normalized.Name}}Iterator struct {
+ Event *{{$contract.Type}}{{.Normalized.Name}} // 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 *{{$contract.Type}}{{.Normalized.Name}}Iterator) 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({{$contract.Type}}{{.Normalized.Name}})
+ 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({{$contract.Type}}{{.Normalized.Name}})
+ 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 *{{$contract.Type}}{{.Normalized.Name}}Iterator) Error() error {
+ return it.fail
+ }
+ // Close terminates the iteration process, releasing any pending underlying
+ // resources.
+ func (it *{{$contract.Type}}{{.Normalized.Name}}Iterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+ }
+
+ // {{$contract.Type}}{{.Normalized.Name}} represents a {{.Normalized.Name}} event raised by the {{$contract.Type}} contract.
+ type {{$contract.Type}}{{.Normalized.Name}} struct { {{range .Normalized.Inputs}}
+ {{capitalise .Name}} {{if .Indexed}}{{bindtopictype .Type}}{{else}}{{bindtype .Type}}{{end}}; {{end}}
+ Raw types.Log // Blockchain specific contextual infos
+ }
+
+ // Filter{{.Normalized.Name}} is a free log retrieval operation binding the contract event 0x{{printf "%x" .Original.Id}}.
+ //
+ // Solidity: {{.Original.String}}
+ func (_{{$contract.Type}} *{{$contract.Type}}Filterer) Filter{{.Normalized.Name}}(opts *bind.FilterOpts{{range .Normalized.Inputs}}{{if .Indexed}}, {{.Name}} []{{bindtype .Type}}{{end}}{{end}}) (*{{$contract.Type}}{{.Normalized.Name}}Iterator, error) {
+ {{range .Normalized.Inputs}}
+ {{if .Indexed}}var {{.Name}}Rule []interface{}
+ for _, {{.Name}}Item := range {{.Name}} {
+ {{.Name}}Rule = append({{.Name}}Rule, {{.Name}}Item)
+ }{{end}}{{end}}
+
+ logs, sub, err := _{{$contract.Type}}.contract.FilterLogs(opts, "{{.Original.Name}}"{{range .Normalized.Inputs}}{{if .Indexed}}, {{.Name}}Rule{{end}}{{end}})
+ if err != nil {
+ return nil, err
+ }
+ return &{{$contract.Type}}{{.Normalized.Name}}Iterator{contract: _{{$contract.Type}}.contract, event: "{{.Original.Name}}", logs: logs, sub: sub}, nil
+ }
+
+ // Watch{{.Normalized.Name}} is a free log subscription operation binding the contract event 0x{{printf "%x" .Original.Id}}.
+ //
+ // Solidity: {{.Original.String}}
+ func (_{{$contract.Type}} *{{$contract.Type}}Filterer) Watch{{.Normalized.Name}}(opts *bind.WatchOpts, sink chan<- *{{$contract.Type}}{{.Normalized.Name}}{{range .Normalized.Inputs}}{{if .Indexed}}, {{.Name}} []{{bindtype .Type}}{{end}}{{end}}) (event.Subscription, error) {
+ {{range .Normalized.Inputs}}
+ {{if .Indexed}}var {{.Name}}Rule []interface{}
+ for _, {{.Name}}Item := range {{.Name}} {
+ {{.Name}}Rule = append({{.Name}}Rule, {{.Name}}Item)
+ }{{end}}{{end}}
+
+ logs, sub, err := _{{$contract.Type}}.contract.WatchLogs(opts, "{{.Original.Name}}"{{range .Normalized.Inputs}}{{if .Indexed}}, {{.Name}}Rule{{end}}{{end}})
+ 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({{$contract.Type}}{{.Normalized.Name}})
+ if err := _{{$contract.Type}}.contract.UnpackLog(event, "{{.Original.Name}}", 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
+ }
+ {{end}}
{{end}}
`
diff --git a/accounts/abi/bind/topics.go b/accounts/abi/bind/topics.go
new file mode 100644
index 0000000000..600dfcda97
--- /dev/null
+++ b/accounts/abi/bind/topics.go
@@ -0,0 +1,189 @@
+// Copyright 2018 The go-ethereum Authors
+// This file is part of the go-ethereum library.
+//
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The go-ethereum library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see .
+
+package bind
+
+import (
+ "errors"
+ "fmt"
+ "math/big"
+ "reflect"
+
+ "github.com/ethereum/go-ethereum/accounts/abi"
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/crypto"
+)
+
+// makeTopics converts a filter query argument list into a filter topic set.
+func makeTopics(query ...[]interface{}) ([][]common.Hash, error) {
+ topics := make([][]common.Hash, len(query))
+ for i, filter := range query {
+ for _, rule := range filter {
+ var topic common.Hash
+
+ // Try to generate the topic based on simple types
+ switch rule := rule.(type) {
+ case common.Hash:
+ copy(topic[:], rule[:])
+ case common.Address:
+ copy(topic[common.HashLength-common.AddressLength:], rule[:])
+ case *big.Int:
+ blob := rule.Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case bool:
+ if rule {
+ topic[common.HashLength-1] = 1
+ }
+ case int8:
+ blob := big.NewInt(int64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case int16:
+ blob := big.NewInt(int64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case int32:
+ blob := big.NewInt(int64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case int64:
+ blob := big.NewInt(rule).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case uint8:
+ blob := new(big.Int).SetUint64(uint64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case uint16:
+ blob := new(big.Int).SetUint64(uint64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case uint32:
+ blob := new(big.Int).SetUint64(uint64(rule)).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case uint64:
+ blob := new(big.Int).SetUint64(rule).Bytes()
+ copy(topic[common.HashLength-len(blob):], blob)
+ case string:
+ hash := crypto.Keccak256Hash([]byte(rule))
+ copy(topic[:], hash[:])
+ case []byte:
+ hash := crypto.Keccak256Hash(rule)
+ copy(topic[:], hash[:])
+
+ default:
+ // Attempt to generate the topic from funky types
+ val := reflect.ValueOf(rule)
+
+ switch {
+ case val.Kind() == reflect.Array && reflect.TypeOf(rule).Elem().Kind() == reflect.Uint8:
+ reflect.Copy(reflect.ValueOf(topic[common.HashLength-val.Len():]), val)
+
+ default:
+ return nil, fmt.Errorf("unsupported indexed type: %T", rule)
+ }
+ }
+ topics[i] = append(topics[i], topic)
+ }
+ }
+ return topics, nil
+}
+
+// Big batch of reflect types for topic reconstruction.
+var (
+ reflectHash = reflect.TypeOf(common.Hash{})
+ reflectAddress = reflect.TypeOf(common.Address{})
+ reflectBigInt = reflect.TypeOf(new(big.Int))
+)
+
+// parseTopics converts the indexed topic fields into actual log field values.
+//
+// Note, dynamic types cannot be reconstructed since they get mapped to Keccak256
+// hashes as the topic value!
+func parseTopics(out interface{}, fields abi.Arguments, topics []common.Hash) error {
+ // Sanity check that the fields and topics match up
+ if len(fields) != len(topics) {
+ return errors.New("topic/field count mismatch")
+ }
+ // Iterate over all the fields and reconstruct them from topics
+ for _, arg := range fields {
+ if !arg.Indexed {
+ return errors.New("non-indexed field in topic reconstruction")
+ }
+ field := reflect.ValueOf(out).Elem().FieldByName(capitalise(arg.Name))
+
+ // Try to parse the topic back into the fields based on primitive types
+ switch field.Kind() {
+ case reflect.Bool:
+ if topics[0][common.HashLength-1] == 1 {
+ field.Set(reflect.ValueOf(true))
+ }
+ case reflect.Int8:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(int8(num.Int64())))
+
+ case reflect.Int16:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(int16(num.Int64())))
+
+ case reflect.Int32:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(int32(num.Int64())))
+
+ case reflect.Int64:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(num.Int64()))
+
+ case reflect.Uint8:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(uint8(num.Uint64())))
+
+ case reflect.Uint16:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(uint16(num.Uint64())))
+
+ case reflect.Uint32:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(uint32(num.Uint64())))
+
+ case reflect.Uint64:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(num.Uint64()))
+
+ default:
+ // Ran out of plain primitive types, try custom types
+ switch field.Type() {
+ case reflectHash: // Also covers all dynamic types
+ field.Set(reflect.ValueOf(topics[0]))
+
+ case reflectAddress:
+ var addr common.Address
+ copy(addr[:], topics[0][common.HashLength-common.AddressLength:])
+ field.Set(reflect.ValueOf(addr))
+
+ case reflectBigInt:
+ num := new(big.Int).SetBytes(topics[0][:])
+ field.Set(reflect.ValueOf(num))
+
+ default:
+ // Ran out of custom types, try the crazies
+ switch {
+ case arg.Type.T == abi.FixedBytesTy:
+ reflect.Copy(field, reflect.ValueOf(topics[0][common.HashLength-arg.Type.Size:]))
+
+ default:
+ return fmt.Errorf("unsupported indexed type: %v", arg.Type)
+ }
+ }
+ }
+ topics = topics[1:]
+ }
+ return nil
+}
diff --git a/accounts/abi/event.go b/accounts/abi/event.go
index 726bac90e9..595f169f3a 100644
--- a/accounts/abi/event.go
+++ b/accounts/abi/event.go
@@ -33,6 +33,17 @@ type Event struct {
Inputs Arguments
}
+func (event Event) String() string {
+ inputs := make([]string, len(event.Inputs))
+ for i, input := range event.Inputs {
+ inputs[i] = fmt.Sprintf("%v %v", input.Name, input.Type)
+ if input.Indexed {
+ inputs[i] = fmt.Sprintf("%v indexed %v", input.Name, input.Type)
+ }
+ }
+ return fmt.Sprintf("event %v(%v)", event.Name, strings.Join(inputs, ", "))
+}
+
// Id returns the canonical representation of the event's signature used by the
// abi definition to identify event names and types.
func (e Event) Id() common.Hash {
diff --git a/accounts/errors.go b/accounts/errors.go
index 64da8821c8..40b21ed179 100644
--- a/accounts/errors.go
+++ b/accounts/errors.go
@@ -62,7 +62,7 @@ func NewAuthNeededError(needed string) error {
}
}
-// Error implements the standard error interfacel.
+// Error implements the standard error interface.
func (err *AuthNeededError) Error() string {
return fmt.Sprintf("authentication needed: %s", err.Needed)
}
diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go
index e1734d89ac..ecfc6fc24e 100644
--- a/cmd/bootnode/main.go
+++ b/cmd/bootnode/main.go
@@ -21,6 +21,7 @@ import (
"crypto/ecdsa"
"flag"
"fmt"
+ "net"
"os"
"github.com/ethereum/go-ethereum/cmd/utils"
@@ -96,12 +97,32 @@ func main() {
}
}
+ addr, err := net.ResolveUDPAddr("udp", *listenAddr)
+ if err != nil {
+ utils.Fatalf("-ResolveUDPAddr: %v", err)
+ }
+ conn, err := net.ListenUDP("udp", addr)
+ if err != nil {
+ utils.Fatalf("-ListenUDP: %v", err)
+ }
+
+ realaddr := conn.LocalAddr().(*net.UDPAddr)
+ if natm != nil {
+ if !realaddr.IP.IsLoopback() {
+ go nat.Map(natm, nil, "udp", realaddr.Port, realaddr.Port, "ethereum discovery")
+ }
+ // TODO: react to external IP changes over time.
+ if ext, err := natm.ExternalIP(); err == nil {
+ realaddr = &net.UDPAddr{IP: ext, Port: realaddr.Port}
+ }
+ }
+
if *runv5 {
- if _, err := discv5.ListenUDP(nodeKey, *listenAddr, natm, "", restrictList); err != nil {
+ if _, err := discv5.ListenUDP(nodeKey, conn, realaddr, "", restrictList); err != nil {
utils.Fatalf("%v", err)
}
} else {
- if _, err := discover.ListenUDP(nodeKey, *listenAddr, natm, "", restrictList); err != nil {
+ if _, err := discover.ListenUDP(nodeKey, conn, realaddr, nil, "", restrictList); err != nil {
utils.Fatalf("%v", err)
}
}
diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go
index dee0e9d70e..6d57d17fb4 100644
--- a/cmd/ethkey/generate.go
+++ b/cmd/ethkey/generate.go
@@ -1,8 +1,23 @@
+// Copyright 2017 The go-ethereum Authors
+// This file is part of go-ethereum.
+//
+// go-ethereum is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// go-ethereum is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with go-ethereum. If not, see .
+
package main
import (
"crypto/ecdsa"
- "crypto/rand"
"fmt"
"io/ioutil"
"os"
@@ -26,16 +41,16 @@ var commandGenerate = cli.Command{
ArgsUsage: "[ ]",
Description: `
Generate a new keyfile.
-If you want to use an existing private key to use in the keyfile, it can be
-specified by setting --privatekey with the location of the file containing the
-private key.`,
+
+If you want to encrypt an existing private key, it can be specified by setting
+--privatekey with the location of the file containing the private key.
+`,
Flags: []cli.Flag{
passphraseFlag,
jsonFlag,
cli.StringFlag{
- Name: "privatekey",
- Usage: "the file from where to read the private key to " +
- "generate a keyfile for",
+ Name: "privatekey",
+ Usage: "file containing a raw private key to encrypt",
},
},
Action: func(ctx *cli.Context) error {
@@ -51,32 +66,19 @@ private key.`,
}
var privateKey *ecdsa.PrivateKey
-
- // First check if a private key file is provided.
- privateKeyFile := ctx.String("privatekey")
- if privateKeyFile != "" {
- privateKeyBytes, err := ioutil.ReadFile(privateKeyFile)
+ var err error
+ if file := ctx.String("privatekey"); file != "" {
+ // Load private key from file.
+ privateKey, err = crypto.LoadECDSA(file)
if err != nil {
- utils.Fatalf("Failed to read the private key file '%s': %v",
- privateKeyFile, err)
+ utils.Fatalf("Can't load private key: %v", err)
}
-
- pk, err := crypto.HexToECDSA(string(privateKeyBytes))
- if err != nil {
- utils.Fatalf(
- "Could not construct ECDSA private key from file content: %v",
- err)
- }
- privateKey = pk
- }
-
- // If not loaded, generate random.
- if privateKey == nil {
- pk, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader)
+ } else {
+ // If not loaded, generate random.
+ privateKey, err = crypto.GenerateKey()
if err != nil {
utils.Fatalf("Failed to generate random private key: %v", err)
}
- privateKey = pk
}
// Create the keyfile object with a random UUID.
@@ -89,8 +91,7 @@ private key.`,
// Encrypt key with passphrase.
passphrase := getPassPhrase(ctx, true)
- keyjson, err := keystore.EncryptKey(key, passphrase,
- keystore.StandardScryptN, keystore.StandardScryptP)
+ keyjson, err := keystore.EncryptKey(key, passphrase, keystore.StandardScryptN, keystore.StandardScryptP)
if err != nil {
utils.Fatalf("Error encrypting key: %v", err)
}
@@ -110,7 +111,7 @@ private key.`,
if ctx.Bool(jsonFlag.Name) {
mustPrintJSON(out)
} else {
- fmt.Println("Address: ", out.Address)
+ fmt.Println("Address:", out.Address)
}
return nil
},
diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go
index 8a7aeef848..219a5460b8 100644
--- a/cmd/ethkey/inspect.go
+++ b/cmd/ethkey/inspect.go
@@ -23,6 +23,7 @@ var commandInspect = cli.Command{
ArgsUsage: "",
Description: `
Print various information about the keyfile.
+
Private key information can be printed by using the --private flag;
make sure to use this feature with great caution!`,
Flags: []cli.Flag{
diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go
index b9b7a18e05..2a9e5ee483 100644
--- a/cmd/ethkey/main.go
+++ b/cmd/ethkey/main.go
@@ -28,30 +28,11 @@ const (
defaultKeyfileName = "keyfile.json"
)
-var (
- gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags)
+// Git SHA1 commit hash of the release (set via linker flags)
+var gitCommit = ""
- app *cli.App // the main app instance
-)
+var app *cli.App
-var ( // Commonly used command line flags.
- passphraseFlag = cli.StringFlag{
- Name: "passwordfile",
- Usage: "the file that contains the passphrase for the keyfile",
- }
-
- jsonFlag = cli.BoolFlag{
- Name: "json",
- Usage: "output JSON instead of human-readable format",
- }
-
- messageFlag = cli.StringFlag{
- Name: "message",
- Usage: "the file that contains the message to sign/verify",
- }
-)
-
-// Configure the app instance.
func init() {
app = utils.NewApp(gitCommit, "an Ethereum key manager")
app.Commands = []cli.Command{
@@ -62,6 +43,22 @@ func init() {
}
}
+// Commonly used command line flags.
+var (
+ passphraseFlag = cli.StringFlag{
+ Name: "passwordfile",
+ Usage: "the file that contains the passphrase for the keyfile",
+ }
+ jsonFlag = cli.BoolFlag{
+ Name: "json",
+ Usage: "output JSON instead of human-readable format",
+ }
+ messageFlag = cli.StringFlag{
+ Name: "message",
+ Usage: "the file that contains the message to sign/verify",
+ }
+)
+
func main() {
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go
index ae6b6552d3..531a931c82 100644
--- a/cmd/ethkey/message.go
+++ b/cmd/ethkey/message.go
@@ -1,11 +1,25 @@
+// Copyright 2017 The go-ethereum Authors
+// This file is part of go-ethereum.
+//
+// go-ethereum is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// go-ethereum is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with go-ethereum. If not, see .
+
package main
import (
"encoding/hex"
"fmt"
"io/ioutil"
- "os"
- "strings"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/cmd/utils"
@@ -18,26 +32,33 @@ type outputSign struct {
Signature string
}
+var msgfileFlag = cli.StringFlag{
+ Name: "msgfile",
+ Usage: "file containing the message to sign/verify",
+}
+
var commandSignMessage = cli.Command{
Name: "signmessage",
Usage: "sign a message",
- ArgsUsage: " ",
+ ArgsUsage: " ",
Description: `
Sign the message with a keyfile.
-It is possible to refer to a file containing the message.`,
+
+To sign a message contained in a file, use the --msgfile flag.
+`,
Flags: []cli.Flag{
passphraseFlag,
jsonFlag,
+ msgfileFlag,
},
Action: func(ctx *cli.Context) error {
- keyfilepath := ctx.Args().First()
- message := []byte(ctx.Args().Get(1))
+ message := getMessage(ctx, 1)
// Load the keyfile.
+ keyfilepath := ctx.Args().First()
keyjson, err := ioutil.ReadFile(keyfilepath)
if err != nil {
- utils.Fatalf("Failed to read the keyfile at '%s': %v",
- keyfilepath, err)
+ utils.Fatalf("Failed to read the keyfile at '%s': %v", keyfilepath, err)
}
// Decrypt key with passphrase.
@@ -47,29 +68,15 @@ It is possible to refer to a file containing the message.`,
utils.Fatalf("Error decrypting key: %v", err)
}
- if len(message) == 0 {
- utils.Fatalf("A message must be provided")
- }
- // Read message if file.
- if _, err := os.Stat(string(message)); err == nil {
- message, err = ioutil.ReadFile(string(message))
- if err != nil {
- utils.Fatalf("Failed to read the message file: %v", err)
- }
- }
-
signature, err := crypto.Sign(signHash(message), key.PrivateKey)
if err != nil {
utils.Fatalf("Failed to sign message: %v", err)
}
-
- out := outputSign{
- Signature: hex.EncodeToString(signature),
- }
+ out := outputSign{Signature: hex.EncodeToString(signature)}
if ctx.Bool(jsonFlag.Name) {
mustPrintJSON(out)
} else {
- fmt.Println("Signature: ", out.Signature)
+ fmt.Println("Signature:", out.Signature)
}
return nil
},
@@ -84,53 +91,40 @@ type outputVerify struct {
var commandVerifyMessage = cli.Command{
Name: "verifymessage",
Usage: "verify the signature of a signed message",
- ArgsUsage: " ",
+ ArgsUsage: " ",
Description: `
Verify the signature of the message.
It is possible to refer to a file containing the message.`,
Flags: []cli.Flag{
jsonFlag,
+ msgfileFlag,
},
Action: func(ctx *cli.Context) error {
addressStr := ctx.Args().First()
signatureHex := ctx.Args().Get(1)
- message := []byte(ctx.Args().Get(2))
+ message := getMessage(ctx, 2)
- // Determine whether it is a keyfile, public key or address.
if !common.IsHexAddress(addressStr) {
utils.Fatalf("Invalid address: %s", addressStr)
}
address := common.HexToAddress(addressStr)
-
signature, err := hex.DecodeString(signatureHex)
if err != nil {
utils.Fatalf("Signature encoding is not hexadecimal: %v", err)
}
- if len(message) == 0 {
- utils.Fatalf("A message must be provided")
- }
- // Read message if file.
- if _, err := os.Stat(string(message)); err == nil {
- message, err = ioutil.ReadFile(string(message))
- if err != nil {
- utils.Fatalf("Failed to read the message file: %v", err)
- }
- }
-
recoveredPubkey, err := crypto.SigToPub(signHash(message), signature)
if err != nil || recoveredPubkey == nil {
utils.Fatalf("Signature verification failed: %v", err)
}
recoveredPubkeyBytes := crypto.FromECDSAPub(recoveredPubkey)
recoveredAddress := crypto.PubkeyToAddress(*recoveredPubkey)
-
success := address == recoveredAddress
out := outputVerify{
Success: success,
RecoveredPublicKey: hex.EncodeToString(recoveredPubkeyBytes),
- RecoveredAddress: strings.ToLower(recoveredAddress.Hex()),
+ RecoveredAddress: recoveredAddress.Hex(),
}
if ctx.Bool(jsonFlag.Name) {
mustPrintJSON(out)
@@ -140,9 +134,26 @@ It is possible to refer to a file containing the message.`,
} else {
fmt.Println("Signature verification failed!")
}
- fmt.Println("Recovered public key: ", out.RecoveredPublicKey)
- fmt.Println("Recovered address: ", out.RecoveredAddress)
+ fmt.Println("Recovered public key:", out.RecoveredPublicKey)
+ fmt.Println("Recovered address:", out.RecoveredAddress)
}
return nil
},
}
+
+func getMessage(ctx *cli.Context, msgarg int) []byte {
+ if file := ctx.String("msgfile"); file != "" {
+ if len(ctx.Args()) > msgarg {
+ utils.Fatalf("Can't use --msgfile and message argument at the same time.")
+ }
+ msg, err := ioutil.ReadFile(file)
+ if err != nil {
+ utils.Fatalf("Can't read message file: %v", err)
+ }
+ return msg
+ } else if len(ctx.Args()) == msgarg+1 {
+ return []byte(ctx.Args().Get(msgarg))
+ }
+ utils.Fatalf("Invalid number of arguments: want %d, got %d", msgarg+1, len(ctx.Args()))
+ return nil
+}
diff --git a/cmd/ethkey/message_test.go b/cmd/ethkey/message_test.go
new file mode 100644
index 0000000000..fb16f03d02
--- /dev/null
+++ b/cmd/ethkey/message_test.go
@@ -0,0 +1,70 @@
+// Copyright 2017 The go-ethereum Authors
+// This file is part of go-ethereum.
+//
+// go-ethereum is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// go-ethereum is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with go-ethereum. If not, see .
+
+package main
+
+import (
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+func TestMessageSignVerify(t *testing.T) {
+ tmpdir, err := ioutil.TempDir("", "ethkey-test")
+ if err != nil {
+ t.Fatal("Can't create temporary directory:", err)
+ }
+ defer os.RemoveAll(tmpdir)
+
+ keyfile := filepath.Join(tmpdir, "the-keyfile")
+ message := "test message"
+
+ // Create the key.
+ generate := runEthkey(t, "generate", keyfile)
+ generate.Expect(`
+!! Unsupported terminal, password will be echoed.
+Passphrase: {{.InputLine "foobar"}}
+Repeat passphrase: {{.InputLine "foobar"}}
+`)
+ _, matches := generate.ExpectRegexp(`Address: (0x[0-9a-fA-F]{40})\n`)
+ address := matches[1]
+ generate.ExpectExit()
+
+ // Sign a message.
+ sign := runEthkey(t, "signmessage", keyfile, message)
+ sign.Expect(`
+!! Unsupported terminal, password will be echoed.
+Passphrase: {{.InputLine "foobar"}}
+`)
+ _, matches = sign.ExpectRegexp(`Signature: ([0-9a-f]+)\n`)
+ signature := matches[1]
+ sign.ExpectExit()
+
+ // Verify the message.
+ verify := runEthkey(t, "verifymessage", address, signature, message)
+ _, matches = verify.ExpectRegexp(`
+Signature verification successful!
+Recovered public key: [0-9a-f]+
+Recovered address: (0x[0-9a-fA-F]{40})
+`)
+ recovered := matches[1]
+ verify.ExpectExit()
+
+ if recovered != address {
+ t.Error("recovered address doesn't match generated key")
+ }
+}
diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go
new file mode 100644
index 0000000000..8ce4fe5cde
--- /dev/null
+++ b/cmd/ethkey/run_test.go
@@ -0,0 +1,54 @@
+// Copyright 2017 The go-ethereum Authors
+// This file is part of go-ethereum.
+//
+// go-ethereum is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// go-ethereum is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with go-ethereum. If not, see .
+
+package main
+
+import (
+ "fmt"
+ "os"
+ "testing"
+
+ "github.com/docker/docker/pkg/reexec"
+ "github.com/ethereum/go-ethereum/internal/cmdtest"
+)
+
+type testEthkey struct {
+ *cmdtest.TestCmd
+}
+
+// spawns ethkey with the given command line args.
+func runEthkey(t *testing.T, args ...string) *testEthkey {
+ tt := new(testEthkey)
+ tt.TestCmd = cmdtest.NewTestCmd(t, tt)
+ tt.Run("ethkey-test", args...)
+ return tt
+}
+
+func TestMain(m *testing.M) {
+ // Run the app if we've been exec'd as "ethkey-test" in runEthkey.
+ reexec.Register("ethkey-test", func() {
+ if err := app.Run(os.Args); err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ os.Exit(1)
+ }
+ os.Exit(0)
+ })
+ // check if we have been reexec'd
+ if reexec.Init() {
+ return
+ }
+ os.Exit(m.Run())
+}
diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go
index e92924fc9c..99527f9d1e 100644
--- a/cmd/faucet/faucet.go
+++ b/cmd/faucet/faucet.go
@@ -223,7 +223,6 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network u
NoDiscovery: true,
DiscoveryV5: true,
ListenAddr: fmt.Sprintf(":%d", port),
- DiscoveryV5Addr: fmt.Sprintf(":%d", port+1),
MaxPeers: 25,
BootstrapNodesV5: enodes,
},
diff --git a/cmd/geth/config.go b/cmd/geth/config.go
index 27490c4048..50e4de2e78 100644
--- a/cmd/geth/config.go
+++ b/cmd/geth/config.go
@@ -18,7 +18,6 @@ package main
import (
"bufio"
- "encoding/hex"
"errors"
"fmt"
"io"
@@ -29,7 +28,6 @@ import (
cli "gopkg.in/urfave/cli.v1"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/contracts/release"
"github.com/ethereum/go-ethereum/dashboard"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/node"
@@ -158,7 +156,7 @@ func makeFullNode(ctx *cli.Context) *node.Node {
utils.RegisterEthService(stack, &cfg.Eth)
if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
- utils.RegisterDashboardService(stack, &cfg.Dashboard)
+ utils.RegisterDashboardService(stack, &cfg.Dashboard, gitCommit)
}
// Whisper must be explicitly enabled by specifying at least 1 whisper flag or in dev mode
shhEnabled := enableWhisper(ctx)
@@ -177,21 +175,6 @@ func makeFullNode(ctx *cli.Context) *node.Node {
if cfg.Ethstats.URL != "" {
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)
}
-
- // Add the release oracle service so it boots along with node.
- if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
- config := release.Config{
- Oracle: relOracle,
- Major: uint32(params.VersionMajor),
- Minor: uint32(params.VersionMinor),
- Patch: uint32(params.VersionPatch),
- }
- commit, _ := hex.DecodeString(gitCommit)
- copy(config.Commit[:], commit)
- return release.NewReleaseService(ctx, config)
- }); err != nil {
- utils.Fatalf("Failed to register the Geth release oracle service: %v", err)
- }
return stack
}
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 94ab64c2e0..89d16b968f 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -612,7 +612,7 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
urls = strings.Split(ctx.GlobalString(BootnodesFlag.Name), ",")
}
case ctx.GlobalBool(RinkebyFlag.Name):
- urls = params.RinkebyV5Bootnodes
+ urls = params.RinkebyBootnodes
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
}
@@ -636,14 +636,6 @@ func setListenAddress(ctx *cli.Context, cfg *p2p.Config) {
}
}
-// setDiscoveryV5Address creates a UDP listening address string from set command
-// line flags for the V5 discovery protocol.
-func setDiscoveryV5Address(ctx *cli.Context, cfg *p2p.Config) {
- if ctx.GlobalIsSet(ListenPortFlag.Name) {
- cfg.DiscoveryV5Addr = fmt.Sprintf(":%d", ctx.GlobalInt(ListenPortFlag.Name)+1)
- }
-}
-
// setNAT creates a port mapper from command line flags.
func setNAT(ctx *cli.Context, cfg *p2p.Config) {
if ctx.GlobalIsSet(NATFlag.Name) {
@@ -794,7 +786,6 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
setNodeKey(ctx, cfg)
setNAT(ctx, cfg)
setListenAddress(ctx, cfg)
- setDiscoveryV5Address(ctx, cfg)
setBootstrapNodes(ctx, cfg)
setBootstrapNodesV5(ctx, cfg)
@@ -830,7 +821,6 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
// --dev mode can't use p2p networking.
cfg.MaxPeers = 0
cfg.ListenAddr = ":0"
- cfg.DiscoveryV5Addr = ":0"
cfg.NoDiscovery = true
cfg.DiscoveryV5 = false
}
@@ -1104,9 +1094,9 @@ func RegisterEthService(stack *node.Node, cfg *eth.Config) {
}
// RegisterDashboardService adds a dashboard to the stack.
-func RegisterDashboardService(stack *node.Node, cfg *dashboard.Config) {
+func RegisterDashboardService(stack *node.Node, cfg *dashboard.Config, commit string) {
stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
- return dashboard.New(cfg)
+ return dashboard.New(cfg, commit)
})
}
diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go
index 05e6b29086..e69b57d69f 100644
--- a/cmd/wnode/main.go
+++ b/cmd/wnode/main.go
@@ -601,7 +601,7 @@ func requestExpiredMessagesLoop() {
if err != nil {
utils.Fatalf("Failed to save symmetric key for mail request: %s", err)
}
- peerID = extractIdFromEnode(*argEnode)
+ peerID = extractIDFromEnode(*argEnode)
shh.AllowP2PMessagesFromPeer(peerID)
for {
@@ -652,7 +652,7 @@ func requestExpiredMessagesLoop() {
}
}
-func extractIdFromEnode(s string) []byte {
+func extractIDFromEnode(s string) []byte {
n, err := discover.ParseNode(s)
if err != nil {
utils.Fatalf("Failed to parse enode: %s", err)
diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go
index 76f19252fa..10767bb312 100644
--- a/consensus/ethash/algorithm.go
+++ b/consensus/ethash/algorithm.go
@@ -355,9 +355,11 @@ func hashimotoFull(dataset []uint32, hash []byte, nonce uint64) ([]byte, []byte)
return hashimoto(hash, nonce, uint64(len(dataset))*4, lookup)
}
+const maxEpoch = 2048
+
// datasetSizes is a lookup table for the ethash dataset size for the first 2048
// epochs (i.e. 61440000 blocks).
-var datasetSizes = []uint64{
+var datasetSizes = [maxEpoch]uint64{
1073739904, 1082130304, 1090514816, 1098906752, 1107293056,
1115684224, 1124070016, 1132461952, 1140849536, 1149232768,
1157627776, 1166013824, 1174404736, 1182786944, 1191180416,
@@ -771,7 +773,7 @@ var datasetSizes = []uint64{
// cacheSizes is a lookup table for the ethash verification cache size for the
// first 2048 epochs (i.e. 61440000 blocks).
-var cacheSizes = []uint64{
+var cacheSizes = [maxEpoch]uint64{
16776896, 16907456, 17039296, 17170112, 17301056, 17432512, 17563072,
17693888, 17824192, 17955904, 18087488, 18218176, 18349504, 18481088,
18611392, 18742336, 18874304, 19004224, 19135936, 19267264, 19398208,
diff --git a/consensus/ethash/algorithm_go1.7.go b/consensus/ethash/algorithm_go1.7.go
index c34d041c32..c7f7f48e41 100644
--- a/consensus/ethash/algorithm_go1.7.go
+++ b/consensus/ethash/algorithm_go1.7.go
@@ -25,7 +25,7 @@ package ethash
func cacheSize(block uint64) uint64 {
// If we have a pre-generated value, use that
epoch := int(block / epochLength)
- if epoch < len(cacheSizes) {
+ if epoch < maxEpoch {
return cacheSizes[epoch]
}
// We don't have a way to verify primes fast before Go 1.8
@@ -39,7 +39,7 @@ func cacheSize(block uint64) uint64 {
func datasetSize(block uint64) uint64 {
// If we have a pre-generated value, use that
epoch := int(block / epochLength)
- if epoch < len(datasetSizes) {
+ if epoch < maxEpoch {
return datasetSizes[epoch]
}
// We don't have a way to verify primes fast before Go 1.8
diff --git a/consensus/ethash/algorithm_go1.8.go b/consensus/ethash/algorithm_go1.8.go
index d691b758f0..975fdffe51 100644
--- a/consensus/ethash/algorithm_go1.8.go
+++ b/consensus/ethash/algorithm_go1.8.go
@@ -20,17 +20,20 @@ package ethash
import "math/big"
-// cacheSize calculates and returns the size of the ethash verification cache that
-// belongs to a certain block number. The cache size grows linearly, however, we
-// always take the highest prime below the linearly growing threshold in order to
-// reduce the risk of accidental regularities leading to cyclic behavior.
+// cacheSize returns the size of the ethash verification cache that belongs to a certain
+// block number.
func cacheSize(block uint64) uint64 {
- // If we have a pre-generated value, use that
epoch := int(block / epochLength)
- if epoch < len(cacheSizes) {
+ if epoch < maxEpoch {
return cacheSizes[epoch]
}
- // No known cache size, calculate manually (sanity branch only)
+ return calcCacheSize(epoch)
+}
+
+// calcCacheSize calculates the cache size for epoch. The cache size grows linearly,
+// however, we always take the highest prime below the linearly growing threshold in order
+// to reduce the risk of accidental regularities leading to cyclic behavior.
+func calcCacheSize(epoch int) uint64 {
size := cacheInitBytes + cacheGrowthBytes*uint64(epoch) - hashBytes
for !new(big.Int).SetUint64(size / hashBytes).ProbablyPrime(1) { // Always accurate for n < 2^64
size -= 2 * hashBytes
@@ -38,17 +41,20 @@ func cacheSize(block uint64) uint64 {
return size
}
-// datasetSize calculates and returns the size of the ethash mining dataset that
-// belongs to a certain block number. The dataset size grows linearly, however, we
-// always take the highest prime below the linearly growing threshold in order to
-// reduce the risk of accidental regularities leading to cyclic behavior.
+// datasetSize returns the size of the ethash mining dataset that belongs to a certain
+// block number.
func datasetSize(block uint64) uint64 {
- // If we have a pre-generated value, use that
epoch := int(block / epochLength)
- if epoch < len(datasetSizes) {
+ if epoch < maxEpoch {
return datasetSizes[epoch]
}
- // No known dataset size, calculate manually (sanity branch only)
+ return calcDatasetSize(epoch)
+}
+
+// calcDatasetSize calculates the dataset size for epoch. The dataset size grows linearly,
+// however, we always take the highest prime below the linearly growing threshold in order
+// to reduce the risk of accidental regularities leading to cyclic behavior.
+func calcDatasetSize(epoch int) uint64 {
size := datasetInitBytes + datasetGrowthBytes*uint64(epoch) - mixBytes
for !new(big.Int).SetUint64(size / mixBytes).ProbablyPrime(1) { // Always accurate for n < 2^64
size -= 2 * mixBytes
diff --git a/consensus/ethash/algorithm_go1.8_test.go b/consensus/ethash/algorithm_go1.8_test.go
index a822944a60..6648bd6a97 100644
--- a/consensus/ethash/algorithm_go1.8_test.go
+++ b/consensus/ethash/algorithm_go1.8_test.go
@@ -23,24 +23,15 @@ import "testing"
// Tests whether the dataset size calculator works correctly by cross checking the
// hard coded lookup table with the value generated by it.
func TestSizeCalculations(t *testing.T) {
- var tests []uint64
-
- // Verify all the cache sizes from the lookup table
- defer func(sizes []uint64) { cacheSizes = sizes }(cacheSizes)
- tests, cacheSizes = cacheSizes, []uint64{}
-
- for i, test := range tests {
- if size := cacheSize(uint64(i*epochLength) + 1); size != test {
- t.Errorf("cache %d: cache size mismatch: have %d, want %d", i, size, test)
+ // Verify all the cache and dataset sizes from the lookup table.
+ for epoch, want := range cacheSizes {
+ if size := calcCacheSize(epoch); size != want {
+ t.Errorf("cache %d: cache size mismatch: have %d, want %d", epoch, size, want)
}
}
- // Verify all the dataset sizes from the lookup table
- defer func(sizes []uint64) { datasetSizes = sizes }(datasetSizes)
- tests, datasetSizes = datasetSizes, []uint64{}
-
- for i, test := range tests {
- if size := datasetSize(uint64(i*epochLength) + 1); size != test {
- t.Errorf("dataset %d: dataset size mismatch: have %d, want %d", i, size, test)
+ for epoch, want := range datasetSizes {
+ if size := calcDatasetSize(epoch); size != want {
+ t.Errorf("dataset %d: dataset size mismatch: have %d, want %d", epoch, size, want)
}
}
}
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go
index 82d23c92b6..92a23d4a4d 100644
--- a/consensus/ethash/consensus.go
+++ b/consensus/ethash/consensus.go
@@ -476,7 +476,7 @@ func (ethash *Ethash) VerifySeal(chain consensus.ChainReader, header *types.Head
}
// Sanity check that the block number is below the lookup table size (60M blocks)
number := header.Number.Uint64()
- if number/epochLength >= uint64(len(cacheSizes)) {
+ if number/epochLength >= maxEpoch {
// Go < 1.7 cannot calculate new cache/dataset sizes (no fast prime check)
return errNonceOutOfRange
}
@@ -484,14 +484,18 @@ func (ethash *Ethash) VerifySeal(chain consensus.ChainReader, header *types.Head
if header.Difficulty.Sign() <= 0 {
return errInvalidDifficulty
}
+
// Recompute the digest and PoW value and verify against the header
cache := ethash.cache(number)
-
size := datasetSize(number)
if ethash.config.PowMode == ModeTest {
size = 32 * 1024
}
- digest, result := hashimotoLight(size, cache, header.HashNoNonce().Bytes(), header.Nonce.Uint64())
+ digest, result := hashimotoLight(size, cache.cache, header.HashNoNonce().Bytes(), header.Nonce.Uint64())
+ // Caches are unmapped in a finalizer. Ensure that the cache stays live
+ // until after the call to hashimotoLight so it's not unmapped while being used.
+ runtime.KeepAlive(cache)
+
if !bytes.Equal(header.MixDigest[:], digest) {
return errInvalidMixDigest
}
diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go
index a78b3a895d..91e20112ae 100644
--- a/consensus/ethash/ethash.go
+++ b/consensus/ethash/ethash.go
@@ -26,6 +26,7 @@ import (
"os"
"path/filepath"
"reflect"
+ "runtime"
"strconv"
"sync"
"time"
@@ -35,6 +36,7 @@ import (
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
+ "github.com/hashicorp/golang-lru/simplelru"
metrics "github.com/rcrowley/go-metrics"
)
@@ -142,32 +144,82 @@ func memoryMapAndGenerate(path string, size uint64, generator func(buffer []uint
return memoryMap(path)
}
+// lru tracks caches or datasets by their last use time, keeping at most N of them.
+type lru struct {
+ what string
+ new func(epoch uint64) interface{}
+ mu sync.Mutex
+ // Items are kept in a LRU cache, but there is a special case:
+ // We always keep an item for (highest seen epoch) + 1 as the 'future item'.
+ cache *simplelru.LRU
+ future uint64
+ futureItem interface{}
+}
+
+// newlru create a new least-recently-used cache for ither the verification caches
+// or the mining datasets.
+func newlru(what string, maxItems int, new func(epoch uint64) interface{}) *lru {
+ if maxItems <= 0 {
+ maxItems = 1
+ }
+ cache, _ := simplelru.NewLRU(maxItems, func(key, value interface{}) {
+ log.Trace("Evicted ethash "+what, "epoch", key)
+ })
+ return &lru{what: what, new: new, cache: cache}
+}
+
+// get retrieves or creates an item for the given epoch. The first return value is always
+// non-nil. The second return value is non-nil if lru thinks that an item will be useful in
+// the near future.
+func (lru *lru) get(epoch uint64) (item, future interface{}) {
+ lru.mu.Lock()
+ defer lru.mu.Unlock()
+
+ // Get or create the item for the requested epoch.
+ item, ok := lru.cache.Get(epoch)
+ if !ok {
+ if lru.future > 0 && lru.future == epoch {
+ item = lru.futureItem
+ } else {
+ log.Trace("Requiring new ethash "+lru.what, "epoch", epoch)
+ item = lru.new(epoch)
+ }
+ lru.cache.Add(epoch, item)
+ }
+ // Update the 'future item' if epoch is larger than previously seen.
+ if epoch < maxEpoch-1 && lru.future < epoch+1 {
+ log.Trace("Requiring new future ethash "+lru.what, "epoch", epoch+1)
+ future = lru.new(epoch + 1)
+ lru.future = epoch + 1
+ lru.futureItem = future
+ }
+ return item, future
+}
+
// cache wraps an ethash cache with some metadata to allow easier concurrent use.
type cache struct {
- epoch uint64 // Epoch for which this cache is relevant
+ epoch uint64 // Epoch for which this cache is relevant
+ dump *os.File // File descriptor of the memory mapped cache
+ mmap mmap.MMap // Memory map itself to unmap before releasing
+ cache []uint32 // The actual cache data content (may be memory mapped)
+ once sync.Once // Ensures the cache is generated only once
+}
- dump *os.File // File descriptor of the memory mapped cache
- mmap mmap.MMap // Memory map itself to unmap before releasing
-
- cache []uint32 // The actual cache data content (may be memory mapped)
- used time.Time // Timestamp of the last use for smarter eviction
- once sync.Once // Ensures the cache is generated only once
- lock sync.Mutex // Ensures thread safety for updating the usage time
+// newCache creates a new ethash verification cache and returns it as a plain Go
+// interface to be usable in an LRU cache.
+func newCache(epoch uint64) interface{} {
+ return &cache{epoch: epoch}
}
// generate ensures that the cache content is generated before use.
func (c *cache) generate(dir string, limit int, test bool) {
c.once.Do(func() {
- // If we have a testing cache, generate and return
- if test {
- c.cache = make([]uint32, 1024/4)
- generateCache(c.cache, c.epoch, seedHash(c.epoch*epochLength+1))
- return
- }
- // If we don't store anything on disk, generate and return
size := cacheSize(c.epoch*epochLength + 1)
seed := seedHash(c.epoch*epochLength + 1)
-
+ if test {
+ size = 1024
+ }
+ // If we don't store anything on disk, generate and return.
if dir == "" {
c.cache = make([]uint32, size/4)
generateCache(c.cache, c.epoch, seed)
@@ -181,6 +233,10 @@ func (c *cache) generate(dir string, limit int, test bool) {
path := filepath.Join(dir, fmt.Sprintf("cache-R%d-%x%s", algorithmRevision, seed[:8], endian))
logger := log.New("epoch", c.epoch)
+ // We're about to mmap the file, ensure that the mapping is cleaned up when the
+ // cache becomes unused.
+ runtime.SetFinalizer(c, (*cache).finalizer)
+
// Try to load the file from disk and memory map it
var err error
c.dump, c.mmap, c.cache, err = memoryMap(path)
@@ -207,49 +263,41 @@ func (c *cache) generate(dir string, limit int, test bool) {
})
}
-// release closes any file handlers and memory maps open.
-func (c *cache) release() {
+// finalizer unmaps the memory and closes the file.
+func (c *cache) finalizer() {
if c.mmap != nil {
c.mmap.Unmap()
- c.mmap = nil
- }
- if c.dump != nil {
c.dump.Close()
- c.dump = nil
+ c.mmap, c.dump = nil, nil
}
}
// dataset wraps an ethash dataset with some metadata to allow easier concurrent use.
type dataset struct {
- epoch uint64 // Epoch for which this cache is relevant
+ epoch uint64 // Epoch for which this cache is relevant
+ dump *os.File // File descriptor of the memory mapped cache
+ mmap mmap.MMap // Memory map itself to unmap before releasing
+ dataset []uint32 // The actual cache data content
+ once sync.Once // Ensures the cache is generated only once
+}
- dump *os.File // File descriptor of the memory mapped cache
- mmap mmap.MMap // Memory map itself to unmap before releasing
-
- dataset []uint32 // The actual cache data content
- used time.Time // Timestamp of the last use for smarter eviction
- once sync.Once // Ensures the cache is generated only once
- lock sync.Mutex // Ensures thread safety for updating the usage time
+// newDataset creates a new ethash mining dataset and returns it as a plain Go
+// interface to be usable in an LRU cache.
+func newDataset(epoch uint64) interface{} {
+ return &dataset{epoch: epoch}
}
// generate ensures that the dataset content is generated before use.
func (d *dataset) generate(dir string, limit int, test bool) {
d.once.Do(func() {
- // If we have a testing dataset, generate and return
- if test {
- cache := make([]uint32, 1024/4)
- generateCache(cache, d.epoch, seedHash(d.epoch*epochLength+1))
-
- d.dataset = make([]uint32, 32*1024/4)
- generateDataset(d.dataset, d.epoch, cache)
-
- return
- }
- // If we don't store anything on disk, generate and return
csize := cacheSize(d.epoch*epochLength + 1)
dsize := datasetSize(d.epoch*epochLength + 1)
seed := seedHash(d.epoch*epochLength + 1)
-
+ if test {
+ csize = 1024
+ dsize = 32 * 1024
+ }
+ // If we don't store anything on disk, generate and return
if dir == "" {
cache := make([]uint32, csize/4)
generateCache(cache, d.epoch, seed)
@@ -265,6 +313,10 @@ func (d *dataset) generate(dir string, limit int, test bool) {
path := filepath.Join(dir, fmt.Sprintf("full-R%d-%x%s", algorithmRevision, seed[:8], endian))
logger := log.New("epoch", d.epoch)
+ // We're about to mmap the file, ensure that the mapping is cleaned up when the
+ // cache becomes unused.
+ runtime.SetFinalizer(d, (*dataset).finalizer)
+
// Try to load the file from disk and memory map it
var err error
d.dump, d.mmap, d.dataset, err = memoryMap(path)
@@ -294,15 +346,12 @@ func (d *dataset) generate(dir string, limit int, test bool) {
})
}
-// release closes any file handlers and memory maps open.
-func (d *dataset) release() {
+// finalizer closes any file handlers and memory maps open.
+func (d *dataset) finalizer() {
if d.mmap != nil {
d.mmap.Unmap()
- d.mmap = nil
- }
- if d.dump != nil {
d.dump.Close()
- d.dump = nil
+ d.mmap, d.dump = nil, nil
}
}
@@ -310,14 +359,12 @@ func (d *dataset) release() {
func MakeCache(block uint64, dir string) {
c := cache{epoch: block / epochLength}
c.generate(dir, math.MaxInt32, false)
- c.release()
}
// MakeDataset generates a new ethash dataset and optionally stores it to disk.
func MakeDataset(block uint64, dir string) {
d := dataset{epoch: block / epochLength}
d.generate(dir, math.MaxInt32, false)
- d.release()
}
// Mode defines the type and amount of PoW verification an ethash engine makes.
@@ -347,10 +394,8 @@ type Config struct {
type Ethash struct {
config Config
- caches map[uint64]*cache // In memory caches to avoid regenerating too often
- fcache *cache // Pre-generated cache for the estimated future epoch
- datasets map[uint64]*dataset // In memory datasets to avoid regenerating too often
- fdataset *dataset // Pre-generated dataset for the estimated future epoch
+ caches *lru // In memory caches to avoid regenerating too often
+ datasets *lru // In memory datasets to avoid regenerating too often
// Mining related fields
rand *rand.Rand // Properly seeded random source for nonces
@@ -380,8 +425,8 @@ func New(config Config) *Ethash {
}
return &Ethash{
config: config,
- caches: make(map[uint64]*cache),
- datasets: make(map[uint64]*dataset),
+ caches: newlru("cache", config.CachesInMem, newCache),
+ datasets: newlru("dataset", config.DatasetsInMem, newDataset),
update: make(chan struct{}),
hashrate: metrics.NewMeter(),
}
@@ -390,16 +435,7 @@ func New(config Config) *Ethash {
// NewTester creates a small sized ethash PoW scheme useful only for testing
// purposes.
func NewTester() *Ethash {
- return &Ethash{
- config: Config{
- CachesInMem: 1,
- PowMode: ModeTest,
- },
- caches: make(map[uint64]*cache),
- datasets: make(map[uint64]*dataset),
- update: make(chan struct{}),
- hashrate: metrics.NewMeter(),
- }
+ return New(Config{CachesInMem: 1, PowMode: ModeTest})
}
// NewFaker creates a ethash consensus engine with a fake PoW scheme that accepts
@@ -456,126 +492,40 @@ func NewShared() *Ethash {
// cache tries to retrieve a verification cache for the specified block number
// by first checking against a list of in-memory caches, then against caches
// stored on disk, and finally generating one if none can be found.
-func (ethash *Ethash) cache(block uint64) []uint32 {
+func (ethash *Ethash) cache(block uint64) *cache {
epoch := block / epochLength
+ currentI, futureI := ethash.caches.get(epoch)
+ current := currentI.(*cache)
- // If we have a PoW for that epoch, use that
- ethash.lock.Lock()
-
- current, future := ethash.caches[epoch], (*cache)(nil)
- if current == nil {
- // No in-memory cache, evict the oldest if the cache limit was reached
- for len(ethash.caches) > 0 && len(ethash.caches) >= ethash.config.CachesInMem {
- var evict *cache
- for _, cache := range ethash.caches {
- if evict == nil || evict.used.After(cache.used) {
- evict = cache
- }
- }
- delete(ethash.caches, evict.epoch)
- evict.release()
-
- log.Trace("Evicted ethash cache", "epoch", evict.epoch, "used", evict.used)
- }
- // If we have the new cache pre-generated, use that, otherwise create a new one
- if ethash.fcache != nil && ethash.fcache.epoch == epoch {
- log.Trace("Using pre-generated cache", "epoch", epoch)
- current, ethash.fcache = ethash.fcache, nil
- } else {
- log.Trace("Requiring new ethash cache", "epoch", epoch)
- current = &cache{epoch: epoch}
- }
- ethash.caches[epoch] = current
-
- // If we just used up the future cache, or need a refresh, regenerate
- if ethash.fcache == nil || ethash.fcache.epoch <= epoch {
- if ethash.fcache != nil {
- ethash.fcache.release()
- }
- log.Trace("Requiring new future ethash cache", "epoch", epoch+1)
- future = &cache{epoch: epoch + 1}
- ethash.fcache = future
- }
- // New current cache, set its initial timestamp
- current.used = time.Now()
- }
- ethash.lock.Unlock()
-
- // Wait for generation finish, bump the timestamp and finalize the cache
+ // Wait for generation finish.
current.generate(ethash.config.CacheDir, ethash.config.CachesOnDisk, ethash.config.PowMode == ModeTest)
- current.lock.Lock()
- current.used = time.Now()
- current.lock.Unlock()
-
- // If we exhausted the future cache, now's a good time to regenerate it
- if future != nil {
+ // If we need a new future cache, now's a good time to regenerate it.
+ if futureI != nil {
+ future := futureI.(*cache)
go future.generate(ethash.config.CacheDir, ethash.config.CachesOnDisk, ethash.config.PowMode == ModeTest)
}
- return current.cache
+ return current
}
// dataset tries to retrieve a mining dataset for the specified block number
// by first checking against a list of in-memory datasets, then against DAGs
// stored on disk, and finally generating one if none can be found.
-func (ethash *Ethash) dataset(block uint64) []uint32 {
+func (ethash *Ethash) dataset(block uint64) *dataset {
epoch := block / epochLength
+ currentI, futureI := ethash.datasets.get(epoch)
+ current := currentI.(*dataset)
- // If we have a PoW for that epoch, use that
- ethash.lock.Lock()
-
- current, future := ethash.datasets[epoch], (*dataset)(nil)
- if current == nil {
- // No in-memory dataset, evict the oldest if the dataset limit was reached
- for len(ethash.datasets) > 0 && len(ethash.datasets) >= ethash.config.DatasetsInMem {
- var evict *dataset
- for _, dataset := range ethash.datasets {
- if evict == nil || evict.used.After(dataset.used) {
- evict = dataset
- }
- }
- delete(ethash.datasets, evict.epoch)
- evict.release()
-
- log.Trace("Evicted ethash dataset", "epoch", evict.epoch, "used", evict.used)
- }
- // If we have the new cache pre-generated, use that, otherwise create a new one
- if ethash.fdataset != nil && ethash.fdataset.epoch == epoch {
- log.Trace("Using pre-generated dataset", "epoch", epoch)
- current = &dataset{epoch: ethash.fdataset.epoch} // Reload from disk
- ethash.fdataset = nil
- } else {
- log.Trace("Requiring new ethash dataset", "epoch", epoch)
- current = &dataset{epoch: epoch}
- }
- ethash.datasets[epoch] = current
-
- // If we just used up the future dataset, or need a refresh, regenerate
- if ethash.fdataset == nil || ethash.fdataset.epoch <= epoch {
- if ethash.fdataset != nil {
- ethash.fdataset.release()
- }
- log.Trace("Requiring new future ethash dataset", "epoch", epoch+1)
- future = &dataset{epoch: epoch + 1}
- ethash.fdataset = future
- }
- // New current dataset, set its initial timestamp
- current.used = time.Now()
- }
- ethash.lock.Unlock()
-
- // Wait for generation finish, bump the timestamp and finalize the cache
+ // Wait for generation finish.
current.generate(ethash.config.DatasetDir, ethash.config.DatasetsOnDisk, ethash.config.PowMode == ModeTest)
- current.lock.Lock()
- current.used = time.Now()
- current.lock.Unlock()
-
- // If we exhausted the future dataset, now's a good time to regenerate it
- if future != nil {
+ // If we need a new future dataset, now's a good time to regenerate it.
+ if futureI != nil {
+ future := futureI.(*dataset)
go future.generate(ethash.config.DatasetDir, ethash.config.DatasetsOnDisk, ethash.config.PowMode == ModeTest)
}
- return current.dataset
+
+ return current
}
// Threads returns the number of mining threads currently enabled. This doesn't
diff --git a/consensus/ethash/ethash_test.go b/consensus/ethash/ethash_test.go
index b3a2f32f70..31116da437 100644
--- a/consensus/ethash/ethash_test.go
+++ b/consensus/ethash/ethash_test.go
@@ -17,7 +17,11 @@
package ethash
import (
+ "io/ioutil"
"math/big"
+ "math/rand"
+ "os"
+ "sync"
"testing"
"github.com/ethereum/go-ethereum/core/types"
@@ -38,3 +42,38 @@ func TestTestMode(t *testing.T) {
t.Fatalf("unexpected verification error: %v", err)
}
}
+
+// This test checks that cache lru logic doesn't crash under load.
+// It reproduces https://github.com/ethereum/go-ethereum/issues/14943
+func TestCacheFileEvict(t *testing.T) {
+ tmpdir, err := ioutil.TempDir("", "ethash-test")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer os.RemoveAll(tmpdir)
+ e := New(Config{CachesInMem: 3, CachesOnDisk: 10, CacheDir: tmpdir, PowMode: ModeTest})
+
+ workers := 8
+ epochs := 100
+ var wg sync.WaitGroup
+ wg.Add(workers)
+ for i := 0; i < workers; i++ {
+ go verifyTest(&wg, e, i, epochs)
+ }
+ wg.Wait()
+}
+
+func verifyTest(wg *sync.WaitGroup, e *Ethash, workerIndex, epochs int) {
+ defer wg.Done()
+
+ const wiggle = 4 * epochLength
+ r := rand.New(rand.NewSource(int64(workerIndex)))
+ for epoch := 0; epoch < epochs; epoch++ {
+ block := int64(epoch)*epochLength - wiggle/2 + r.Int63n(wiggle)
+ if block < 0 {
+ block = 0
+ }
+ head := &types.Header{Number: big.NewInt(block), Difficulty: big.NewInt(100)}
+ e.VerifySeal(nil, head)
+ }
+}
diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go
index c2447e4730..b5e742d8bb 100644
--- a/consensus/ethash/sealer.go
+++ b/consensus/ethash/sealer.go
@@ -97,10 +97,9 @@ func (ethash *Ethash) Seal(chain consensus.ChainReader, block *types.Block, stop
func (ethash *Ethash) mine(block *types.Block, id int, seed uint64, abort chan struct{}, found chan *types.Block) {
// Extract some data from the header
var (
- header = block.Header()
- hash = header.HashNoNonce().Bytes()
- target = new(big.Int).Div(maxUint256, header.Difficulty)
-
+ header = block.Header()
+ hash = header.HashNoNonce().Bytes()
+ target = new(big.Int).Div(maxUint256, header.Difficulty)
number = header.Number.Uint64()
dataset = ethash.dataset(number)
)
@@ -111,13 +110,14 @@ func (ethash *Ethash) mine(block *types.Block, id int, seed uint64, abort chan s
)
logger := log.New("miner", id)
logger.Trace("Started ethash search for new nonces", "seed", seed)
+search:
for {
select {
case <-abort:
// Mining terminated, update stats and abort
logger.Trace("Ethash nonce search aborted", "attempts", nonce-seed)
ethash.hashrate.Mark(attempts)
- return
+ break search
default:
// We don't have to update hash rate on every nonce, so update after after 2^X nonces
@@ -127,7 +127,7 @@ func (ethash *Ethash) mine(block *types.Block, id int, seed uint64, abort chan s
attempts = 0
}
// Compute the PoW value of this nonce
- digest, result := hashimotoFull(dataset, hash, nonce)
+ digest, result := hashimotoFull(dataset.dataset, hash, nonce)
if new(big.Int).SetBytes(result).Cmp(target) <= 0 {
// Correct nonce found, create a new header with it
header = types.CopyHeader(header)
@@ -141,9 +141,12 @@ func (ethash *Ethash) mine(block *types.Block, id int, seed uint64, abort chan s
case <-abort:
logger.Trace("Ethash nonce found but discarded", "attempts", nonce-seed, "nonce", nonce)
}
- return
+ break search
}
nonce++
}
}
+ // Datasets are unmapped in a finalizer. Ensure that the dataset stays live
+ // during sealing so it's not unmapped while being read.
+ runtime.KeepAlive(dataset)
}
diff --git a/contracts/chequebook/contract/chequebook.go b/contracts/chequebook/contract/chequebook.go
index ce29b01f0b..e275ac9b8d 100644
--- a/contracts/chequebook/contract/chequebook.go
+++ b/contracts/chequebook/contract/chequebook.go
@@ -7,17 +7,19 @@ 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"
)
// ChequebookABI is the input ABI used to generate the binding from.
const ChequebookABI = "[{\"constant\":false,\"inputs\":[],\"name\":\"kill\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"sent\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"beneficiary\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"sig_v\",\"type\":\"uint8\"},{\"name\":\"sig_r\",\"type\":\"bytes32\"},{\"name\":\"sig_s\",\"type\":\"bytes32\"}],\"name\":\"cash\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"deadbeat\",\"type\":\"address\"}],\"name\":\"Overdraft\",\"type\":\"event\"}]"
// ChequebookBin is the compiled bytecode used for deploying new contracts.
-const ChequebookBin = `0x606060405260008054600160a060020a033316600160a060020a03199091161790556102ec806100306000396000f3006060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a7230582014e927522ca5cd8f68529ac4d3b9cdf36d40e09d8a33b70008248d1abebf79680029`
+const ChequebookBin = `0x606060405260008054600160a060020a033316600160a060020a03199091161790556102ec806100306000396000f3006060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a72305820533e856fc37e3d64d1706bcc7dfb6b1d490c8d566ea498d9d01ec08965a896ca0029`
// DeployChequebook deploys a new Ethereum contract, binding an instance of Chequebook to it.
func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Chequebook, error) {
@@ -29,13 +31,14 @@ func DeployChequebook(auth *bind.TransactOpts, backend bind.ContractBackend) (co
if err != nil {
return common.Address{}, nil, nil, err
}
- return address, tx, &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}}, nil
+ return address, tx, &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}, ChequebookFilterer: ChequebookFilterer{contract: contract}}, nil
}
// Chequebook is an auto generated Go binding around an Ethereum contract.
type Chequebook struct {
ChequebookCaller // Read-only binding to the contract
ChequebookTransactor // Write-only binding to the contract
+ ChequebookFilterer // Log filterer for contract events
}
// ChequebookCaller is an auto generated read-only Go binding around an Ethereum contract.
@@ -48,6 +51,11 @@ type ChequebookTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
+// ChequebookFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
+type ChequebookFilterer struct {
+ contract *bind.BoundContract // Generic contract wrapper for the low level calls
+}
+
// ChequebookSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type ChequebookSession struct {
@@ -87,16 +95,16 @@ type ChequebookTransactorRaw struct {
// NewChequebook creates a new instance of Chequebook, bound to a specific deployed contract.
func NewChequebook(address common.Address, backend bind.ContractBackend) (*Chequebook, error) {
- contract, err := bindChequebook(address, backend, backend)
+ contract, err := bindChequebook(address, backend, backend, backend)
if err != nil {
return nil, err
}
- return &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}}, nil
+ return &Chequebook{ChequebookCaller: ChequebookCaller{contract: contract}, ChequebookTransactor: ChequebookTransactor{contract: contract}, ChequebookFilterer: ChequebookFilterer{contract: contract}}, nil
}
// NewChequebookCaller creates a new read-only instance of Chequebook, bound to a specific deployed contract.
func NewChequebookCaller(address common.Address, caller bind.ContractCaller) (*ChequebookCaller, error) {
- contract, err := bindChequebook(address, caller, nil)
+ contract, err := bindChequebook(address, caller, nil, nil)
if err != nil {
return nil, err
}
@@ -105,20 +113,29 @@ func NewChequebookCaller(address common.Address, caller bind.ContractCaller) (*C
// NewChequebookTransactor creates a new write-only instance of Chequebook, bound to a specific deployed contract.
func NewChequebookTransactor(address common.Address, transactor bind.ContractTransactor) (*ChequebookTransactor, error) {
- contract, err := bindChequebook(address, nil, transactor)
+ contract, err := bindChequebook(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &ChequebookTransactor{contract: contract}, nil
}
+// NewChequebookFilterer creates a new log filterer instance of Chequebook, bound to a specific deployed contract.
+func NewChequebookFilterer(address common.Address, filterer bind.ContractFilterer) (*ChequebookFilterer, error) {
+ contract, err := bindChequebook(address, nil, nil, filterer)
+ if err != nil {
+ return nil, err
+ }
+ return &ChequebookFilterer{contract: contract}, nil
+}
+
// bindChequebook binds a generic wrapper to an already deployed contract.
-func bindChequebook(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
+func bindChequebook(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(ChequebookABI))
if err != nil {
return nil, err
}
- return bind.NewBoundContract(address, parsed, caller, transactor), nil
+ return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
@@ -226,3 +243,125 @@ func (_Chequebook *ChequebookSession) Kill() (*types.Transaction, error) {
func (_Chequebook *ChequebookTransactorSession) Kill() (*types.Transaction, error) {
return _Chequebook.Contract.Kill(&_Chequebook.TransactOpts)
}
+
+// ChequebookOverdraftIterator is returned from FilterOverdraft and is used to iterate over the raw logs and unpacked data for Overdraft events raised by the Chequebook contract.
+type ChequebookOverdraftIterator struct {
+ Event *ChequebookOverdraft // 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 *ChequebookOverdraftIterator) 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(ChequebookOverdraft)
+ 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(ChequebookOverdraft)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *ChequebookOverdraftIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *ChequebookOverdraftIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// ChequebookOverdraft represents a Overdraft event raised by the Chequebook contract.
+type ChequebookOverdraft struct {
+ Deadbeat common.Address
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterOverdraft is a free log retrieval operation binding the contract event 0x2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f978.
+//
+// Solidity: event Overdraft(deadbeat address)
+func (_Chequebook *ChequebookFilterer) FilterOverdraft(opts *bind.FilterOpts) (*ChequebookOverdraftIterator, error) {
+
+ logs, sub, err := _Chequebook.contract.FilterLogs(opts, "Overdraft")
+ if err != nil {
+ return nil, err
+ }
+ return &ChequebookOverdraftIterator{contract: _Chequebook.contract, event: "Overdraft", logs: logs, sub: sub}, nil
+}
+
+// WatchOverdraft is a free log subscription operation binding the contract event 0x2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f978.
+//
+// Solidity: event Overdraft(deadbeat address)
+func (_Chequebook *ChequebookFilterer) WatchOverdraft(opts *bind.WatchOpts, sink chan<- *ChequebookOverdraft) (event.Subscription, error) {
+
+ logs, sub, err := _Chequebook.contract.WatchLogs(opts, "Overdraft")
+ 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(ChequebookOverdraft)
+ if err := _Chequebook.contract.UnpackLog(event, "Overdraft", 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/contracts/chequebook/contract/code.go b/contracts/chequebook/contract/code.go
index 9d1fb169e7..d837a9d601 100644
--- a/contracts/chequebook/contract/code.go
+++ b/contracts/chequebook/contract/code.go
@@ -2,4 +2,4 @@ package contract
// ContractDeployedCode is used to detect suicides. This constant needs to be
// updated when the contract code is changed.
-const ContractDeployedCode = "0x6060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a7230582014e927522ca5cd8f68529ac4d3b9cdf36d40e09d8a33b70008248d1abebf79680029"
+const ContractDeployedCode = "0x6060604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166341c0e1b581146100585780637bf786f81461006b578063fbf788d61461009c575b005b341561006357600080fd5b6100566100ca565b341561007657600080fd5b61008a600160a060020a03600435166100f1565b60405190815260200160405180910390f35b34156100a757600080fd5b610056600160a060020a036004351660243560ff60443516606435608435610103565b60005433600160a060020a03908116911614156100ef57600054600160a060020a0316ff5b565b60016020526000908152604090205481565b600160a060020a0385166000908152600160205260408120548190861161012957600080fd5b3087876040516c01000000000000000000000000600160a060020a03948516810282529290931690910260148301526028820152604801604051809103902091506001828686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156101cf57600080fd5b505060206040510351600054600160a060020a039081169116146101f257600080fd5b50600160a060020a03808716600090815260016020526040902054860390301631811161026257600160a060020a0387166000818152600160205260409081902088905582156108fc0290839051600060405180830381858888f19350505050151561025d57600080fd5b6102b7565b6000547f2250e2993c15843b32621c89447cc589ee7a9f049c026986e545d3c2c0c6f97890600160a060020a0316604051600160a060020a03909116815260200160405180910390a186600160a060020a0316ff5b505050505050505600a165627a7a72305820533e856fc37e3d64d1706bcc7dfb6b1d490c8d566ea498d9d01ec08965a896ca0029"
diff --git a/contracts/ens/contract/ens.go b/contracts/ens/contract/ens.go
index acb6a4e4ce..cbf6cb05b3 100644
--- a/contracts/ens/contract/ens.go
+++ b/contracts/ens/contract/ens.go
@@ -6,17 +6,19 @@ package contract
import (
"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"
)
// ENSABI is the input ABI used to generate the binding from.
const ENSABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"resolver\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"label\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setSubnodeOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"setTTL\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"ttl\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"label\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"NewResolver\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"NewTTL\",\"type\":\"event\"}]"
// ENSBin is the compiled bytecode used for deploying new contracts.
-const ENSBin = `0x6060604052341561000f57600080fd5b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a033316600160a060020a0319909116179055610503806100626000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100b957806306ab5923146100cf57806314ab9038146100f657806316a25cbd146101195780631896f70a1461014c5780635b0fc9c31461016e575b600080fd5b341561009257600080fd5b61009d600435610190565b604051600160a060020a03909116815260200160405180910390f35b34156100c457600080fd5b61009d6004356101ae565b34156100da57600080fd5b6100f4600435602435600160a060020a03604435166101c9565b005b341561010157600080fd5b6100f460043567ffffffffffffffff6024351661028b565b341561012457600080fd5b61012f600435610357565b60405167ffffffffffffffff909116815260200160405180910390f35b341561015757600080fd5b6100f4600435600160a060020a036024351661038e565b341561017957600080fd5b6100f4600435600160a060020a0360243516610434565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b600083815260208190526040812054849033600160a060020a039081169116146101f257600080fd5b8484604051918252602082015260409081019051908190039020915083857fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e8285604051600160a060020a03909116815260200160405180910390a3506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040902054829033600160a060020a039081169116146102b457600080fd5b827f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa688360405167ffffffffffffffff909116815260200160405180910390a250600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040902054829033600160a060020a039081169116146103b757600080fd5b827f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a083604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600082815260208190526040902054829033600160a060020a0390811691161461045d57600080fd5b827fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d26683604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a7230582087c335a130f7bd19015451f7e1dc0e44cdeb5b64393f51a105ee00160711fcff0029`
+const ENSBin = `0x6060604052341561000f57600080fd5b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a033316600160a060020a0319909116179055610503806100626000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100b957806306ab5923146100cf57806314ab9038146100f657806316a25cbd146101195780631896f70a1461014c5780635b0fc9c31461016e575b600080fd5b341561009257600080fd5b61009d600435610190565b604051600160a060020a03909116815260200160405180910390f35b34156100c457600080fd5b61009d6004356101ae565b34156100da57600080fd5b6100f4600435602435600160a060020a03604435166101c9565b005b341561010157600080fd5b6100f460043567ffffffffffffffff6024351661028b565b341561012457600080fd5b61012f600435610357565b60405167ffffffffffffffff909116815260200160405180910390f35b341561015757600080fd5b6100f4600435600160a060020a036024351661038e565b341561017957600080fd5b6100f4600435600160a060020a0360243516610434565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b600083815260208190526040812054849033600160a060020a039081169116146101f257600080fd5b8484604051918252602082015260409081019051908190039020915083857fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e8285604051600160a060020a03909116815260200160405180910390a3506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040902054829033600160a060020a039081169116146102b457600080fd5b827f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa688360405167ffffffffffffffff909116815260200160405180910390a250600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040902054829033600160a060020a039081169116146103b757600080fd5b827f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a083604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600082815260208190526040902054829033600160a060020a0390811691161461045d57600080fd5b827fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d26683604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820f4c798d4c84c9912f389f64631e85e8d16c3e6644f8c2e1579936015c7d5f6660029`
// DeployENS deploys a new Ethereum contract, binding an instance of ENS to it.
func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ENS, error) {
@@ -28,13 +30,14 @@ func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Ad
if err != nil {
return common.Address{}, nil, nil, err
}
- return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}}, nil
+ return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
}
// ENS is an auto generated Go binding around an Ethereum contract.
type ENS struct {
ENSCaller // Read-only binding to the contract
ENSTransactor // Write-only binding to the contract
+ ENSFilterer // Log filterer for contract events
}
// ENSCaller is an auto generated read-only Go binding around an Ethereum contract.
@@ -47,6 +50,11 @@ type ENSTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
+// ENSFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
+type ENSFilterer struct {
+ contract *bind.BoundContract // Generic contract wrapper for the low level calls
+}
+
// ENSSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type ENSSession struct {
@@ -86,16 +94,16 @@ type ENSTransactorRaw struct {
// NewENS creates a new instance of ENS, bound to a specific deployed contract.
func NewENS(address common.Address, backend bind.ContractBackend) (*ENS, error) {
- contract, err := bindENS(address, backend, backend)
+ contract, err := bindENS(address, backend, backend, backend)
if err != nil {
return nil, err
}
- return &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}}, nil
+ return &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}, ENSFilterer: ENSFilterer{contract: contract}}, nil
}
// NewENSCaller creates a new read-only instance of ENS, bound to a specific deployed contract.
func NewENSCaller(address common.Address, caller bind.ContractCaller) (*ENSCaller, error) {
- contract, err := bindENS(address, caller, nil)
+ contract, err := bindENS(address, caller, nil, nil)
if err != nil {
return nil, err
}
@@ -104,20 +112,29 @@ func NewENSCaller(address common.Address, caller bind.ContractCaller) (*ENSCalle
// NewENSTransactor creates a new write-only instance of ENS, bound to a specific deployed contract.
func NewENSTransactor(address common.Address, transactor bind.ContractTransactor) (*ENSTransactor, error) {
- contract, err := bindENS(address, nil, transactor)
+ contract, err := bindENS(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &ENSTransactor{contract: contract}, nil
}
+// NewENSFilterer creates a new log filterer instance of ENS, bound to a specific deployed contract.
+func NewENSFilterer(address common.Address, filterer bind.ContractFilterer) (*ENSFilterer, error) {
+ contract, err := bindENS(address, nil, nil, filterer)
+ if err != nil {
+ return nil, err
+ }
+ return &ENSFilterer{contract: contract}, nil
+}
+
// bindENS binds a generic wrapper to an already deployed contract.
-func bindENS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
+func bindENS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(ENSABI))
if err != nil {
return nil, err
}
- return bind.NewBoundContract(address, parsed, caller, transactor), nil
+ return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
@@ -319,3 +336,544 @@ func (_ENS *ENSSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, e
func (_ENS *ENSTransactorSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, error) {
return _ENS.Contract.SetTTL(&_ENS.TransactOpts, node, ttl)
}
+
+// ENSNewOwnerIterator is returned from FilterNewOwner and is used to iterate over the raw logs and unpacked data for NewOwner events raised by the ENS contract.
+type ENSNewOwnerIterator struct {
+ Event *ENSNewOwner // 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 *ENSNewOwnerIterator) 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(ENSNewOwner)
+ 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(ENSNewOwner)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *ENSNewOwnerIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *ENSNewOwnerIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// ENSNewOwner represents a NewOwner event raised by the ENS contract.
+type ENSNewOwner struct {
+ Node [32]byte
+ Label [32]byte
+ Owner common.Address
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterNewOwner is a free log retrieval operation binding the contract event 0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82.
+//
+// Solidity: event NewOwner(node indexed bytes32, label indexed bytes32, owner address)
+func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSNewOwnerIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var labelRule []interface{}
+ for _, labelItem := range label {
+ labelRule = append(labelRule, labelItem)
+ }
+
+ logs, sub, err := _ENS.contract.FilterLogs(opts, "NewOwner", nodeRule, labelRule)
+ if err != nil {
+ return nil, err
+ }
+ return &ENSNewOwnerIterator{contract: _ENS.contract, event: "NewOwner", logs: logs, sub: sub}, nil
+}
+
+// WatchNewOwner is a free log subscription operation binding the contract event 0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82.
+//
+// Solidity: event NewOwner(node indexed bytes32, label indexed bytes32, owner address)
+func (_ENS *ENSFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var labelRule []interface{}
+ for _, labelItem := range label {
+ labelRule = append(labelRule, labelItem)
+ }
+
+ logs, sub, err := _ENS.contract.WatchLogs(opts, "NewOwner", nodeRule, labelRule)
+ 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(ENSNewOwner)
+ if err := _ENS.contract.UnpackLog(event, "NewOwner", 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
+}
+
+// ENSNewResolverIterator is returned from FilterNewResolver and is used to iterate over the raw logs and unpacked data for NewResolver events raised by the ENS contract.
+type ENSNewResolverIterator struct {
+ Event *ENSNewResolver // 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 *ENSNewResolverIterator) 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(ENSNewResolver)
+ 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(ENSNewResolver)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *ENSNewResolverIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *ENSNewResolverIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// ENSNewResolver represents a NewResolver event raised by the ENS contract.
+type ENSNewResolver struct {
+ Node [32]byte
+ Resolver common.Address
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterNewResolver is a free log retrieval operation binding the contract event 0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0.
+//
+// Solidity: event NewResolver(node indexed bytes32, resolver address)
+func (_ENS *ENSFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSNewResolverIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.FilterLogs(opts, "NewResolver", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &ENSNewResolverIterator{contract: _ENS.contract, event: "NewResolver", logs: logs, sub: sub}, nil
+}
+
+// WatchNewResolver is a free log subscription operation binding the contract event 0x335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0.
+//
+// Solidity: event NewResolver(node indexed bytes32, resolver address)
+func (_ENS *ENSFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSNewResolver, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.WatchLogs(opts, "NewResolver", nodeRule)
+ 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(ENSNewResolver)
+ if err := _ENS.contract.UnpackLog(event, "NewResolver", 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
+}
+
+// ENSNewTTLIterator is returned from FilterNewTTL and is used to iterate over the raw logs and unpacked data for NewTTL events raised by the ENS contract.
+type ENSNewTTLIterator struct {
+ Event *ENSNewTTL // 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 *ENSNewTTLIterator) 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(ENSNewTTL)
+ 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(ENSNewTTL)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *ENSNewTTLIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *ENSNewTTLIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// ENSNewTTL represents a NewTTL event raised by the ENS contract.
+type ENSNewTTL struct {
+ Node [32]byte
+ Ttl uint64
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterNewTTL is a free log retrieval operation binding the contract event 0x1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68.
+//
+// Solidity: event NewTTL(node indexed bytes32, ttl uint64)
+func (_ENS *ENSFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSNewTTLIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.FilterLogs(opts, "NewTTL", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &ENSNewTTLIterator{contract: _ENS.contract, event: "NewTTL", logs: logs, sub: sub}, nil
+}
+
+// WatchNewTTL is a free log subscription operation binding the contract event 0x1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68.
+//
+// Solidity: event NewTTL(node indexed bytes32, ttl uint64)
+func (_ENS *ENSFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSNewTTL, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.WatchLogs(opts, "NewTTL", nodeRule)
+ 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(ENSNewTTL)
+ if err := _ENS.contract.UnpackLog(event, "NewTTL", 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
+}
+
+// ENSTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ENS contract.
+type ENSTransferIterator struct {
+ Event *ENSTransfer // 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 *ENSTransferIterator) 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(ENSTransfer)
+ 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(ENSTransfer)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *ENSTransferIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *ENSTransferIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// ENSTransfer represents a Transfer event raised by the ENS contract.
+type ENSTransfer struct {
+ Node [32]byte
+ Owner common.Address
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterTransfer is a free log retrieval operation binding the contract event 0xd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266.
+//
+// Solidity: event Transfer(node indexed bytes32, owner address)
+func (_ENS *ENSFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSTransferIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.FilterLogs(opts, "Transfer", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &ENSTransferIterator{contract: _ENS.contract, event: "Transfer", logs: logs, sub: sub}, nil
+}
+
+// WatchTransfer is a free log subscription operation binding the contract event 0xd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266.
+//
+// Solidity: event Transfer(node indexed bytes32, owner address)
+func (_ENS *ENSFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSTransfer, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _ENS.contract.WatchLogs(opts, "Transfer", nodeRule)
+ 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(ENSTransfer)
+ if err := _ENS.contract.UnpackLog(event, "Transfer", 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/contracts/ens/contract/fifsregistrar.go b/contracts/ens/contract/fifsregistrar.go
index fdc9b9c1bd..a08380adfc 100644
--- a/contracts/ens/contract/fifsregistrar.go
+++ b/contracts/ens/contract/fifsregistrar.go
@@ -16,7 +16,7 @@ import (
const FIFSRegistrarABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"subnode\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"register\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"ensAddr\",\"type\":\"address\"},{\"name\":\"node\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]"
// FIFSRegistrarBin is the compiled bytecode used for deploying new contracts.
-const FIFSRegistrarBin = `0x6060604052341561000f57600080fd5b604051604080610224833981016040528080519190602001805160008054600160a060020a03909516600160a060020a03199095169490941790935550506001556101c58061005f6000396000f3006060604052600436106100275763ffffffff60e060020a600035041663d22057a9811461002c575b600080fd5b341561003757600080fd5b61004e600435600160a060020a0360243516610050565b005b816000806001548360405191825260208201526040908101905190819003902060008054919350600160a060020a03909116906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156100c857600080fd5b6102c65a03f115156100d957600080fd5b5050506040518051915050600160a060020a0381161580159061010e575033600160a060020a031681600160a060020a031614155b1561011857600080fd5b600054600154600160a060020a03909116906306ab592390878760405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561017e57600080fd5b6102c65a03f1151561018f57600080fd5b50505050505050505600a165627a7a723058209b0c0f4ed76e4fe49a71d4b838ab3d00d6bad29021172db7ced9f36abcafbf510029`
+const FIFSRegistrarBin = `0x6060604052341561000f57600080fd5b604051604080610224833981016040528080519190602001805160008054600160a060020a03909516600160a060020a03199095169490941790935550506001556101c58061005f6000396000f3006060604052600436106100275763ffffffff60e060020a600035041663d22057a9811461002c575b600080fd5b341561003757600080fd5b61004e600435600160a060020a0360243516610050565b005b816000806001548360405191825260208201526040908101905190819003902060008054919350600160a060020a03909116906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156100c857600080fd5b6102c65a03f115156100d957600080fd5b5050506040518051915050600160a060020a0381161580159061010e575033600160a060020a031681600160a060020a031614155b1561011857600080fd5b600054600154600160a060020a03909116906306ab592390878760405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561017e57600080fd5b6102c65a03f1151561018f57600080fd5b50505050505050505600a165627a7a723058206fb963cb168d5e3a51af12cd6bb23e324dbd32dd4954f43653ba27e66b68ea650029`
// DeployFIFSRegistrar deploys a new Ethereum contract, binding an instance of FIFSRegistrar to it.
func DeployFIFSRegistrar(auth *bind.TransactOpts, backend bind.ContractBackend, ensAddr common.Address, node [32]byte) (common.Address, *types.Transaction, *FIFSRegistrar, error) {
@@ -28,13 +28,14 @@ func DeployFIFSRegistrar(auth *bind.TransactOpts, backend bind.ContractBackend,
if err != nil {
return common.Address{}, nil, nil, err
}
- return address, tx, &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}}, nil
+ return address, tx, &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}, FIFSRegistrarFilterer: FIFSRegistrarFilterer{contract: contract}}, nil
}
// FIFSRegistrar is an auto generated Go binding around an Ethereum contract.
type FIFSRegistrar struct {
FIFSRegistrarCaller // Read-only binding to the contract
FIFSRegistrarTransactor // Write-only binding to the contract
+ FIFSRegistrarFilterer // Log filterer for contract events
}
// FIFSRegistrarCaller is an auto generated read-only Go binding around an Ethereum contract.
@@ -47,6 +48,11 @@ type FIFSRegistrarTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
+// FIFSRegistrarFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
+type FIFSRegistrarFilterer struct {
+ contract *bind.BoundContract // Generic contract wrapper for the low level calls
+}
+
// FIFSRegistrarSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type FIFSRegistrarSession struct {
@@ -86,16 +92,16 @@ type FIFSRegistrarTransactorRaw struct {
// NewFIFSRegistrar creates a new instance of FIFSRegistrar, bound to a specific deployed contract.
func NewFIFSRegistrar(address common.Address, backend bind.ContractBackend) (*FIFSRegistrar, error) {
- contract, err := bindFIFSRegistrar(address, backend, backend)
+ contract, err := bindFIFSRegistrar(address, backend, backend, backend)
if err != nil {
return nil, err
}
- return &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}}, nil
+ return &FIFSRegistrar{FIFSRegistrarCaller: FIFSRegistrarCaller{contract: contract}, FIFSRegistrarTransactor: FIFSRegistrarTransactor{contract: contract}, FIFSRegistrarFilterer: FIFSRegistrarFilterer{contract: contract}}, nil
}
// NewFIFSRegistrarCaller creates a new read-only instance of FIFSRegistrar, bound to a specific deployed contract.
func NewFIFSRegistrarCaller(address common.Address, caller bind.ContractCaller) (*FIFSRegistrarCaller, error) {
- contract, err := bindFIFSRegistrar(address, caller, nil)
+ contract, err := bindFIFSRegistrar(address, caller, nil, nil)
if err != nil {
return nil, err
}
@@ -104,20 +110,29 @@ func NewFIFSRegistrarCaller(address common.Address, caller bind.ContractCaller)
// NewFIFSRegistrarTransactor creates a new write-only instance of FIFSRegistrar, bound to a specific deployed contract.
func NewFIFSRegistrarTransactor(address common.Address, transactor bind.ContractTransactor) (*FIFSRegistrarTransactor, error) {
- contract, err := bindFIFSRegistrar(address, nil, transactor)
+ contract, err := bindFIFSRegistrar(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &FIFSRegistrarTransactor{contract: contract}, nil
}
+// NewFIFSRegistrarFilterer creates a new log filterer instance of FIFSRegistrar, bound to a specific deployed contract.
+func NewFIFSRegistrarFilterer(address common.Address, filterer bind.ContractFilterer) (*FIFSRegistrarFilterer, error) {
+ contract, err := bindFIFSRegistrar(address, nil, nil, filterer)
+ if err != nil {
+ return nil, err
+ }
+ return &FIFSRegistrarFilterer{contract: contract}, nil
+}
+
// bindFIFSRegistrar binds a generic wrapper to an already deployed contract.
-func bindFIFSRegistrar(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
+func bindFIFSRegistrar(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(FIFSRegistrarABI))
if err != nil {
return nil, err
}
- return bind.NewBoundContract(address, parsed, caller, transactor), nil
+ return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
diff --git a/contracts/ens/contract/publicresolver.go b/contracts/ens/contract/publicresolver.go
index 72e5c55823..c567d5884a 100644
--- a/contracts/ens/contract/publicresolver.go
+++ b/contracts/ens/contract/publicresolver.go
@@ -7,17 +7,19 @@ 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"
)
// PublicResolverABI is the input ABI used to generate the binding from.
const PublicResolverABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"interfaceID\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}],\"name\":\"setText\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"contentTypes\",\"type\":\"uint256\"}],\"name\":\"ABI\",\"outputs\":[{\"name\":\"contentType\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"x\",\"type\":\"bytes32\"},{\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"setPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"content\",\"outputs\":[{\"name\":\"ret\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"addr\",\"outputs\":[{\"name\":\"ret\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"key\",\"type\":\"string\"}],\"name\":\"text\",\"outputs\":[{\"name\":\"ret\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"contentType\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"setABI\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"name\",\"outputs\":[{\"name\":\"ret\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"setContent\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"pubkey\",\"outputs\":[{\"name\":\"x\",\"type\":\"bytes32\"},{\"name\":\"y\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAddr\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"ensAddr\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"a\",\"type\":\"address\"}],\"name\":\"AddrChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"ContentChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"}],\"name\":\"NameChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"contentType\",\"type\":\"uint256\"}],\"name\":\"ABIChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"x\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"y\",\"type\":\"bytes32\"}],\"name\":\"PubkeyChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"indexedKey\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"key\",\"type\":\"string\"}],\"name\":\"TextChanged\",\"type\":\"event\"}]"
// PublicResolverBin is the compiled bytecode used for deploying new contracts.
-const PublicResolverBin = `0x6060604052341561000f57600080fd5b6040516020806111b28339810160405280805160008054600160a060020a03909216600160a060020a0319909216919091179055505061115e806100546000396000f3006060604052600436106100ab5763ffffffff60e060020a60003504166301ffc9a781146100b057806310f13a8c146100e45780632203ab561461017e57806329cd62ea146102155780632dff6941146102315780633b3b57de1461025957806359d1d43c1461028b578063623195b014610358578063691f3431146103b457806377372213146103ca578063c3d014d614610420578063c869023314610439578063d5fa2b0014610467575b600080fd5b34156100bb57600080fd5b6100d0600160e060020a031960043516610489565b604051901515815260200160405180910390f35b34156100ef57600080fd5b61017c600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506105f695505050505050565b005b341561018957600080fd5b610197600435602435610807565b60405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156101d95780820151838201526020016101c1565b50505050905090810190601f1680156102065780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b341561022057600080fd5b61017c600435602435604435610931565b341561023c57600080fd5b610247600435610a30565b60405190815260200160405180910390f35b341561026457600080fd5b61026f600435610a46565b604051600160a060020a03909116815260200160405180910390f35b341561029657600080fd5b6102e1600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a6195505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561031d578082015183820152602001610305565b50505050905090810190601f16801561034a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036357600080fd5b61017c600480359060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b8095505050505050565b34156103bf57600080fd5b6102e1600435610c7c565b34156103d557600080fd5b61017c600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d4295505050505050565b341561042b57600080fd5b61017c600435602435610e8c565b341561044457600080fd5b61044f600435610f65565b60405191825260208201526040908101905180910390f35b341561047257600080fd5b61017c600435600160a060020a0360243516610f82565b6000600160e060020a031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806104ec5750600160e060020a031982167fd8389dc500000000000000000000000000000000000000000000000000000000145b806105205750600160e060020a031982167f691f343100000000000000000000000000000000000000000000000000000000145b806105545750600160e060020a031982167f2203ab5600000000000000000000000000000000000000000000000000000000145b806105885750600160e060020a031982167fc869023300000000000000000000000000000000000000000000000000000000145b806105bc5750600160e060020a031982167f59d1d43c00000000000000000000000000000000000000000000000000000000145b806105f05750600160e060020a031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561064f57600080fd5b6102c65a03f1151561066057600080fd5b50505060405180519050600160a060020a031614151561067f57600080fd5b6000848152600160205260409081902083916005909101908590518082805190602001908083835b602083106106c65780518252601f1990920191602091820191016106a7565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090805161070a929160200190611085565b50826040518082805190602001908083835b6020831061073b5780518252601f19909201916020918201910161071c565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020847fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508560405160208082528190810183818151815260200191508051906020019080838360005b838110156107c75780820151838201526020016107af565b50505050905090810190601f1680156107f45780820380516001836020036101000a031916815260200191505b509250505060405180910390a350505050565b6000610811611103565b60008481526001602081905260409091209092505b838311610924578284161580159061085f5750600083815260068201602052604081205460026000196101006001841615020190911604115b15610919578060060160008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090d5780601f106108e25761010080835404028352916020019161090d565b820191906000526020600020905b8154815290600101906020018083116108f057829003601f168201915b50505050509150610929565b600290920291610826565b600092505b509250929050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561098a57600080fd5b6102c65a03f1151561099b57600080fd5b50505060405180519050600160a060020a03161415156109ba57600080fd5b6040805190810160409081528482526020808301859052600087815260019091522060030181518155602082015160019091015550837f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46848460405191825260208201526040908101905180910390a250505050565b6000908152600160208190526040909120015490565b600090815260016020526040902054600160a060020a031690565b610a69611103565b60008381526001602052604090819020600501908390518082805190602001908083835b60208310610aac5780518252601f199092019160209182019101610a8d565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b735780601f10610b4857610100808354040283529160200191610b73565b820191906000526020600020905b815481529060010190602001808311610b5657829003601f168201915b5050505050905092915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bd957600080fd5b6102c65a03f11515610bea57600080fd5b50505060405180519050600160a060020a0316141515610c0957600080fd5b6000198301831615610c1a57600080fd5b60008481526001602090815260408083208684526006019091529020828051610c47929160200190611085565b5082847faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe360405160405180910390a350505050565b610c84611103565b6001600083600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d365780601f10610d0b57610100808354040283529160200191610d36565b820191906000526020600020905b815481529060010190602001808311610d1957829003601f168201915b50505050509050919050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d9b57600080fd5b6102c65a03f11515610dac57600080fd5b50505060405180519050600160a060020a0316141515610dcb57600080fd5b6000838152600160205260409020600201828051610ded929160200190611085565b50827fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78360405160208082528190810183818151815260200191508051906020019080838360005b83811015610e4d578082015183820152602001610e35565b50505050905090810190601f168015610e7a5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ee557600080fd5b6102c65a03f11515610ef657600080fd5b50505060405180519050600160a060020a0316141515610f1557600080fd5b6000838152600160208190526040918290200183905583907f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc9084905190815260200160405180910390a2505050565b600090815260016020526040902060038101546004909101549091565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610fdb57600080fd5b6102c65a03f11515610fec57600080fd5b50505060405180519050600160a060020a031614151561100b57600080fd5b60008381526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851617905583907f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd290849051600160a060020a03909116815260200160405180910390a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106110c657805160ff19168380011785556110f3565b828001600101855582156110f3579182015b828111156110f35782518255916020019190600101906110d8565b506110ff929150611115565b5090565b60206040519081016040526000815290565b61112f91905b808211156110ff576000815560010161111b565b905600a165627a7a72305820691c9aa3f737ab0ca25e23bc35cc10d4b93067d8a1fc5c9266b66365e32ed85a0029`
+const PublicResolverBin = `0x6060604052341561000f57600080fd5b6040516020806111b28339810160405280805160008054600160a060020a03909216600160a060020a0319909216919091179055505061115e806100546000396000f3006060604052600436106100ab5763ffffffff60e060020a60003504166301ffc9a781146100b057806310f13a8c146100e45780632203ab561461017e57806329cd62ea146102155780632dff6941146102315780633b3b57de1461025957806359d1d43c1461028b578063623195b014610358578063691f3431146103b457806377372213146103ca578063c3d014d614610420578063c869023314610439578063d5fa2b0014610467575b600080fd5b34156100bb57600080fd5b6100d0600160e060020a031960043516610489565b604051901515815260200160405180910390f35b34156100ef57600080fd5b61017c600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506105f695505050505050565b005b341561018957600080fd5b610197600435602435610807565b60405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156101d95780820151838201526020016101c1565b50505050905090810190601f1680156102065780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b341561022057600080fd5b61017c600435602435604435610931565b341561023c57600080fd5b610247600435610a30565b60405190815260200160405180910390f35b341561026457600080fd5b61026f600435610a46565b604051600160a060020a03909116815260200160405180910390f35b341561029657600080fd5b6102e1600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a6195505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561031d578082015183820152602001610305565b50505050905090810190601f16801561034a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036357600080fd5b61017c600480359060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b8095505050505050565b34156103bf57600080fd5b6102e1600435610c7c565b34156103d557600080fd5b61017c600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d4295505050505050565b341561042b57600080fd5b61017c600435602435610e8c565b341561044457600080fd5b61044f600435610f65565b60405191825260208201526040908101905180910390f35b341561047257600080fd5b61017c600435600160a060020a0360243516610f82565b6000600160e060020a031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806104ec5750600160e060020a031982167fd8389dc500000000000000000000000000000000000000000000000000000000145b806105205750600160e060020a031982167f691f343100000000000000000000000000000000000000000000000000000000145b806105545750600160e060020a031982167f2203ab5600000000000000000000000000000000000000000000000000000000145b806105885750600160e060020a031982167fc869023300000000000000000000000000000000000000000000000000000000145b806105bc5750600160e060020a031982167f59d1d43c00000000000000000000000000000000000000000000000000000000145b806105f05750600160e060020a031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561064f57600080fd5b6102c65a03f1151561066057600080fd5b50505060405180519050600160a060020a031614151561067f57600080fd5b6000848152600160205260409081902083916005909101908590518082805190602001908083835b602083106106c65780518252601f1990920191602091820191016106a7565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090805161070a929160200190611085565b50826040518082805190602001908083835b6020831061073b5780518252601f19909201916020918201910161071c565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020847fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508560405160208082528190810183818151815260200191508051906020019080838360005b838110156107c75780820151838201526020016107af565b50505050905090810190601f1680156107f45780820380516001836020036101000a031916815260200191505b509250505060405180910390a350505050565b6000610811611103565b60008481526001602081905260409091209092505b838311610924578284161580159061085f5750600083815260068201602052604081205460026000196101006001841615020190911604115b15610919578060060160008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090d5780601f106108e25761010080835404028352916020019161090d565b820191906000526020600020905b8154815290600101906020018083116108f057829003601f168201915b50505050509150610929565b600290920291610826565b600092505b509250929050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561098a57600080fd5b6102c65a03f1151561099b57600080fd5b50505060405180519050600160a060020a03161415156109ba57600080fd5b6040805190810160409081528482526020808301859052600087815260019091522060030181518155602082015160019091015550837f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46848460405191825260208201526040908101905180910390a250505050565b6000908152600160208190526040909120015490565b600090815260016020526040902054600160a060020a031690565b610a69611103565b60008381526001602052604090819020600501908390518082805190602001908083835b60208310610aac5780518252601f199092019160209182019101610a8d565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b735780601f10610b4857610100808354040283529160200191610b73565b820191906000526020600020905b815481529060010190602001808311610b5657829003601f168201915b5050505050905092915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bd957600080fd5b6102c65a03f11515610bea57600080fd5b50505060405180519050600160a060020a0316141515610c0957600080fd5b6000198301831615610c1a57600080fd5b60008481526001602090815260408083208684526006019091529020828051610c47929160200190611085565b5082847faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe360405160405180910390a350505050565b610c84611103565b6001600083600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d365780601f10610d0b57610100808354040283529160200191610d36565b820191906000526020600020905b815481529060010190602001808311610d1957829003601f168201915b50505050509050919050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d9b57600080fd5b6102c65a03f11515610dac57600080fd5b50505060405180519050600160a060020a0316141515610dcb57600080fd5b6000838152600160205260409020600201828051610ded929160200190611085565b50827fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78360405160208082528190810183818151815260200191508051906020019080838360005b83811015610e4d578082015183820152602001610e35565b50505050905090810190601f168015610e7a5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ee557600080fd5b6102c65a03f11515610ef657600080fd5b50505060405180519050600160a060020a0316141515610f1557600080fd5b6000838152600160208190526040918290200183905583907f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc9084905190815260200160405180910390a2505050565b600090815260016020526040902060038101546004909101549091565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610fdb57600080fd5b6102c65a03f11515610fec57600080fd5b50505060405180519050600160a060020a031614151561100b57600080fd5b60008381526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851617905583907f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd290849051600160a060020a03909116815260200160405180910390a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106110c657805160ff19168380011785556110f3565b828001600101855582156110f3579182015b828111156110f35782518255916020019190600101906110d8565b506110ff929150611115565b5090565b60206040519081016040526000815290565b61112f91905b808211156110ff576000815560010161111b565b905600a165627a7a723058201ecacbc445b9fbcd91b0ab164389f69d7283b856883bc7437eeed1008345a4920029`
// DeployPublicResolver deploys a new Ethereum contract, binding an instance of PublicResolver to it.
func DeployPublicResolver(auth *bind.TransactOpts, backend bind.ContractBackend, ensAddr common.Address) (common.Address, *types.Transaction, *PublicResolver, error) {
@@ -29,13 +31,14 @@ func DeployPublicResolver(auth *bind.TransactOpts, backend bind.ContractBackend,
if err != nil {
return common.Address{}, nil, nil, err
}
- return address, tx, &PublicResolver{PublicResolverCaller: PublicResolverCaller{contract: contract}, PublicResolverTransactor: PublicResolverTransactor{contract: contract}}, nil
+ return address, tx, &PublicResolver{PublicResolverCaller: PublicResolverCaller{contract: contract}, PublicResolverTransactor: PublicResolverTransactor{contract: contract}, PublicResolverFilterer: PublicResolverFilterer{contract: contract}}, nil
}
// PublicResolver is an auto generated Go binding around an Ethereum contract.
type PublicResolver struct {
PublicResolverCaller // Read-only binding to the contract
PublicResolverTransactor // Write-only binding to the contract
+ PublicResolverFilterer // Log filterer for contract events
}
// PublicResolverCaller is an auto generated read-only Go binding around an Ethereum contract.
@@ -48,6 +51,11 @@ type PublicResolverTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
+// PublicResolverFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
+type PublicResolverFilterer struct {
+ contract *bind.BoundContract // Generic contract wrapper for the low level calls
+}
+
// PublicResolverSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type PublicResolverSession struct {
@@ -87,16 +95,16 @@ type PublicResolverTransactorRaw struct {
// NewPublicResolver creates a new instance of PublicResolver, bound to a specific deployed contract.
func NewPublicResolver(address common.Address, backend bind.ContractBackend) (*PublicResolver, error) {
- contract, err := bindPublicResolver(address, backend, backend)
+ contract, err := bindPublicResolver(address, backend, backend, backend)
if err != nil {
return nil, err
}
- return &PublicResolver{PublicResolverCaller: PublicResolverCaller{contract: contract}, PublicResolverTransactor: PublicResolverTransactor{contract: contract}}, nil
+ return &PublicResolver{PublicResolverCaller: PublicResolverCaller{contract: contract}, PublicResolverTransactor: PublicResolverTransactor{contract: contract}, PublicResolverFilterer: PublicResolverFilterer{contract: contract}}, nil
}
// NewPublicResolverCaller creates a new read-only instance of PublicResolver, bound to a specific deployed contract.
func NewPublicResolverCaller(address common.Address, caller bind.ContractCaller) (*PublicResolverCaller, error) {
- contract, err := bindPublicResolver(address, caller, nil)
+ contract, err := bindPublicResolver(address, caller, nil, nil)
if err != nil {
return nil, err
}
@@ -105,20 +113,29 @@ func NewPublicResolverCaller(address common.Address, caller bind.ContractCaller)
// NewPublicResolverTransactor creates a new write-only instance of PublicResolver, bound to a specific deployed contract.
func NewPublicResolverTransactor(address common.Address, transactor bind.ContractTransactor) (*PublicResolverTransactor, error) {
- contract, err := bindPublicResolver(address, nil, transactor)
+ contract, err := bindPublicResolver(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &PublicResolverTransactor{contract: contract}, nil
}
+// NewPublicResolverFilterer creates a new log filterer instance of PublicResolver, bound to a specific deployed contract.
+func NewPublicResolverFilterer(address common.Address, filterer bind.ContractFilterer) (*PublicResolverFilterer, error) {
+ contract, err := bindPublicResolver(address, nil, nil, filterer)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverFilterer{contract: contract}, nil
+}
+
// bindPublicResolver binds a generic wrapper to an already deployed contract.
-func bindPublicResolver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
+func bindPublicResolver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(PublicResolverABI))
if err != nil {
return nil, err
}
- return bind.NewBoundContract(address, parsed, caller, transactor), nil
+ return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}
// Call invokes the (constant) contract method with params as input values and
@@ -486,3 +503,819 @@ func (_PublicResolver *PublicResolverSession) SetText(node [32]byte, key string,
func (_PublicResolver *PublicResolverTransactorSession) SetText(node [32]byte, key string, value string) (*types.Transaction, error) {
return _PublicResolver.Contract.SetText(&_PublicResolver.TransactOpts, node, key, value)
}
+
+// PublicResolverABIChangedIterator is returned from FilterABIChanged and is used to iterate over the raw logs and unpacked data for ABIChanged events raised by the PublicResolver contract.
+type PublicResolverABIChangedIterator struct {
+ Event *PublicResolverABIChanged // 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 *PublicResolverABIChangedIterator) 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(PublicResolverABIChanged)
+ 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(PublicResolverABIChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverABIChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverABIChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverABIChanged represents a ABIChanged event raised by the PublicResolver contract.
+type PublicResolverABIChanged struct {
+ Node [32]byte
+ ContentType *big.Int
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterABIChanged is a free log retrieval operation binding the contract event 0xaa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe3.
+//
+// Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256)
+func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.FilterOpts, node [][32]byte, contentType []*big.Int) (*PublicResolverABIChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var contentTypeRule []interface{}
+ for _, contentTypeItem := range contentType {
+ contentTypeRule = append(contentTypeRule, contentTypeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "ABIChanged", nodeRule, contentTypeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverABIChangedIterator{contract: _PublicResolver.contract, event: "ABIChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchABIChanged is a free log subscription operation binding the contract event 0xaa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe3.
+//
+// Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256)
+func (_PublicResolver *PublicResolverFilterer) WatchABIChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverABIChanged, node [][32]byte, contentType []*big.Int) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var contentTypeRule []interface{}
+ for _, contentTypeItem := range contentType {
+ contentTypeRule = append(contentTypeRule, contentTypeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "ABIChanged", nodeRule, contentTypeRule)
+ 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(PublicResolverABIChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "ABIChanged", 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
+}
+
+// PublicResolverAddrChangedIterator is returned from FilterAddrChanged and is used to iterate over the raw logs and unpacked data for AddrChanged events raised by the PublicResolver contract.
+type PublicResolverAddrChangedIterator struct {
+ Event *PublicResolverAddrChanged // 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 *PublicResolverAddrChangedIterator) 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(PublicResolverAddrChanged)
+ 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(PublicResolverAddrChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverAddrChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverAddrChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverAddrChanged represents a AddrChanged event raised by the PublicResolver contract.
+type PublicResolverAddrChanged struct {
+ Node [32]byte
+ A common.Address
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterAddrChanged is a free log retrieval operation binding the contract event 0x52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2.
+//
+// Solidity: event AddrChanged(node indexed bytes32, a address)
+func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverAddrChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "AddrChanged", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverAddrChangedIterator{contract: _PublicResolver.contract, event: "AddrChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchAddrChanged is a free log subscription operation binding the contract event 0x52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd2.
+//
+// Solidity: event AddrChanged(node indexed bytes32, a address)
+func (_PublicResolver *PublicResolverFilterer) WatchAddrChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverAddrChanged, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "AddrChanged", nodeRule)
+ 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(PublicResolverAddrChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "AddrChanged", 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
+}
+
+// PublicResolverContentChangedIterator is returned from FilterContentChanged and is used to iterate over the raw logs and unpacked data for ContentChanged events raised by the PublicResolver contract.
+type PublicResolverContentChangedIterator struct {
+ Event *PublicResolverContentChanged // 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 *PublicResolverContentChangedIterator) 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(PublicResolverContentChanged)
+ 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(PublicResolverContentChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverContentChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverContentChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverContentChanged represents a ContentChanged event raised by the PublicResolver contract.
+type PublicResolverContentChanged struct {
+ Node [32]byte
+ Hash [32]byte
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterContentChanged is a free log retrieval operation binding the contract event 0x0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc.
+//
+// Solidity: event ContentChanged(node indexed bytes32, hash bytes32)
+func (_PublicResolver *PublicResolverFilterer) FilterContentChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverContentChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "ContentChanged", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverContentChangedIterator{contract: _PublicResolver.contract, event: "ContentChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchContentChanged is a free log subscription operation binding the contract event 0x0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc.
+//
+// Solidity: event ContentChanged(node indexed bytes32, hash bytes32)
+func (_PublicResolver *PublicResolverFilterer) WatchContentChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverContentChanged, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "ContentChanged", nodeRule)
+ 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(PublicResolverContentChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "ContentChanged", 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
+}
+
+// PublicResolverNameChangedIterator is returned from FilterNameChanged and is used to iterate over the raw logs and unpacked data for NameChanged events raised by the PublicResolver contract.
+type PublicResolverNameChangedIterator struct {
+ Event *PublicResolverNameChanged // 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 *PublicResolverNameChangedIterator) 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(PublicResolverNameChanged)
+ 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(PublicResolverNameChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverNameChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverNameChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverNameChanged represents a NameChanged event raised by the PublicResolver contract.
+type PublicResolverNameChanged struct {
+ Node [32]byte
+ Name string
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterNameChanged is a free log retrieval operation binding the contract event 0xb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f7.
+//
+// Solidity: event NameChanged(node indexed bytes32, name string)
+func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverNameChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "NameChanged", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverNameChangedIterator{contract: _PublicResolver.contract, event: "NameChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchNameChanged is a free log subscription operation binding the contract event 0xb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f7.
+//
+// Solidity: event NameChanged(node indexed bytes32, name string)
+func (_PublicResolver *PublicResolverFilterer) WatchNameChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverNameChanged, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "NameChanged", nodeRule)
+ 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(PublicResolverNameChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "NameChanged", 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
+}
+
+// PublicResolverPubkeyChangedIterator is returned from FilterPubkeyChanged and is used to iterate over the raw logs and unpacked data for PubkeyChanged events raised by the PublicResolver contract.
+type PublicResolverPubkeyChangedIterator struct {
+ Event *PublicResolverPubkeyChanged // 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 *PublicResolverPubkeyChangedIterator) 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(PublicResolverPubkeyChanged)
+ 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(PublicResolverPubkeyChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverPubkeyChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverPubkeyChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverPubkeyChanged represents a PubkeyChanged event raised by the PublicResolver contract.
+type PublicResolverPubkeyChanged struct {
+ Node [32]byte
+ X [32]byte
+ Y [32]byte
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterPubkeyChanged is a free log retrieval operation binding the contract event 0x1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46.
+//
+// Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32)
+func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverPubkeyChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "PubkeyChanged", nodeRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverPubkeyChangedIterator{contract: _PublicResolver.contract, event: "PubkeyChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchPubkeyChanged is a free log subscription operation binding the contract event 0x1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46.
+//
+// Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32)
+func (_PublicResolver *PublicResolverFilterer) WatchPubkeyChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverPubkeyChanged, node [][32]byte) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "PubkeyChanged", nodeRule)
+ 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(PublicResolverPubkeyChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "PubkeyChanged", 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
+}
+
+// PublicResolverTextChangedIterator is returned from FilterTextChanged and is used to iterate over the raw logs and unpacked data for TextChanged events raised by the PublicResolver contract.
+type PublicResolverTextChangedIterator struct {
+ Event *PublicResolverTextChanged // 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 *PublicResolverTextChangedIterator) 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(PublicResolverTextChanged)
+ 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(PublicResolverTextChanged)
+ 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 retruned any retrieval or parsing error occurred during filtering.
+func (it *PublicResolverTextChangedIterator) Error() error {
+ return it.fail
+}
+
+// Close terminates the iteration process, releasing any pending underlying
+// resources.
+func (it *PublicResolverTextChangedIterator) Close() error {
+ it.sub.Unsubscribe()
+ return nil
+}
+
+// PublicResolverTextChanged represents a TextChanged event raised by the PublicResolver contract.
+type PublicResolverTextChanged struct {
+ Node [32]byte
+ IndexedKey common.Hash
+ Key string
+ Raw types.Log // Blockchain specific contextual infos
+}
+
+// FilterTextChanged is a free log retrieval operation binding the contract event 0xd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a7550.
+//
+// Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string)
+func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.FilterOpts, node [][32]byte, indexedKey []string) (*PublicResolverTextChangedIterator, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var indexedKeyRule []interface{}
+ for _, indexedKeyItem := range indexedKey {
+ indexedKeyRule = append(indexedKeyRule, indexedKeyItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.FilterLogs(opts, "TextChanged", nodeRule, indexedKeyRule)
+ if err != nil {
+ return nil, err
+ }
+ return &PublicResolverTextChangedIterator{contract: _PublicResolver.contract, event: "TextChanged", logs: logs, sub: sub}, nil
+}
+
+// WatchTextChanged is a free log subscription operation binding the contract event 0xd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a7550.
+//
+// Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string)
+func (_PublicResolver *PublicResolverFilterer) WatchTextChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverTextChanged, node [][32]byte, indexedKey []string) (event.Subscription, error) {
+
+ var nodeRule []interface{}
+ for _, nodeItem := range node {
+ nodeRule = append(nodeRule, nodeItem)
+ }
+ var indexedKeyRule []interface{}
+ for _, indexedKeyItem := range indexedKey {
+ indexedKeyRule = append(indexedKeyRule, indexedKeyItem)
+ }
+
+ logs, sub, err := _PublicResolver.contract.WatchLogs(opts, "TextChanged", nodeRule, indexedKeyRule)
+ 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(PublicResolverTextChanged)
+ if err := _PublicResolver.contract.UnpackLog(event, "TextChanged", 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/contracts/release/contract.go b/contracts/release/contract.go
deleted file mode 100644
index 03d7f8875b..0000000000
--- a/contracts/release/contract.go
+++ /dev/null
@@ -1,432 +0,0 @@
-// Code generated - DO NOT EDIT.
-// This file is a generated binding and any manual changes will be lost.
-
-package release
-
-import (
- "math/big"
- "strings"
-
- "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"
-)
-
-// ReleaseOracleABI is the input ABI used to generate the binding from.
-const ReleaseOracleABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"proposedVersion\",\"outputs\":[{\"name\":\"major\",\"type\":\"uint32\"},{\"name\":\"minor\",\"type\":\"uint32\"},{\"name\":\"patch\",\"type\":\"uint32\"},{\"name\":\"commit\",\"type\":\"bytes20\"},{\"name\":\"pass\",\"type\":\"address[]\"},{\"name\":\"fail\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"signers\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"}],\"name\":\"demote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"}],\"name\":\"authVotes\",\"outputs\":[{\"name\":\"promote\",\"type\":\"address[]\"},{\"name\":\"demote\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentVersion\",\"outputs\":[{\"name\":\"major\",\"type\":\"uint32\"},{\"name\":\"minor\",\"type\":\"uint32\"},{\"name\":\"patch\",\"type\":\"uint32\"},{\"name\":\"commit\",\"type\":\"bytes20\"},{\"name\":\"time\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"nuke\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"authProposals\",\"outputs\":[{\"name\":\"\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"}],\"name\":\"promote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"major\",\"type\":\"uint32\"},{\"name\":\"minor\",\"type\":\"uint32\"},{\"name\":\"patch\",\"type\":\"uint32\"},{\"name\":\"commit\",\"type\":\"bytes20\"}],\"name\":\"release\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"signers\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]"
-
-// ReleaseOracleBin is the compiled bytecode used for deploying new contracts.
-const ReleaseOracleBin = `0x606060405234156200001057600080fd5b60405162001395380380620013958339810160405280805190910190506000815115156200009a57600160a060020a0333166000908152602081905260409020805460ff1916600190811790915580548082016200006f838262000157565b5060009182526020909120018054600160a060020a03191633600160a060020a03161790556200014f565b5060005b81518110156200014f576001600080848481518110620000ba57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905560018054808201620000ff838262000157565b916000526020600020900160008484815181106200011957fe5b906020019060200201518254600160a060020a039182166101009390930a9283029190920219909116179055506001016200009e565b5050620001a7565b8154818355818115116200017e576000838152602090206200017e91810190830162000183565b505050565b620001a491905b80821115620001a057600081556001016200018a565b5090565b90565b6111de80620001b76000396000f3006060604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166326db7648811461009d57806346f0975a1461017e5780635c3d005d146101e457806364ed31fe146102055780639d888e86146102bd578063bc8fbbf814610318578063bf8ecf9c1461032b578063d0e0813a1461033e578063d67cbec91461035d575b600080fd5b34156100a857600080fd5b6100b0610397565b60405163ffffffff80881682528681166020830152851660408201526bffffffffffffffffffffffff198416606082015260c0608082018181529060a0830190830185818151815260200191508051906020019060200280838360005b8381101561012557808201518382015260200161010d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561016457808201518382015260200161014c565b505050509050019850505050505050505060405180910390f35b341561018957600080fd5b6101916104bc565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156101d05780820151838201526020016101b8565b505050509050019250505060405180910390f35b34156101ef57600080fd5b610203600160a060020a0360043516610525565b005b341561021057600080fd5b610224600160a060020a0360043516610533565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610268578082015183820152602001610250565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102a757808201518382015260200161028f565b5050505090500194505050505060405180910390f35b34156102c857600080fd5b6102d0610627565b60405163ffffffff95861681529385166020850152919093166040808401919091526bffffffffffffffffffffffff199093166060830152608082015260a001905180910390f35b341561032357600080fd5b6102036106cf565b341561033657600080fd5b6101916106df565b341561034957600080fd5b610203600160a060020a0360043516610745565b341561036857600080fd5b61020363ffffffff600435811690602435811690604435166bffffffffffffffffffffffff1960643516610750565b6000806000806103a5611051565b6103ad611051565b6004546006805463ffffffff808416936401000000008104821693680100000000000000008204909216926c01000000000000000000000000918290049091029190600790829060208082020160405190810160405280929190818152602001828054801561044557602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610427575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156104a157602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610483575b50505050509050955095509550955095509550909192939495565b6104c4611051565b600180548060200260200160405190810160405280929190818152602001828054801561051a57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116104fc575b505050505090505b90565b610530816000610764565b50565b61053b611051565b610543611051565b600160a060020a03831660009081526002602090815260409182902080549092600184019284929182820290910190519081016040528092919081815260200182805480156105bb57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161059d575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561061757602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116105f9575b5050505050905091509150915091565b6000806000806000806008805490506000141561065357600095508594508493508392508291506106c7565b60088054600019810190811061066557fe5b600091825260209091206004909102018054600182015463ffffffff80831699506401000000008304811698506801000000000000000083041696506c0100000000000000000000000091829004909102945067ffffffffffffffff16925090505b509091929394565b6106dd600080808080610c01565b565b6106e7611051565b600380548060200260200160405190810160405280929190818152602001828054801561051a57602002820191906000526020600020908154600160a060020a031681526001909101906020018083116104fc575050505050905090565b610530816001610764565b61075e848484846001610c01565b50505050565b600160a060020a033316600090815260208190526040812054819060ff161561075e575050600160a060020a0382166000908152600260205260408120905b81548110156107ed578154600160a060020a033316908390839081106107c557fe5b600091825260209091200154600160a060020a031614156107e55761075e565b6001016107a3565b5060005b60018201548110156108405733600160a060020a0316826001018281548110151561081857fe5b600091825260209091200154600160a060020a031614156108385761075e565b6001016107f1565b815415801561085157506001820154155b1561088e5760038054600181016108688382611063565b5060009182526020909120018054600160a060020a031916600160a060020a0386161790555b82156108e65781548290600181016108a68382611063565b5060009182526020909120018054600160a060020a03191633600160a060020a0316179055600154600290835491900490116108e15761075e565b61093a565b8160010180548060010182816108fc9190611063565b5060009182526020909120018054600160a060020a03191633600160a060020a03161790556001546002906001840154919004901161093a5761075e565b8280156109605750600160a060020a03841660009081526020819052604090205460ff16155b156109c457600160a060020a0384166000908152602081905260409020805460ff19166001908117909155805480820161099a8382611063565b5060009182526020909120018054600160a060020a031916600160a060020a038616179055610b09565b821580156109ea5750600160a060020a03841660009081526020819052604090205460ff165b15610b095750600160a060020a0383166000908152602081905260408120805460ff191690555b600154811015610b095783600160a060020a0316600182815481101515610a3457fe5b600091825260209091200154600160a060020a03161415610b0157600180546000198101908110610a6157fe5b60009182526020909120015460018054600160a060020a039092169183908110610a8757fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556001805490610ac3906000198301611063565b50600060048181556005805467ffffffffffffffff1916905590600681610aea828261108c565b610af860018301600061108c565b50505050610b09565b600101610a11565b600160a060020a038416600090815260026020526040812090610b2c828261108c565b610b3a60018301600061108c565b5050600090505b60035481101561075e5783600160a060020a0316600382815481101515610b6457fe5b600091825260209091200154600160a060020a03161415610bf957600380546000198101908110610b9157fe5b60009182526020909120015460038054600160a060020a039092169183908110610bb757fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556003805490610bf3906000198301611063565b5061075e565b600101610b41565b600160a060020a033316600090815260208190526040812054819060ff16156110485782158015610c325750600654155b15610c3c57611048565b6006541515610cb7576004805463ffffffff191663ffffffff8981169190911767ffffffff00000000191664010000000089831602176bffffffff000000000000000019166801000000000000000091881691909102176bffffffffffffffffffffffff166c01000000000000000000000000808704021790555b828015610d41575060045463ffffffff8881169116141580610cec575060045463ffffffff8781166401000000009092041614155b80610d0e575060045463ffffffff868116680100000000000000009092041614155b80610d4157506004546c0100000000000000000000000090819004026bffffffffffffffffffffffff1990811690851614155b15610d4b57611048565b506006905060005b8154811015610d9d578154600160a060020a03331690839083908110610d7557fe5b600091825260209091200154600160a060020a03161415610d9557611048565b600101610d53565b5060005b6001820154811015610df05733600160a060020a03168260010182815481101515610dc857fe5b600091825260209091200154600160a060020a03161415610de857611048565b600101610da1565b8215610e48578154829060018101610e088382611063565b5060009182526020909120018054600160a060020a03191633600160a060020a031617905560015460029083549190049011610e4357611048565b610e9c565b816001018054806001018281610e5e9190611063565b5060009182526020909120018054600160a060020a03191633600160a060020a031617905560015460029060018401549190049011610e9c57611048565b821561100f576005805467ffffffffffffffff19164267ffffffffffffffff161790556008805460018101610ed183826110aa565b6000928352602090922060048054928102909101805463ffffffff191663ffffffff9384161780825582546401000000009081900485160267ffffffff000000001990911617808255825468010000000000000000908190049094169093026bffffffff0000000000000000199093169290921780835581546c01000000000000000000000000908190048102819004026bffffffffffffffffffffffff90911617825560055460018301805467ffffffffffffffff191667ffffffffffffffff909216919091179055600680549192916002830190610fb490829084906110d6565b5060018281018054610fc992840191906110d6565b5050600060048181556005805467ffffffffffffffff191690559450925060069150829050610ff8828261108c565b61100660018301600061108c565b50505050611048565b600060048181556005805467ffffffffffffffff1916905590600681611035828261108c565b61104360018301600061108c565b505050505b50505050505050565b60206040519081016040526000815290565b81548183558181151161108757600083815260209020611087918101908301611126565b505050565b50805460008255906000526020600020908101906105309190611126565b815481835581811511611087576004028160040283600052602060002091820191016110879190611140565b8280548282559060005260206000209081019282156111165760005260206000209182015b828111156111165782548255916001019190600101906110fb565b5061112292915061118e565b5090565b61052291905b80821115611122576000815560010161112c565b61052291905b8082111561112257600080825560018201805467ffffffffffffffff191690556002820181611175828261108c565b61118360018301600061108c565b505050600401611146565b61052291905b80821115611122578054600160a060020a03191681556001016111945600a165627a7a72305820aa9c89b9c569e44fa08285a00ab47bcdf0a01ebbc54e3cd864450622b5e559a40029`
-
-// DeployReleaseOracle deploys a new Ethereum contract, binding an instance of ReleaseOracle to it.
-func DeployReleaseOracle(auth *bind.TransactOpts, backend bind.ContractBackend, signers []common.Address) (common.Address, *types.Transaction, *ReleaseOracle, error) {
- parsed, err := abi.JSON(strings.NewReader(ReleaseOracleABI))
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ReleaseOracleBin), backend, signers)
- if err != nil {
- return common.Address{}, nil, nil, err
- }
- return address, tx, &ReleaseOracle{ReleaseOracleCaller: ReleaseOracleCaller{contract: contract}, ReleaseOracleTransactor: ReleaseOracleTransactor{contract: contract}}, nil
-}
-
-// ReleaseOracle is an auto generated Go binding around an Ethereum contract.
-type ReleaseOracle struct {
- ReleaseOracleCaller // Read-only binding to the contract
- ReleaseOracleTransactor // Write-only binding to the contract
-}
-
-// ReleaseOracleCaller is an auto generated read-only Go binding around an Ethereum contract.
-type ReleaseOracleCaller struct {
- contract *bind.BoundContract // Generic contract wrapper for the low level calls
-}
-
-// ReleaseOracleTransactor is an auto generated write-only Go binding around an Ethereum contract.
-type ReleaseOracleTransactor struct {
- contract *bind.BoundContract // Generic contract wrapper for the low level calls
-}
-
-// ReleaseOracleSession is an auto generated Go binding around an Ethereum contract,
-// with pre-set call and transact options.
-type ReleaseOracleSession struct {
- Contract *ReleaseOracle // 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
-}
-
-// ReleaseOracleCallerSession is an auto generated read-only Go binding around an Ethereum contract,
-// with pre-set call options.
-type ReleaseOracleCallerSession struct {
- Contract *ReleaseOracleCaller // Generic contract caller binding to set the session for
- CallOpts bind.CallOpts // Call options to use throughout this session
-}
-
-// ReleaseOracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
-// with pre-set transact options.
-type ReleaseOracleTransactorSession struct {
- Contract *ReleaseOracleTransactor // Generic contract transactor binding to set the session for
- TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
-}
-
-// ReleaseOracleRaw is an auto generated low-level Go binding around an Ethereum contract.
-type ReleaseOracleRaw struct {
- Contract *ReleaseOracle // Generic contract binding to access the raw methods on
-}
-
-// ReleaseOracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
-type ReleaseOracleCallerRaw struct {
- Contract *ReleaseOracleCaller // Generic read-only contract binding to access the raw methods on
-}
-
-// ReleaseOracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
-type ReleaseOracleTransactorRaw struct {
- Contract *ReleaseOracleTransactor // Generic write-only contract binding to access the raw methods on
-}
-
-// NewReleaseOracle creates a new instance of ReleaseOracle, bound to a specific deployed contract.
-func NewReleaseOracle(address common.Address, backend bind.ContractBackend) (*ReleaseOracle, error) {
- contract, err := bindReleaseOracle(address, backend, backend)
- if err != nil {
- return nil, err
- }
- return &ReleaseOracle{ReleaseOracleCaller: ReleaseOracleCaller{contract: contract}, ReleaseOracleTransactor: ReleaseOracleTransactor{contract: contract}}, nil
-}
-
-// NewReleaseOracleCaller creates a new read-only instance of ReleaseOracle, bound to a specific deployed contract.
-func NewReleaseOracleCaller(address common.Address, caller bind.ContractCaller) (*ReleaseOracleCaller, error) {
- contract, err := bindReleaseOracle(address, caller, nil)
- if err != nil {
- return nil, err
- }
- return &ReleaseOracleCaller{contract: contract}, nil
-}
-
-// NewReleaseOracleTransactor creates a new write-only instance of ReleaseOracle, bound to a specific deployed contract.
-func NewReleaseOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*ReleaseOracleTransactor, error) {
- contract, err := bindReleaseOracle(address, nil, transactor)
- if err != nil {
- return nil, err
- }
- return &ReleaseOracleTransactor{contract: contract}, nil
-}
-
-// bindReleaseOracle binds a generic wrapper to an already deployed contract.
-func bindReleaseOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {
- parsed, err := abi.JSON(strings.NewReader(ReleaseOracleABI))
- if err != nil {
- return nil, err
- }
- return bind.NewBoundContract(address, parsed, caller, transactor), 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 (_ReleaseOracle *ReleaseOracleRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
- return _ReleaseOracle.Contract.ReleaseOracleCaller.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 (_ReleaseOracle *ReleaseOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.ReleaseOracleTransactor.contract.Transfer(opts)
-}
-
-// Transact invokes the (paid) contract method with params as input values.
-func (_ReleaseOracle *ReleaseOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.ReleaseOracleTransactor.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 (_ReleaseOracle *ReleaseOracleCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
- return _ReleaseOracle.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 (_ReleaseOracle *ReleaseOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.contract.Transfer(opts)
-}
-
-// Transact invokes the (paid) contract method with params as input values.
-func (_ReleaseOracle *ReleaseOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.contract.Transact(opts, method, params...)
-}
-
-// AuthProposals is a free data retrieval call binding the contract method 0xbf8ecf9c.
-//
-// Solidity: function authProposals() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleCaller) AuthProposals(opts *bind.CallOpts) ([]common.Address, error) {
- var (
- ret0 = new([]common.Address)
- )
- out := ret0
- err := _ReleaseOracle.contract.Call(opts, out, "authProposals")
- return *ret0, err
-}
-
-// AuthProposals is a free data retrieval call binding the contract method 0xbf8ecf9c.
-//
-// Solidity: function authProposals() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleSession) AuthProposals() ([]common.Address, error) {
- return _ReleaseOracle.Contract.AuthProposals(&_ReleaseOracle.CallOpts)
-}
-
-// AuthProposals is a free data retrieval call binding the contract method 0xbf8ecf9c.
-//
-// Solidity: function authProposals() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleCallerSession) AuthProposals() ([]common.Address, error) {
- return _ReleaseOracle.Contract.AuthProposals(&_ReleaseOracle.CallOpts)
-}
-
-// AuthVotes is a free data retrieval call binding the contract method 0x64ed31fe.
-//
-// Solidity: function authVotes(user address) constant returns(promote address[], demote address[])
-func (_ReleaseOracle *ReleaseOracleCaller) AuthVotes(opts *bind.CallOpts, user common.Address) (struct {
- Promote []common.Address
- Demote []common.Address
-}, error) {
- ret := new(struct {
- Promote []common.Address
- Demote []common.Address
- })
- out := ret
- err := _ReleaseOracle.contract.Call(opts, out, "authVotes", user)
- return *ret, err
-}
-
-// AuthVotes is a free data retrieval call binding the contract method 0x64ed31fe.
-//
-// Solidity: function authVotes(user address) constant returns(promote address[], demote address[])
-func (_ReleaseOracle *ReleaseOracleSession) AuthVotes(user common.Address) (struct {
- Promote []common.Address
- Demote []common.Address
-}, error) {
- return _ReleaseOracle.Contract.AuthVotes(&_ReleaseOracle.CallOpts, user)
-}
-
-// AuthVotes is a free data retrieval call binding the contract method 0x64ed31fe.
-//
-// Solidity: function authVotes(user address) constant returns(promote address[], demote address[])
-func (_ReleaseOracle *ReleaseOracleCallerSession) AuthVotes(user common.Address) (struct {
- Promote []common.Address
- Demote []common.Address
-}, error) {
- return _ReleaseOracle.Contract.AuthVotes(&_ReleaseOracle.CallOpts, user)
-}
-
-// CurrentVersion is a free data retrieval call binding the contract method 0x9d888e86.
-//
-// Solidity: function currentVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, time uint256)
-func (_ReleaseOracle *ReleaseOracleCaller) CurrentVersion(opts *bind.CallOpts) (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Time *big.Int
-}, error) {
- ret := new(struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Time *big.Int
- })
- out := ret
- err := _ReleaseOracle.contract.Call(opts, out, "currentVersion")
- return *ret, err
-}
-
-// CurrentVersion is a free data retrieval call binding the contract method 0x9d888e86.
-//
-// Solidity: function currentVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, time uint256)
-func (_ReleaseOracle *ReleaseOracleSession) CurrentVersion() (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Time *big.Int
-}, error) {
- return _ReleaseOracle.Contract.CurrentVersion(&_ReleaseOracle.CallOpts)
-}
-
-// CurrentVersion is a free data retrieval call binding the contract method 0x9d888e86.
-//
-// Solidity: function currentVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, time uint256)
-func (_ReleaseOracle *ReleaseOracleCallerSession) CurrentVersion() (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Time *big.Int
-}, error) {
- return _ReleaseOracle.Contract.CurrentVersion(&_ReleaseOracle.CallOpts)
-}
-
-// ProposedVersion is a free data retrieval call binding the contract method 0x26db7648.
-//
-// Solidity: function proposedVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, pass address[], fail address[])
-func (_ReleaseOracle *ReleaseOracleCaller) ProposedVersion(opts *bind.CallOpts) (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Pass []common.Address
- Fail []common.Address
-}, error) {
- ret := new(struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Pass []common.Address
- Fail []common.Address
- })
- out := ret
- err := _ReleaseOracle.contract.Call(opts, out, "proposedVersion")
- return *ret, err
-}
-
-// ProposedVersion is a free data retrieval call binding the contract method 0x26db7648.
-//
-// Solidity: function proposedVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, pass address[], fail address[])
-func (_ReleaseOracle *ReleaseOracleSession) ProposedVersion() (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Pass []common.Address
- Fail []common.Address
-}, error) {
- return _ReleaseOracle.Contract.ProposedVersion(&_ReleaseOracle.CallOpts)
-}
-
-// ProposedVersion is a free data retrieval call binding the contract method 0x26db7648.
-//
-// Solidity: function proposedVersion() constant returns(major uint32, minor uint32, patch uint32, commit bytes20, pass address[], fail address[])
-func (_ReleaseOracle *ReleaseOracleCallerSession) ProposedVersion() (struct {
- Major uint32
- Minor uint32
- Patch uint32
- Commit [20]byte
- Pass []common.Address
- Fail []common.Address
-}, error) {
- return _ReleaseOracle.Contract.ProposedVersion(&_ReleaseOracle.CallOpts)
-}
-
-// Signers is a free data retrieval call binding the contract method 0x46f0975a.
-//
-// Solidity: function signers() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleCaller) Signers(opts *bind.CallOpts) ([]common.Address, error) {
- var (
- ret0 = new([]common.Address)
- )
- out := ret0
- err := _ReleaseOracle.contract.Call(opts, out, "signers")
- return *ret0, err
-}
-
-// Signers is a free data retrieval call binding the contract method 0x46f0975a.
-//
-// Solidity: function signers() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleSession) Signers() ([]common.Address, error) {
- return _ReleaseOracle.Contract.Signers(&_ReleaseOracle.CallOpts)
-}
-
-// Signers is a free data retrieval call binding the contract method 0x46f0975a.
-//
-// Solidity: function signers() constant returns(address[])
-func (_ReleaseOracle *ReleaseOracleCallerSession) Signers() ([]common.Address, error) {
- return _ReleaseOracle.Contract.Signers(&_ReleaseOracle.CallOpts)
-}
-
-// Demote is a paid mutator transaction binding the contract method 0x5c3d005d.
-//
-// Solidity: function demote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleTransactor) Demote(opts *bind.TransactOpts, user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.contract.Transact(opts, "demote", user)
-}
-
-// Demote is a paid mutator transaction binding the contract method 0x5c3d005d.
-//
-// Solidity: function demote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleSession) Demote(user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Demote(&_ReleaseOracle.TransactOpts, user)
-}
-
-// Demote is a paid mutator transaction binding the contract method 0x5c3d005d.
-//
-// Solidity: function demote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleTransactorSession) Demote(user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Demote(&_ReleaseOracle.TransactOpts, user)
-}
-
-// Nuke is a paid mutator transaction binding the contract method 0xbc8fbbf8.
-//
-// Solidity: function nuke() returns()
-func (_ReleaseOracle *ReleaseOracleTransactor) Nuke(opts *bind.TransactOpts) (*types.Transaction, error) {
- return _ReleaseOracle.contract.Transact(opts, "nuke")
-}
-
-// Nuke is a paid mutator transaction binding the contract method 0xbc8fbbf8.
-//
-// Solidity: function nuke() returns()
-func (_ReleaseOracle *ReleaseOracleSession) Nuke() (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Nuke(&_ReleaseOracle.TransactOpts)
-}
-
-// Nuke is a paid mutator transaction binding the contract method 0xbc8fbbf8.
-//
-// Solidity: function nuke() returns()
-func (_ReleaseOracle *ReleaseOracleTransactorSession) Nuke() (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Nuke(&_ReleaseOracle.TransactOpts)
-}
-
-// Promote is a paid mutator transaction binding the contract method 0xd0e0813a.
-//
-// Solidity: function promote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleTransactor) Promote(opts *bind.TransactOpts, user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.contract.Transact(opts, "promote", user)
-}
-
-// Promote is a paid mutator transaction binding the contract method 0xd0e0813a.
-//
-// Solidity: function promote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleSession) Promote(user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Promote(&_ReleaseOracle.TransactOpts, user)
-}
-
-// Promote is a paid mutator transaction binding the contract method 0xd0e0813a.
-//
-// Solidity: function promote(user address) returns()
-func (_ReleaseOracle *ReleaseOracleTransactorSession) Promote(user common.Address) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Promote(&_ReleaseOracle.TransactOpts, user)
-}
-
-// Release is a paid mutator transaction binding the contract method 0xd67cbec9.
-//
-// Solidity: function release(major uint32, minor uint32, patch uint32, commit bytes20) returns()
-func (_ReleaseOracle *ReleaseOracleTransactor) Release(opts *bind.TransactOpts, major uint32, minor uint32, patch uint32, commit [20]byte) (*types.Transaction, error) {
- return _ReleaseOracle.contract.Transact(opts, "release", major, minor, patch, commit)
-}
-
-// Release is a paid mutator transaction binding the contract method 0xd67cbec9.
-//
-// Solidity: function release(major uint32, minor uint32, patch uint32, commit bytes20) returns()
-func (_ReleaseOracle *ReleaseOracleSession) Release(major uint32, minor uint32, patch uint32, commit [20]byte) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Release(&_ReleaseOracle.TransactOpts, major, minor, patch, commit)
-}
-
-// Release is a paid mutator transaction binding the contract method 0xd67cbec9.
-//
-// Solidity: function release(major uint32, minor uint32, patch uint32, commit bytes20) returns()
-func (_ReleaseOracle *ReleaseOracleTransactorSession) Release(major uint32, minor uint32, patch uint32, commit [20]byte) (*types.Transaction, error) {
- return _ReleaseOracle.Contract.Release(&_ReleaseOracle.TransactOpts, major, minor, patch, commit)
-}
diff --git a/contracts/release/contract.sol b/contracts/release/contract.sol
deleted file mode 100644
index 2a28c58943..0000000000
--- a/contracts/release/contract.sol
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright 2016 The go-ethereum Authors
-// This file is part of the go-ethereum library.
-//
-// The go-ethereum library is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The go-ethereum library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with the go-ethereum library. If not, see .
-
-pragma solidity ^0.4.18;
-
-// ReleaseOracle is an Ethereum contract to store the current and previous
-// versions of the go-ethereum implementation. Its goal is to allow Geth to
-// check for new releases automatically without the need to consult a central
-// repository.
-//
-// The contract takes a vote based approach on both assigning authorised signers
-// as well as signing off on new Geth releases.
-//
-// Note, when a signer is demoted, the currently pending release is auto-nuked.
-// The reason is to prevent suprises where a demotion actually tilts the votes
-// in favor of one voter party and pushing out a new release as a consequence of
-// a simple demotion.
-contract ReleaseOracle {
- // Votes is an internal data structure to count votes on a specific proposal
- struct Votes {
- address[] pass; // List of signers voting to pass a proposal
- address[] fail; // List of signers voting to fail a proposal
- }
-
- // Version is the version details of a particular Geth release
- struct Version {
- uint32 major; // Major version component of the release
- uint32 minor; // Minor version component of the release
- uint32 patch; // Patch version component of the release
- bytes20 commit; // Git SHA1 commit hash of the release
-
- uint64 time; // Timestamp of the release approval
- Votes votes; // Votes that passed this release
- }
-
- // Oracle authorization details
- mapping(address => bool) authorised; // Set of accounts allowed to vote on updating the contract
- address[] voters; // List of addresses currently accepted as signers
-
- // Various proposals being voted on
- mapping(address => Votes) authProps; // Currently running user authorization proposals
- address[] authPend; // List of addresses being voted on (map indexes)
-
- Version verProp; // Currently proposed release being voted on
- Version[] releases; // All the positively voted releases
-
- // isSigner is a modifier to authorize contract transactions.
- modifier isSigner() {
- if (authorised[msg.sender]) {
- _;
- }
- }
-
- // Constructor to assign the initial set of signers.
- function ReleaseOracle(address[] signers) {
- // If no signers were specified, assign the creator as the sole signer
- if (signers.length == 0) {
- authorised[msg.sender] = true;
- voters.push(msg.sender);
- return;
- }
- // Otherwise assign the individual signers one by one
- for (uint i = 0; i < signers.length; i++) {
- authorised[signers[i]] = true;
- voters.push(signers[i]);
- }
- }
-
- // signers is an accessor method to retrieve all the signers (public accessor
- // generates an indexed one, not a retrieve-all version).
- function signers() constant returns(address[]) {
- return voters;
- }
-
- // authProposals retrieves the list of addresses that authorization proposals
- // are currently being voted on.
- function authProposals() constant returns(address[]) {
- return authPend;
- }
-
- // authVotes retrieves the current authorization votes for a particular user
- // to promote him into the list of signers, or demote him from there.
- function authVotes(address user) constant returns(address[] promote, address[] demote) {
- return (authProps[user].pass, authProps[user].fail);
- }
-
- // currentVersion retrieves the semantic version, commit hash and release time
- // of the currently votec active release.
- function currentVersion() constant returns (uint32 major, uint32 minor, uint32 patch, bytes20 commit, uint time) {
- if (releases.length == 0) {
- return (0, 0, 0, 0, 0);
- }
- var release = releases[releases.length - 1];
-
- return (release.major, release.minor, release.patch, release.commit, release.time);
- }
-
- // proposedVersion retrieves the semantic version, commit hash and the current
- // votes for the next proposed release.
- function proposedVersion() constant returns (uint32 major, uint32 minor, uint32 patch, bytes20 commit, address[] pass, address[] fail) {
- return (verProp.major, verProp.minor, verProp.patch, verProp.commit, verProp.votes.pass, verProp.votes.fail);
- }
-
- // promote pitches in on a voting campaign to promote a new user to a signer
- // position.
- function promote(address user) {
- updateSigner(user, true);
- }
-
- // demote pitches in on a voting campaign to demote an authorised user from
- // its signer position.
- function demote(address user) {
- updateSigner(user, false);
- }
-
- // release votes for a particular version to be included as the next release.
- function release(uint32 major, uint32 minor, uint32 patch, bytes20 commit) {
- updateRelease(major, minor, patch, commit, true);
- }
-
- // nuke votes for the currently proposed version to not be included as the next
- // release. Nuking doesn't require a specific version number for simplicity.
- function nuke() {
- updateRelease(0, 0, 0, 0, false);
- }
-
- // updateSigner marks a vote for changing the status of an Ethereum user, either
- // for or against the user being an authorised signer.
- function updateSigner(address user, bool authorize) internal isSigner {
- // Gather the current votes and ensure we don't double vote
- Votes votes = authProps[user];
- for (uint i = 0; i < votes.pass.length; i++) {
- if (votes.pass[i] == msg.sender) {
- return;
- }
- }
- for (i = 0; i < votes.fail.length; i++) {
- if (votes.fail[i] == msg.sender) {
- return;
- }
- }
- // If no authorization proposal is open, add the user to the index for later lookups
- if (votes.pass.length == 0 && votes.fail.length == 0) {
- authPend.push(user);
- }
- // Cast the vote and return if the proposal cannot be resolved yet
- if (authorize) {
- votes.pass.push(msg.sender);
- if (votes.pass.length <= voters.length / 2) {
- return;
- }
- } else {
- votes.fail.push(msg.sender);
- if (votes.fail.length <= voters.length / 2) {
- return;
- }
- }
- // Proposal resolved in our favor, execute whatever we voted on
- if (authorize && !authorised[user]) {
- authorised[user] = true;
- voters.push(user);
- } else if (!authorize && authorised[user]) {
- authorised[user] = false;
-
- for (i = 0; i < voters.length; i++) {
- if (voters[i] == user) {
- voters[i] = voters[voters.length - 1];
- voters.length--;
-
- delete verProp; // Nuke any version proposal (no surprise releases!)
- break;
- }
- }
- }
- // Finally delete the resolved proposal, index and garbage collect
- delete authProps[user];
-
- for (i = 0; i < authPend.length; i++) {
- if (authPend[i] == user) {
- authPend[i] = authPend[authPend.length - 1];
- authPend.length--;
- break;
- }
- }
- }
-
- // updateRelease votes for a particular version to be included as the next release,
- // or for the currently proposed release to be nuked out.
- function updateRelease(uint32 major, uint32 minor, uint32 patch, bytes20 commit, bool release) internal isSigner {
- // Skip nuke votes if no proposal is pending
- if (!release && verProp.votes.pass.length == 0) {
- return;
- }
- // Mark a new release if no proposal is pending
- if (verProp.votes.pass.length == 0) {
- verProp.major = major;
- verProp.minor = minor;
- verProp.patch = patch;
- verProp.commit = commit;
- }
- // Make sure positive votes match the current proposal
- if (release && (verProp.major != major || verProp.minor != minor || verProp.patch != patch || verProp.commit != commit)) {
- return;
- }
- // Gather the current votes and ensure we don't double vote
- Votes votes = verProp.votes;
- for (uint i = 0; i < votes.pass.length; i++) {
- if (votes.pass[i] == msg.sender) {
- return;
- }
- }
- for (i = 0; i < votes.fail.length; i++) {
- if (votes.fail[i] == msg.sender) {
- return;
- }
- }
- // Cast the vote and return if the proposal cannot be resolved yet
- if (release) {
- votes.pass.push(msg.sender);
- if (votes.pass.length <= voters.length / 2) {
- return;
- }
- } else {
- votes.fail.push(msg.sender);
- if (votes.fail.length <= voters.length / 2) {
- return;
- }
- }
- // Proposal resolved in our favor, execute whatever we voted on
- if (release) {
- verProp.time = uint64(now);
- releases.push(verProp);
- delete verProp;
- } else {
- delete verProp;
- }
- }
-}
diff --git a/contracts/release/contract_test.go b/contracts/release/contract_test.go
deleted file mode 100644
index 0b2b2f0487..0000000000
--- a/contracts/release/contract_test.go
+++ /dev/null
@@ -1,374 +0,0 @@
-// Copyright 2016 The go-ethereum Authors
-// This file is part of the go-ethereum library.
-//
-// The go-ethereum library is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The go-ethereum library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with the go-ethereum library. If not, see .
-
-package release
-
-import (
- "crypto/ecdsa"
- "math/big"
- "testing"
-
- "github.com/ethereum/go-ethereum/accounts/abi/bind"
- "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
- "github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core"
- "github.com/ethereum/go-ethereum/crypto"
-)
-
-// setupReleaseTest creates a blockchain simulator and deploys a version oracle
-// contract for testing.
-func setupReleaseTest(t *testing.T, prefund ...*ecdsa.PrivateKey) (*ecdsa.PrivateKey, *ReleaseOracle, *backends.SimulatedBackend) {
- // Generate a new random account and a funded simulator
- key, _ := crypto.GenerateKey()
- auth := bind.NewKeyedTransactor(key)
-
- alloc := core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}
- for _, key := range prefund {
- alloc[crypto.PubkeyToAddress(key.PublicKey)] = core.GenesisAccount{Balance: big.NewInt(10000000000)}
- }
- sim := backends.NewSimulatedBackend(alloc)
-
- // Deploy a version oracle contract, commit and return
- _, _, oracle, err := DeployReleaseOracle(auth, sim, []common.Address{auth.From})
- if err != nil {
- t.Fatalf("Failed to deploy version contract: %v", err)
- }
- sim.Commit()
-
- return key, oracle, sim
-}
-
-// Tests that the version contract can be deployed and the creator is assigned
-// the sole authorized signer.
-func TestContractCreation(t *testing.T) {
- key, oracle, _ := setupReleaseTest(t)
-
- owner := crypto.PubkeyToAddress(key.PublicKey)
- signers, err := oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Failed to retrieve list of signers: %v", err)
- }
- if len(signers) != 1 || signers[0] != owner {
- t.Fatalf("Initial signer mismatch: have %v, want %v", signers, owner)
- }
-}
-
-// Tests that subsequent signers can be promoted, each requiring half plus one
-// votes for it to pass through.
-func TestSignerPromotion(t *testing.T) {
- // Prefund a few accounts to authorize with and create the oracle
- keys := make([]*ecdsa.PrivateKey, 5)
- for i := 0; i < len(keys); i++ {
- keys[i], _ = crypto.GenerateKey()
- }
- key, oracle, sim := setupReleaseTest(t, keys...)
-
- // Gradually promote the keys, until all are authorized
- keys = append([]*ecdsa.PrivateKey{key}, keys...)
- for i := 1; i < len(keys); i++ {
- // Check that no votes are accepted from the not yet authorized user
- if _, err := oracle.Promote(bind.NewKeyedTransactor(keys[i]), common.Address{}); err != nil {
- t.Fatalf("Iter #%d: failed invalid promotion attempt: %v", i, err)
- }
- sim.Commit()
-
- pend, err := oracle.AuthProposals(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve active proposals: %v", i, err)
- }
- if len(pend) != 0 {
- t.Fatalf("Iter #%d: proposal count mismatch: have %d, want 0", i, len(pend))
- }
- // Promote with half - 1 voters and check that the user's not yet authorized
- for j := 0; j < i/2; j++ {
- if _, err = oracle.Promote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- signers, err := oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve list of signers: %v", i, err)
- }
- if len(signers) != i {
- t.Fatalf("Iter #%d: signer count mismatch: have %v, want %v", i, len(signers), i)
- }
- // Promote with the last one needed to pass the promotion
- if _, err = oracle.Promote(bind.NewKeyedTransactor(keys[i/2]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion completion attempt: %v", i, err)
- }
- sim.Commit()
-
- signers, err = oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve list of signers: %v", i, err)
- }
- if len(signers) != i+1 {
- t.Fatalf("Iter #%d: signer count mismatch: have %v, want %v", i, len(signers), i+1)
- }
- }
-}
-
-// Tests that subsequent signers can be demoted, each requiring half plus one
-// votes for it to pass through.
-func TestSignerDemotion(t *testing.T) {
- // Prefund a few accounts to authorize with and create the oracle
- keys := make([]*ecdsa.PrivateKey, 5)
- for i := 0; i < len(keys); i++ {
- keys[i], _ = crypto.GenerateKey()
- }
- key, oracle, sim := setupReleaseTest(t, keys...)
-
- // Authorize all the keys as valid signers and verify cardinality
- keys = append([]*ecdsa.PrivateKey{key}, keys...)
- for i := 1; i < len(keys); i++ {
- for j := 0; j <= i/2; j++ {
- if _, err := oracle.Promote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion attempt: %v", i, err)
- }
- }
- sim.Commit()
- }
- signers, err := oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Failed to retrieve list of signers: %v", err)
- }
- if len(signers) != len(keys) {
- t.Fatalf("Signer count mismatch: have %v, want %v", len(signers), len(keys))
- }
- // Gradually demote users until we run out of signers
- for i := len(keys) - 1; i >= 0; i-- {
- // Demote with half - 1 voters and check that the user's not yet dropped
- for j := 0; j < (i+1)/2; j++ {
- if _, err = oracle.Demote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid demotion attempt: %v", len(keys)-i, err)
- }
- }
- sim.Commit()
-
- signers, err := oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve list of signers: %v", len(keys)-i, err)
- }
- if len(signers) != i+1 {
- t.Fatalf("Iter #%d: signer count mismatch: have %v, want %v", len(keys)-i, len(signers), i+1)
- }
- // Demote with the last one needed to pass the demotion
- if _, err = oracle.Demote(bind.NewKeyedTransactor(keys[(i+1)/2]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid demotion completion attempt: %v", i, err)
- }
- sim.Commit()
-
- signers, err = oracle.Signers(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve list of signers: %v", len(keys)-i, err)
- }
- if len(signers) != i {
- t.Fatalf("Iter #%d: signer count mismatch: have %v, want %v", len(keys)-i, len(signers), i)
- }
- // Check that no votes are accepted from the already demoted users
- if _, err = oracle.Promote(bind.NewKeyedTransactor(keys[i]), common.Address{}); err != nil {
- t.Fatalf("Iter #%d: failed invalid promotion attempt: %v", i, err)
- }
- sim.Commit()
-
- pend, err := oracle.AuthProposals(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve active proposals: %v", i, err)
- }
- if len(pend) != 0 {
- t.Fatalf("Iter #%d: proposal count mismatch: have %d, want 0", i, len(pend))
- }
- }
-}
-
-// Tests that new versions can be released, honouring both voting rights as well
-// as the minimum required vote count.
-func TestVersionRelease(t *testing.T) {
- // Prefund a few accounts to authorize with and create the oracle
- keys := make([]*ecdsa.PrivateKey, 5)
- for i := 0; i < len(keys); i++ {
- keys[i], _ = crypto.GenerateKey()
- }
- key, oracle, sim := setupReleaseTest(t, keys...)
-
- // Track the "current release"
- var (
- verMajor = uint32(0)
- verMinor = uint32(0)
- verPatch = uint32(0)
- verCommit = [20]byte{}
- )
- // Gradually push releases, always requiring more signers than previously
- keys = append([]*ecdsa.PrivateKey{key}, keys...)
- for i := 1; i < len(keys); i++ {
- // Check that no votes are accepted from the not yet authorized user
- if _, err := oracle.Release(bind.NewKeyedTransactor(keys[i]), 0, 0, 0, [20]byte{0}); err != nil {
- t.Fatalf("Iter #%d: failed invalid release attempt: %v", i, err)
- }
- sim.Commit()
-
- prop, err := oracle.ProposedVersion(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve active proposal: %v", i, err)
- }
- if len(prop.Pass) != 0 {
- t.Fatalf("Iter #%d: proposal vote count mismatch: have %d, want 0", i, len(prop.Pass))
- }
- // Authorize the user to make releases
- for j := 0; j <= i/2; j++ {
- if _, err = oracle.Promote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- // Propose release with half voters and check that the release does not yet go through
- for j := 0; j < (i+1)/2; j++ {
- if _, err = oracle.Release(bind.NewKeyedTransactor(keys[j]), uint32(i), uint32(i+1), uint32(i+2), [20]byte{byte(i + 3)}); err != nil {
- t.Fatalf("Iter #%d: failed valid release attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- ver, err := oracle.CurrentVersion(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve current version: %v", i, err)
- }
- if ver.Major != verMajor || ver.Minor != verMinor || ver.Patch != verPatch || ver.Commit != verCommit {
- t.Fatalf("Iter #%d: version mismatch: have %d.%d.%d-%x, want %d.%d.%d-%x", i, ver.Major, ver.Minor, ver.Patch, ver.Commit, verMajor, verMinor, verPatch, verCommit)
- }
-
- // Pass the release and check that it became the next version
- verMajor, verMinor, verPatch, verCommit = uint32(i), uint32(i+1), uint32(i+2), [20]byte{byte(i + 3)}
- if _, err = oracle.Release(bind.NewKeyedTransactor(keys[(i+1)/2]), uint32(i), uint32(i+1), uint32(i+2), [20]byte{byte(i + 3)}); err != nil {
- t.Fatalf("Iter #%d: failed valid release completion attempt: %v", i, err)
- }
- sim.Commit()
-
- ver, err = oracle.CurrentVersion(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve current version: %v", i, err)
- }
- if ver.Major != verMajor || ver.Minor != verMinor || ver.Patch != verPatch || ver.Commit != verCommit {
- t.Fatalf("Iter #%d: version mismatch: have %d.%d.%d-%x, want %d.%d.%d-%x", i, ver.Major, ver.Minor, ver.Patch, ver.Commit, verMajor, verMinor, verPatch, verCommit)
- }
- }
-}
-
-// Tests that proposed versions can be nuked out of existence.
-func TestVersionNuking(t *testing.T) {
- // Prefund a few accounts to authorize with and create the oracle
- keys := make([]*ecdsa.PrivateKey, 9)
- for i := 0; i < len(keys); i++ {
- keys[i], _ = crypto.GenerateKey()
- }
- key, oracle, sim := setupReleaseTest(t, keys...)
-
- // Authorize all the keys as valid signers
- keys = append([]*ecdsa.PrivateKey{key}, keys...)
- for i := 1; i < len(keys); i++ {
- for j := 0; j <= i/2; j++ {
- if _, err := oracle.Promote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion attempt: %v", i, err)
- }
- }
- sim.Commit()
- }
- // Propose releases with more and more keys, always retaining enough users to nuke the proposals
- for i := 1; i < (len(keys)+1)/2; i++ {
- // Propose release with an initial set of signers
- for j := 0; j < i; j++ {
- if _, err := oracle.Release(bind.NewKeyedTransactor(keys[j]), uint32(i), uint32(i+1), uint32(i+2), [20]byte{byte(i + 3)}); err != nil {
- t.Fatalf("Iter #%d: failed valid proposal attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- prop, err := oracle.ProposedVersion(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve active proposal: %v", i, err)
- }
- if len(prop.Pass) != i {
- t.Fatalf("Iter #%d: proposal vote count mismatch: have %d, want %d", i, len(prop.Pass), i)
- }
- // Nuke the release with half+1 voters
- for j := i; j <= i+(len(keys)+1)/2; j++ {
- if _, err := oracle.Nuke(bind.NewKeyedTransactor(keys[j])); err != nil {
- t.Fatalf("Iter #%d: failed valid nuke attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- prop, err = oracle.ProposedVersion(nil)
- if err != nil {
- t.Fatalf("Iter #%d: failed to retrieve active proposal: %v", i, err)
- }
- if len(prop.Pass) != 0 || len(prop.Fail) != 0 {
- t.Fatalf("Iter #%d: proposal vote count mismatch: have %d/%d pass/fail, want 0/0", i, len(prop.Pass), len(prop.Fail))
- }
- }
-}
-
-// Tests that demoting a signer will auto-nuke the currently pending release.
-func TestVersionAutoNuke(t *testing.T) {
- // Prefund a few accounts to authorize with and create the oracle
- keys := make([]*ecdsa.PrivateKey, 5)
- for i := 0; i < len(keys); i++ {
- keys[i], _ = crypto.GenerateKey()
- }
- key, oracle, sim := setupReleaseTest(t, keys...)
-
- // Authorize all the keys as valid signers
- keys = append([]*ecdsa.PrivateKey{key}, keys...)
- for i := 1; i < len(keys); i++ {
- for j := 0; j <= i/2; j++ {
- if _, err := oracle.Promote(bind.NewKeyedTransactor(keys[j]), crypto.PubkeyToAddress(keys[i].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid promotion attempt: %v", i, err)
- }
- }
- sim.Commit()
- }
- // Make a release proposal and check it's existence
- if _, err := oracle.Release(bind.NewKeyedTransactor(keys[0]), 1, 2, 3, [20]byte{4}); err != nil {
- t.Fatalf("Failed valid proposal attempt: %v", err)
- }
- sim.Commit()
-
- prop, err := oracle.ProposedVersion(nil)
- if err != nil {
- t.Fatalf("Failed to retrieve active proposal: %v", err)
- }
- if len(prop.Pass) != 1 {
- t.Fatalf("Proposal vote count mismatch: have %d, want 1", len(prop.Pass))
- }
- // Demote a signer and check release proposal deletion
- for i := 0; i <= len(keys)/2; i++ {
- if _, err := oracle.Demote(bind.NewKeyedTransactor(keys[i]), crypto.PubkeyToAddress(keys[len(keys)-1].PublicKey)); err != nil {
- t.Fatalf("Iter #%d: failed valid demotion attempt: %v", i, err)
- }
- }
- sim.Commit()
-
- prop, err = oracle.ProposedVersion(nil)
- if err != nil {
- t.Fatalf("Failed to retrieve active proposal: %v", err)
- }
- if len(prop.Pass) != 0 {
- t.Fatalf("Proposal vote count mismatch: have %d, want 0", len(prop.Pass))
- }
-}
diff --git a/contracts/release/release.go b/contracts/release/release.go
deleted file mode 100644
index 4442ce3e0d..0000000000
--- a/contracts/release/release.go
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2015 The go-ethereum Authors
-// This file is part of the go-ethereum library.
-//
-// The go-ethereum library is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The go-ethereum library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with the go-ethereum library. If not, see .
-
-// Package release contains the node service that tracks client releases.
-package release
-
-//go:generate abigen --sol ./contract.sol --pkg release --out ./contract.go
-
-import (
- "context"
- "fmt"
- "strings"
- "time"
-
- "github.com/ethereum/go-ethereum/accounts/abi/bind"
- "github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/eth"
- "github.com/ethereum/go-ethereum/internal/ethapi"
- "github.com/ethereum/go-ethereum/les"
- "github.com/ethereum/go-ethereum/log"
- "github.com/ethereum/go-ethereum/node"
- "github.com/ethereum/go-ethereum/p2p"
- "github.com/ethereum/go-ethereum/rpc"
-)
-
-// Interval to check for new releases
-const releaseRecheckInterval = time.Hour
-
-// Config contains the configurations of the release service.
-type Config struct {
- Oracle common.Address // Ethereum address of the release oracle
- Major uint32 // Major version component of the release
- Minor uint32 // Minor version component of the release
- Patch uint32 // Patch version component of the release
- Commit [20]byte // Git SHA1 commit hash of the release
-}
-
-// ReleaseService is a node service that periodically checks the blockchain for
-// newly released versions of the client being run and issues a warning to the
-// user about it.
-type ReleaseService struct {
- config Config // Current version to check releases against
- oracle *ReleaseOracle // Native binding to the release oracle contract
- quit chan chan error // Quit channel to terminate the version checker
-}
-
-// NewReleaseService creates a new service to periodically check for new client
-// releases and notify the user of such.
-func NewReleaseService(ctx *node.ServiceContext, config Config) (node.Service, error) {
- // Retrieve the Ethereum service dependency to access the blockchain
- var apiBackend ethapi.Backend
- var ethereum *eth.Ethereum
- if err := ctx.Service(ðereum); err == nil {
- apiBackend = ethereum.ApiBackend
- } else {
- var ethereum *les.LightEthereum
- if err := ctx.Service(ðereum); err == nil {
- apiBackend = ethereum.ApiBackend
- } else {
- return nil, err
- }
- }
- // Construct the release service
- contract, err := NewReleaseOracle(config.Oracle, eth.NewContractBackend(apiBackend))
- if err != nil {
- return nil, err
- }
- return &ReleaseService{
- config: config,
- oracle: contract,
- quit: make(chan chan error),
- }, nil
-}
-
-// Protocols returns an empty list of P2P protocols as the release service does
-// not have a networking component.
-func (r *ReleaseService) Protocols() []p2p.Protocol { return nil }
-
-// APIs returns an empty list of RPC descriptors as the release service does not
-// expose any functioanlity to the outside world.
-func (r *ReleaseService) APIs() []rpc.API { return nil }
-
-// Start spawns the periodic version checker goroutine
-func (r *ReleaseService) Start(server *p2p.Server) error {
- go r.checker()
- return nil
-}
-
-// Stop terminates all goroutines belonging to the service, blocking until they
-// are all terminated.
-func (r *ReleaseService) Stop() error {
- errc := make(chan error)
- r.quit <- errc
- return <-errc
-}
-
-// checker runs indefinitely in the background, periodically checking for new
-// client releases.
-func (r *ReleaseService) checker() {
- // Set up the timers to periodically check for releases
- timer := time.NewTimer(0) // Immediately fire a version check
- defer timer.Stop()
-
- for {
- select {
- case <-timer.C:
- // Rechedule the timer before continuing
- timer.Reset(releaseRecheckInterval)
- r.checkVersion()
- case errc := <-r.quit:
- errc <- nil
- return
- }
- }
-}
-
-func (r *ReleaseService) checkVersion() {
- // Retrieve the current version, and handle missing contracts gracefully
- ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
- opts := &bind.CallOpts{Context: ctx}
- defer cancel()
-
- version, err := r.oracle.CurrentVersion(opts)
- if err != nil {
- if err == bind.ErrNoCode {
- log.Debug("Release oracle not found", "contract", r.config.Oracle)
- } else if err != les.ErrNoPeers {
- log.Error("Failed to retrieve current release", "err", err)
- }
- return
- }
- // Version was successfully retrieved, notify if newer than ours
- if version.Major > r.config.Major ||
- (version.Major == r.config.Major && version.Minor > r.config.Minor) ||
- (version.Major == r.config.Major && version.Minor == r.config.Minor && version.Patch > r.config.Patch) {
-
- warning := fmt.Sprintf("Client v%d.%d.%d-%x seems older than the latest upstream release v%d.%d.%d-%x",
- r.config.Major, r.config.Minor, r.config.Patch, r.config.Commit[:4], version.Major, version.Minor, version.Patch, version.Commit[:4])
- howtofix := fmt.Sprintf("Please check https://github.com/ethereum/go-ethereum/releases for new releases")
- separator := strings.Repeat("-", len(warning))
-
- log.Warn(separator)
- log.Warn(warning)
- log.Warn(howtofix)
- log.Warn(separator)
- } else {
- log.Debug("Client seems up to date with upstream",
- "local", fmt.Sprintf("v%d.%d.%d-%x", r.config.Major, r.config.Minor, r.config.Patch, r.config.Commit[:4]),
- "upstream", fmt.Sprintf("v%d.%d.%d-%x", version.Major, version.Minor, version.Patch, version.Commit[:4]))
- }
-}
diff --git a/core/blockchain.go b/core/blockchain.go
index 737fbe3eee..f886ffe4ed 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -465,7 +465,7 @@ func (bc *BlockChain) insert(block *types.Block) {
}
bc.currentBlock = block
- // If the block is better than out head or is on a different chain, force update heads
+ // If the block is better than our head or is on a different chain, force update heads
if updateHeads {
bc.hc.SetCurrentHeader(block.Header())
@@ -1140,18 +1140,17 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
} else {
log.Error("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "newnum", newBlock.Number(), "newhash", newBlock.Hash())
}
+ // Insert the new chain, taking care of the proper incremental order
var addedTxs types.Transactions
- // insert blocks. Order does not matter. Last block will be written in ImportChain itself which creates the new head properly
- for _, block := range newChain {
+ for i := len(newChain) - 1; i >= 0; i-- {
// insert the block in the canonical way, re-writing history
- bc.insert(block)
+ bc.insert(newChain[i])
// write lookup entries for hash based transaction/receipt searches
- if err := WriteTxLookupEntries(bc.chainDb, block); err != nil {
+ if err := WriteTxLookupEntries(bc.chainDb, newChain[i]); err != nil {
return err
}
- addedTxs = append(addedTxs, block.Transactions()...)
+ addedTxs = append(addedTxs, newChain[i].Transactions()...)
}
-
// calculate the difference between deleted and added transactions
diff := types.TxDifference(deletedTxs, addedTxs)
// When transactions get deleted from the database that means the
diff --git a/core/blockchain_test.go b/core/blockchain_test.go
index 26c816027f..cbde3bcd2d 100644
--- a/core/blockchain_test.go
+++ b/core/blockchain_test.go
@@ -1197,3 +1197,51 @@ func TestEIP161AccountRemoval(t *testing.T) {
t.Error("account should not exist")
}
}
+
+// This is a regression test (i.e. as weird as it is, don't delete it ever), which
+// tests that under weird reorg conditions the blockchain and its internal header-
+// chain return the same latest block/header.
+//
+// https://github.com/ethereum/go-ethereum/pull/15941
+func TestBlockchainHeaderchainReorgConsistency(t *testing.T) {
+ // Generate a canonical chain to act as the main dataset
+ engine := ethash.NewFaker()
+
+ db, _ := ethdb.NewMemDatabase()
+ genesis := new(Genesis).MustCommit(db)
+ blocks, _ := GenerateChain(params.TestChainConfig, genesis, engine, db, 64, func(i int, b *BlockGen) { b.SetCoinbase(common.Address{1}) })
+
+ // Generate a bunch of fork blocks, each side forking from the canonical chain
+ forks := make([]*types.Block, len(blocks))
+ for i := 0; i < len(forks); i++ {
+ parent := genesis
+ if i > 0 {
+ parent = blocks[i-1]
+ }
+ fork, _ := GenerateChain(params.TestChainConfig, parent, engine, db, 1, func(i int, b *BlockGen) { b.SetCoinbase(common.Address{2}) })
+ forks[i] = fork[0]
+ }
+ // Import the canonical and fork chain side by side, verifying the current block
+ // and current header consistency
+ diskdb, _ := ethdb.NewMemDatabase()
+ new(Genesis).MustCommit(diskdb)
+
+ chain, err := NewBlockChain(diskdb, params.TestChainConfig, engine, vm.Config{})
+ if err != nil {
+ t.Fatalf("failed to create tester chain: %v", err)
+ }
+ for i := 0; i < len(blocks); i++ {
+ if _, err := chain.InsertChain(blocks[i : i+1]); err != nil {
+ t.Fatalf("block %d: failed to insert into chain: %v", i, err)
+ }
+ if chain.CurrentBlock().Hash() != chain.CurrentHeader().Hash() {
+ t.Errorf("block %d: current block/header mismatch: block #%d [%x…], header #%d [%x…]", i, chain.CurrentBlock().Number(), chain.CurrentBlock().Hash().Bytes()[:4], chain.CurrentHeader().Number, chain.CurrentHeader().Hash().Bytes()[:4])
+ }
+ if _, err := chain.InsertChain(forks[i : i+1]); err != nil {
+ t.Fatalf(" fork %d: failed to insert into chain: %v", i, err)
+ }
+ if chain.CurrentBlock().Hash() != chain.CurrentHeader().Hash() {
+ t.Errorf(" fork %d: current block/header mismatch: block #%d [%x…], header #%d [%x…]", i, chain.CurrentBlock().Number(), chain.CurrentBlock().Hash().Bytes()[:4], chain.CurrentHeader().Number, chain.CurrentHeader().Hash().Bytes()[:4])
+ }
+ }
+}
diff --git a/core/gaspool.go b/core/gaspool.go
index c3ee5c198f..e3795c1ee9 100644
--- a/core/gaspool.go
+++ b/core/gaspool.go
@@ -44,6 +44,11 @@ func (gp *GasPool) SubGas(amount uint64) error {
return nil
}
+// Gas returns the amount of gas remaining in the pool.
+func (gp *GasPool) Gas() uint64 {
+ return uint64(*gp)
+}
+
func (gp *GasPool) String() string {
return fmt.Sprintf("%d", *gp)
}
diff --git a/core/vm/evm.go b/core/vm/evm.go
index 8796a633ec..46e7baff4c 100644
--- a/core/vm/evm.go
+++ b/core/vm/evm.go
@@ -391,7 +391,7 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
return ret, contractAddr, contract.Gas, err
}
-// ChainConfig returns the evmironment's chain configuration
+// ChainConfig returns the environment's chain configuration
func (evm *EVM) ChainConfig() *params.ChainConfig { return evm.chainConfig }
// Interpreter returns the EVM interpreter
diff --git a/dashboard/README.md b/dashboard/README.md
index da28f5a192..e010095ab2 100644
--- a/dashboard/README.md
+++ b/dashboard/README.md
@@ -20,7 +20,7 @@ Normally the dashboard assets are bundled into Geth via `go-bindata` to avoid ex
```
$ (cd dashboard/assets && ./node_modules/.bin/webpack --watch)
-$ geth --dashboard --dashboard.assets=dashboard/assets/public --vmodule=dashboard=5
+$ geth --dashboard --dashboard.assets=dashboard/assets --vmodule=dashboard=5
```
To bundle up the final UI into Geth, run `go generate`:
diff --git a/dashboard/assets.go b/dashboard/assets.go
index 043a5d7286..8337cf080d 100644
--- a/dashboard/assets.go
+++ b/dashboard/assets.go
@@ -1,11 +1,12 @@
// Code generated by go-bindata. DO NOT EDIT.
// sources:
-// assets/public/bundle.js
-// assets/public/dashboard.html
+// assets/dashboard.html
+// assets/bundle.js
package dashboard
import (
+ "crypto/sha256"
"fmt"
"io/ioutil"
"os"
@@ -15,8 +16,9 @@ import (
)
type asset struct {
- bytes []byte
- info os.FileInfo
+ bytes []byte
+ info os.FileInfo
+ digest [sha256.Size]byte
}
type bindataFileInfo struct {
@@ -46,7 +48,48 @@ func (fi bindataFileInfo) Sys() interface{} {
}
//nolint:misspell
-var _publicBundleJs = []byte((((((((((`!function(modules) {
+var _dashboardHtml = []byte(`
+
+
+
+
+
+
+ Go Ethereum Dashboard
+
+
+
+
+
+
+
+
+`)
+
+func dashboardHtmlBytes() ([]byte, error) {
+ return _dashboardHtml, nil
+}
+
+func dashboardHtml() (*asset, error) {
+ bytes, err := dashboardHtmlBytes()
+ if err != nil {
+ return nil, err
+ }
+
+ info := bindataFileInfo{name: "dashboard.html", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
+ a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0xd9, 0xa6, 0xeb, 0x32, 0x49, 0x9b, 0xe5, 0x3a, 0xcb, 0x99, 0xd3, 0xb6, 0x69, 0x7f, 0xde, 0x35, 0x9d, 0x5, 0x96, 0x84, 0xc0, 0x14, 0xef, 0xbe, 0x58, 0x10, 0x5e, 0x40, 0xf2, 0x12, 0x97}}
+ return a, nil
+}
+
+//nolint:misspell
+var _bundleJs = []byte((((((((((`!function(modules) {
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) return installedModules[moduleId].exports;
var module = installedModules[moduleId] = {
@@ -73,45 +116,21 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return __webpack_require__.d(getter, "a", getter), getter;
}, __webpack_require__.o = function(object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
- }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 453);
-}([ function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _curry2(fn) {
- return function f2(a, b) {
- switch (arguments.length) {
- case 0:
- return f2;
-
- case 1:
- return Object(__WEBPACK_IMPORTED_MODULE_1__isPlaceholder__.a)(a) ? f2 : Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_b) {
- return fn(a, _b);
- });
-
- default:
- return Object(__WEBPACK_IMPORTED_MODULE_1__isPlaceholder__.a)(a) && Object(__WEBPACK_IMPORTED_MODULE_1__isPlaceholder__.a)(b) ? f2 : Object(__WEBPACK_IMPORTED_MODULE_1__isPlaceholder__.a)(a) ? Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_a) {
- return fn(_a, b);
- }) : Object(__WEBPACK_IMPORTED_MODULE_1__isPlaceholder__.a)(b) ? Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_b) {
- return fn(a, _b);
- }) : fn(a, b);
- }
- };
- }
- __webpack_exports__.a = _curry2;
- var __WEBPACK_IMPORTED_MODULE_0__curry1__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_1__isPlaceholder__ = __webpack_require__(133);
-}, function(module, exports, __webpack_require__) {
+ }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 331);
+}([ function(module, exports, __webpack_require__) {
"use strict";
(function(process) {
- "production" === process.env.NODE_ENV ? module.exports = __webpack_require__(454) : module.exports = __webpack_require__(455);
- }).call(exports, __webpack_require__(3));
+ "production" === process.env.NODE_ENV ? module.exports = __webpack_require__(332) : module.exports = __webpack_require__(333);
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
(function(process) {
if ("production" !== process.env.NODE_ENV) {
var REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, isValidElement = function(object) {
return "object" == typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
};
- module.exports = __webpack_require__(496)(isValidElement, !0);
- } else module.exports = __webpack_require__(497)();
- }).call(exports, __webpack_require__(3));
+ module.exports = __webpack_require__(374)(isValidElement, !0);
+ } else module.exports = __webpack_require__(375)();
+ }).call(exports, __webpack_require__(2));
}, function(module, exports) {
function defaultSetTimout() {
throw new Error("setTimeout has not been defined");
@@ -201,56 +220,6 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, process.umask = function() {
return 0;
};
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _curry1(fn) {
- return function f1(a) {
- return 0 === arguments.length || Object(__WEBPACK_IMPORTED_MODULE_0__isPlaceholder__.a)(a) ? f1 : fn.apply(this, arguments);
- };
- }
- __webpack_exports__.a = _curry1;
- var __WEBPACK_IMPORTED_MODULE_0__isPlaceholder__ = __webpack_require__(133);
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _curry3(fn) {
- return function f3(a, b, c) {
- switch (arguments.length) {
- case 0:
- return f3;
-
- case 1:
- return Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) ? f3 : Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_b, _c) {
- return fn(a, _b, _c);
- });
-
- case 2:
- return Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) ? f3 : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) ? Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_a, _c) {
- return fn(_a, b, _c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) ? Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_b, _c) {
- return fn(a, _b, _c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_c) {
- return fn(a, b, _c);
- });
-
- default:
- return Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(c) ? f3 : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) ? Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_a, _b) {
- return fn(_a, _b, c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(c) ? Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_a, _c) {
- return fn(_a, b, _c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) && Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(c) ? Object(__WEBPACK_IMPORTED_MODULE_1__curry2__.a)(function(_b, _c) {
- return fn(a, _b, _c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(a) ? Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_a) {
- return fn(_a, b, c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(b) ? Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_b) {
- return fn(a, _b, c);
- }) : Object(__WEBPACK_IMPORTED_MODULE_2__isPlaceholder__.a)(c) ? Object(__WEBPACK_IMPORTED_MODULE_0__curry1__.a)(function(_c) {
- return fn(a, b, _c);
- }) : fn(a, b, c);
- }
- };
- }
- __webpack_exports__.a = _curry3;
- var __WEBPACK_IMPORTED_MODULE_0__curry1__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_1__curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_2__isPlaceholder__ = __webpack_require__(133);
}, function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
!function() {
@@ -280,6 +249,11 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
return Array.from(arr);
}
+ function _objectWithoutProperties(obj, keys) {
+ var target = {};
+ for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (target[i] = obj[i]);
+ return target;
+ }
__webpack_require__.d(__webpack_exports__, "c", function() {
return PRESENTATION_ATTRIBUTES;
}), __webpack_require__.d(__webpack_exports__, "a", function() {
@@ -315,7 +289,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "o", function() {
return parseChildIndex;
});
- var __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1_lodash_isString__ = __webpack_require__(227), __WEBPACK_IMPORTED_MODULE_1_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isString__), __WEBPACK_IMPORTED_MODULE_2_lodash_isObject__ = __webpack_require__(47), __WEBPACK_IMPORTED_MODULE_2_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_3_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_3_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__), __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__), __WEBPACK_IMPORTED_MODULE_7__DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_8__PureRender__ = __webpack_require__(8), PRESENTATION_ATTRIBUTES = {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1_lodash_isString__ = __webpack_require__(164), __WEBPACK_IMPORTED_MODULE_1_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isString__), __WEBPACK_IMPORTED_MODULE_2_lodash_isObject__ = __webpack_require__(31), __WEBPACK_IMPORTED_MODULE_2_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_3_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_3_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__), __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__), __WEBPACK_IMPORTED_MODULE_7__DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_8__PureRender__ = __webpack_require__(5), PRESENTATION_ATTRIBUTES = {
alignmentBaseline: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
angle: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
baselineShift: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
@@ -471,7 +445,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
entry && entry.type && __WEBPACK_IMPORTED_MODULE_1_lodash_isString___default()(entry.type) && SVG_TAGS.indexOf(entry.type) >= 0 && svgElements.push(entry);
}), svgElements;
}, isSingleChildEqual = function(nextChild, prevChild) {
- return !(!__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(nextChild) || !__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(prevChild)) || !__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(nextChild) && !__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(prevChild) && Object(__WEBPACK_IMPORTED_MODULE_8__PureRender__.b)(nextChild.props, prevChild.props);
+ if (__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(nextChild) && __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(prevChild)) return !0;
+ if (!__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(nextChild) && !__WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default()(prevChild)) {
+ var _ref = nextChild.props || {}, nextChildren = _ref.children, nextProps = _objectWithoutProperties(_ref, [ "children" ]), _ref2 = prevChild.props || {}, prevChildren = _ref2.children, prevProps = _objectWithoutProperties(_ref2, [ "children" ]);
+ return nextChildren && prevChildren ? Object(__WEBPACK_IMPORTED_MODULE_8__PureRender__.b)(nextProps, prevProps) && isChildrenEqual(nextChildren, prevChildren) : !nextChildren && !prevChildren && Object(__WEBPACK_IMPORTED_MODULE_8__PureRender__.b)(nextProps, prevProps);
+ }
+ return !1;
}, isChildrenEqual = function isChildrenEqual(nextChildren, prevChildren) {
if (nextChildren === prevChildren) return !0;
if (__WEBPACK_IMPORTED_MODULE_5_react__.Children.count(nextChildren) !== __WEBPACK_IMPORTED_MODULE_5_react__.Children.count(prevChildren)) return !1;
@@ -530,7 +509,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = !0;
- var _assign = __webpack_require__(268), _assign2 = function(obj) {
+ var _assign = __webpack_require__(205), _assign2 = function(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -548,7 +527,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
- var baseGetTag = __webpack_require__(59), isObject = __webpack_require__(47), asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
+ var baseGetTag = __webpack_require__(42), isObject = __webpack_require__(31), asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
module.exports = isFunction;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -573,7 +552,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "a", function() {
return findEntryInArray;
});
- var __WEBPACK_IMPORTED_MODULE_0_lodash_get__ = __webpack_require__(152), __WEBPACK_IMPORTED_MODULE_0_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_get__), __WEBPACK_IMPORTED_MODULE_1_lodash_isArray__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_1_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__ = __webpack_require__(159), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__), __WEBPACK_IMPORTED_MODULE_3_lodash_isNumber__ = __webpack_require__(232), __WEBPACK_IMPORTED_MODULE_3_lodash_isNumber___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isNumber__), __WEBPACK_IMPORTED_MODULE_4_lodash_isString__ = __webpack_require__(227), __WEBPACK_IMPORTED_MODULE_4_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isString__), mathSign = function(value) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_get__ = __webpack_require__(165), __WEBPACK_IMPORTED_MODULE_0_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_get__), __WEBPACK_IMPORTED_MODULE_1_lodash_isArray__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_1_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__ = __webpack_require__(117), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__), __WEBPACK_IMPORTED_MODULE_3_lodash_isNumber__ = __webpack_require__(170), __WEBPACK_IMPORTED_MODULE_3_lodash_isNumber___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isNumber__), __WEBPACK_IMPORTED_MODULE_4_lodash_isString__ = __webpack_require__(164), __WEBPACK_IMPORTED_MODULE_4_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isString__), mathSign = function(value) {
return 0 === value ? 0 : value > 0 ? 1 : -1;
}, isPercent = function(value) {
return __WEBPACK_IMPORTED_MODULE_4_lodash_isString___default()(value) && value.indexOf("%") === value.length - 1;
@@ -629,42 +608,38 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
Object.defineProperty(exports, "__esModule", {
value: !0
- }), exports.sheetsManager = exports.preset = void 0;
- var _keys = __webpack_require__(51), _keys2 = _interopRequireDefault(_keys), _extends2 = __webpack_require__(10), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(38), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(39), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(40), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(41), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(42), _inherits3 = _interopRequireDefault(_inherits2), _objectWithoutProperties2 = __webpack_require__(9), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _map = __webpack_require__(519), _map2 = _interopRequireDefault(_map), _minSafeInteger = __webpack_require__(535), _minSafeInteger2 = _interopRequireDefault(_minSafeInteger), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(2), _propTypes2 = _interopRequireDefault(_propTypes), _warning = __webpack_require__(14), _warning2 = _interopRequireDefault(_warning), _hoistNonReactStatics = __webpack_require__(194), _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics), _wrapDisplayName = __webpack_require__(95), _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName), _getDisplayName = __webpack_require__(289), _getDisplayName2 = _interopRequireDefault(_getDisplayName), _contextTypes = __webpack_require__(538), _contextTypes2 = _interopRequireDefault(_contextTypes), _jss = __webpack_require__(291), _jssGlobal = __webpack_require__(561), _jssGlobal2 = _interopRequireDefault(_jssGlobal), _jssNested = __webpack_require__(562), _jssNested2 = _interopRequireDefault(_jssNested), _jssCamelCase = __webpack_require__(563), _jssCamelCase2 = _interopRequireDefault(_jssCamelCase), _jssDefaultUnit = __webpack_require__(564), _jssDefaultUnit2 = _interopRequireDefault(_jssDefaultUnit), _jssVendorPrefixer = __webpack_require__(566), _jssVendorPrefixer2 = _interopRequireDefault(_jssVendorPrefixer), _jssPropsSort = __webpack_require__(571), _jssPropsSort2 = _interopRequireDefault(_jssPropsSort), _ns = __webpack_require__(290), ns = function(obj) {
+ }), exports.sheetsManager = void 0;
+ var _keys = __webpack_require__(41), _keys2 = _interopRequireDefault(_keys), _extends2 = __webpack_require__(7), _extends3 = _interopRequireDefault(_extends2), _getPrototypeOf = __webpack_require__(26), _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf), _classCallCheck2 = __webpack_require__(27), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _createClass2 = __webpack_require__(28), _createClass3 = _interopRequireDefault(_createClass2), _possibleConstructorReturn2 = __webpack_require__(29), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(30), _inherits3 = _interopRequireDefault(_inherits2), _objectWithoutProperties2 = __webpack_require__(6), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _map = __webpack_require__(397), _map2 = _interopRequireDefault(_map), _minSafeInteger = __webpack_require__(413), _minSafeInteger2 = _interopRequireDefault(_minSafeInteger), _react = __webpack_require__(0), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(1), _propTypes2 = _interopRequireDefault(_propTypes), _warning = __webpack_require__(11), _warning2 = _interopRequireDefault(_warning), _hoistNonReactStatics = __webpack_require__(152), _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics), _getDisplayName = __webpack_require__(226), _getDisplayName2 = _interopRequireDefault(_getDisplayName), _wrapDisplayName = __webpack_require__(75), _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName), _contextTypes = __webpack_require__(416), _contextTypes2 = _interopRequireDefault(_contextTypes), _jss = __webpack_require__(228), _ns = __webpack_require__(227), ns = function(obj) {
if (obj && obj.__esModule) return obj;
var newObj = {};
if (null != obj) for (var key in obj) Object.prototype.hasOwnProperty.call(obj, key) && (newObj[key] = obj[key]);
return newObj.default = obj, newObj;
- }(_ns), _createMuiTheme = __webpack_require__(193), _createMuiTheme2 = _interopRequireDefault(_createMuiTheme), _themeListener = __webpack_require__(192), _themeListener2 = _interopRequireDefault(_themeListener), _createGenerateClassName = __webpack_require__(572), _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName), _getStylesCreator = __webpack_require__(573), _getStylesCreator2 = _interopRequireDefault(_getStylesCreator), preset = exports.preset = function() {
- return {
- plugins: [ (0, _jssGlobal2.default)(), (0, _jssNested2.default)(), (0, _jssCamelCase2.default)(), (0,
- _jssDefaultUnit2.default)(), (0, _jssVendorPrefixer2.default)(), (0, _jssPropsSort2.default)() ]
- };
- }, jss = (0, _jss.create)(preset()), generateClassName = (0, _createGenerateClassName2.default)(), indexCounter = _minSafeInteger2.default, sheetsManager = exports.sheetsManager = new _map2.default(), noopTheme = {}, defaultTheme = void 0, withStyles = function(stylesOrCreator) {
+ }(_ns), _jssPreset = __webpack_require__(439), _jssPreset2 = _interopRequireDefault(_jssPreset), _createMuiTheme = __webpack_require__(151), _createMuiTheme2 = _interopRequireDefault(_createMuiTheme), _themeListener = __webpack_require__(150), _themeListener2 = _interopRequireDefault(_themeListener), _createGenerateClassName = __webpack_require__(451), _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName), _getStylesCreator = __webpack_require__(452), _getStylesCreator2 = _interopRequireDefault(_getStylesCreator), jss = (0,
+ _jss.create)((0, _jssPreset2.default)()), generateClassName = (0, _createGenerateClassName2.default)(), indexCounter = _minSafeInteger2.default, sheetsManager = exports.sheetsManager = new _map2.default(), noopTheme = {}, defaultTheme = void 0, withStyles = function(stylesOrCreator) {
var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return function(Component) {
- var _options$withTheme = options.withTheme, withTheme = void 0 !== _options$withTheme && _options$withTheme, flip = options.flip, name = options.name, styleSheetOptions = (0,
+ var _options$withTheme = options.withTheme, withTheme = void 0 !== _options$withTheme && _options$withTheme, _options$flip = options.flip, flip = void 0 === _options$flip ? null : _options$flip, name = options.name, styleSheetOptions = (0,
_objectWithoutProperties3.default)(options, [ "withTheme", "flip", "name" ]), stylesCreator = (0,
_getStylesCreator2.default)(stylesOrCreator), listenToTheme = stylesCreator.themingEnabled || withTheme || "string" == typeof name;
- void 0 === stylesCreator.options.index && (indexCounter += 1, stylesCreator.options.index = indexCounter),
- "production" !== process.env.NODE_ENV && (0, _warning2.default)(indexCounter < 0, [ "Material-UI: you might have a memory leak.", "The indexCounter is not supposed to grow that much." ].join(" "));
- var Style = function(_React$Component) {
- function Style(props, context) {
- (0, _classCallCheck3.default)(this, Style);
- var _this = (0, _possibleConstructorReturn3.default)(this, (Style.__proto__ || (0,
- _getPrototypeOf2.default)(Style)).call(this, props, context));
- _this.state = {}, _this.unsubscribeId = null, _this.jss = null, _this.sheetsManager = sheetsManager,
- _this.disableStylesGeneration = !1, _this.stylesCreatorSaved = null, _this.theme = null,
- _this.sheetOptions = null, _this.theme = null;
+ indexCounter += 1, stylesCreator.options.index = indexCounter, "production" !== process.env.NODE_ENV && (0,
+ _warning2.default)(indexCounter < 0, [ "Material-UI: you might have a memory leak.", "The indexCounter is not supposed to grow that much." ].join(" "));
+ var WithStyles = function(_React$Component) {
+ function WithStyles(props, context) {
+ (0, _classCallCheck3.default)(this, WithStyles);
+ var _this = (0, _possibleConstructorReturn3.default)(this, (WithStyles.__proto__ || (0,
+ _getPrototypeOf2.default)(WithStyles)).call(this, props, context));
+ _this.state = {}, _this.disableStylesGeneration = !1, _this.jss = null, _this.sheetOptions = null,
+ _this.sheetsManager = sheetsManager, _this.stylesCreatorSaved = null, _this.theme = null,
+ _this.unsubscribeId = null, _this.jss = _this.context[ns.jss] || jss;
var muiThemeProviderOptions = _this.context.muiThemeProviderOptions;
- return _this.jss = _this.context[ns.jss] || jss, muiThemeProviderOptions && (muiThemeProviderOptions.sheetsManager && (_this.sheetsManager = muiThemeProviderOptions.sheetsManager),
+ return muiThemeProviderOptions && (muiThemeProviderOptions.sheetsManager && (_this.sheetsManager = muiThemeProviderOptions.sheetsManager),
_this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration),
_this.stylesCreatorSaved = stylesCreator, _this.sheetOptions = (0, _extends3.default)({
generateClassName: generateClassName
}, _this.context[ns.sheetOptions]), _this.theme = listenToTheme ? _themeListener2.default.initial(context) || getDefaultTheme() : noopTheme,
_this;
}
- return (0, _inherits3.default)(Style, _React$Component), (0, _createClass3.default)(Style, [ {
+ return (0, _inherits3.default)(WithStyles, _React$Component), (0, _createClass3.default)(WithStyles, [ {
key: "componentWillMount",
value: function() {
this.attach(this.theme);
@@ -702,10 +677,11 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
refs: 0,
sheet: null
}, sheetManager.set(theme, sheetManagerTheme)), 0 === sheetManagerTheme.refs) {
- var styles = stylesCreatorSaved.create(theme, name), meta = void 0;
- "production" !== process.env.NODE_ENV && (meta = name || (0, _getDisplayName2.default)(Component));
+ var styles = stylesCreatorSaved.create(theme, name), meta = name;
+ "production" === process.env.NODE_ENV || meta || (meta = (0, _getDisplayName2.default)(Component));
var sheet = this.jss.createStyleSheet(styles, (0, _extends3.default)({
meta: meta,
+ classNamePrefix: meta,
flip: "boolean" == typeof flip ? flip : "rtl" === theme.direction,
link: !1
}, this.sheetOptions, stylesCreatorSaved.options, {
@@ -756,21 +732,21 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
ref: innerRef
}));
}
- } ]), Style;
+ } ]), WithStyles;
}(_react2.default.Component);
- return Style.propTypes = "production" !== process.env.NODE_ENV ? {
+ return WithStyles.propTypes = "production" !== process.env.NODE_ENV ? {
classes: _propTypes2.default.object,
innerRef: _propTypes2.default.func
- } : {}, Style.contextTypes = (0, _extends3.default)({
+ } : {}, WithStyles.contextTypes = (0, _extends3.default)({
muiThemeProviderOptions: _propTypes2.default.object
}, _contextTypes2.default, listenToTheme ? _themeListener2.default.contextTypes : {}),
- "production" !== process.env.NODE_ENV && (Style.displayName = (0, _wrapDisplayName2.default)(Component, "withStyles")),
- (0, _hoistNonReactStatics2.default)(Style, Component), "production" !== process.env.NODE_ENV && (Style.Naked = Component,
- Style.options = options), Style;
+ "production" !== process.env.NODE_ENV && (WithStyles.displayName = (0, _wrapDisplayName2.default)(Component, "WithStyles")),
+ (0, _hoistNonReactStatics2.default)(WithStyles, Component), "production" !== process.env.NODE_ENV && (WithStyles.Naked = Component,
+ WithStyles.options = options), WithStyles;
};
};
exports.default = withStyles;
- }).call(exports, __webpack_require__(3));
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
"use strict";
(function(process) {
@@ -791,34 +767,14 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
} catch (x) {}
}
}), module.exports = warning;
- }).call(exports, __webpack_require__(3));
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _dispatchable(methodNames, xf, fn) {
- return function() {
- if (0 === arguments.length) return fn();
- var args = Array.prototype.slice.call(arguments, 0), obj = args.pop();
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArray__.a)(obj)) {
- for (var idx = 0; idx < methodNames.length; ) {
- if ("function" == typeof obj[methodNames[idx]]) return obj[methodNames[idx]].apply(obj, args);
- idx += 1;
- }
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isTransformer__.a)(obj)) {
- return xf.apply(null, args)(obj);
- }
- }
- return fn.apply(this, arguments);
- };
- }
- __webpack_exports__.a = _dispatchable;
- var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(57), __WEBPACK_IMPORTED_MODULE_1__isTransformer__ = __webpack_require__(200);
+ }).call(exports, __webpack_require__(2));
}, function(module, exports) {
var isArray = Array.isArray;
module.exports = isArray;
}, function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = !0;
- var _defineProperty = __webpack_require__(185), _defineProperty2 = function(obj) {
+ var _defineProperty = __webpack_require__(143), _defineProperty2 = function(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -844,7 +800,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
className: layerClass
}, others), children);
}
- var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -855,18 +811,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node ])
};
Layer.propTypes = propTypes, __webpack_exports__.a = Layer;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_exports__.a = {
- init: function() {
- return this.xf["@@transducer/init"]();
- },
- result: function(result) {
- return this.xf["@@transducer/result"](result);
- }
- };
}, function(module, exports, __webpack_require__) {
- var global = __webpack_require__(221), core = __webpack_require__(222), hide = __webpack_require__(363), redefine = __webpack_require__(839), ctx = __webpack_require__(842), $export = function(type, name, source) {
+ var global = __webpack_require__(158), core = __webpack_require__(159), hide = __webpack_require__(244), redefine = __webpack_require__(534), ctx = __webpack_require__(537), $export = function(type, name, source) {
var key, own, out, exp, IS_FORCED = type & $export.F, IS_GLOBAL = type & $export.G, IS_STATIC = type & $export.S, IS_PROTO = type & $export.P, IS_BIND = type & $export.B, target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {}).prototype, exports = IS_GLOBAL ? core : core[name] || (core[name] = {}), expProto = exports.prototype || (exports.prototype = {});
IS_GLOBAL && (source = name);
for (key in source) own = !IS_FORCED && target && void 0 !== target[key], out = (own ? target : source)[key],
@@ -954,8 +900,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "y", function() {
return parseDomainOfCategoryAxis;
});
- var __WEBPACK_IMPORTED_MODULE_0_lodash_isEqual__ = __webpack_require__(49), __WEBPACK_IMPORTED_MODULE_0_lodash_isEqual___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isEqual__), __WEBPACK_IMPORTED_MODULE_1_lodash_sortBy__ = __webpack_require__(402), __WEBPACK_IMPORTED_MODULE_1_lodash_sortBy___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_sortBy__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__ = __webpack_require__(159), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__), __WEBPACK_IMPORTED_MODULE_3_lodash_isString__ = __webpack_require__(227), __WEBPACK_IMPORTED_MODULE_3_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isString__), __WEBPACK_IMPORTED_MODULE_4_lodash_max__ = __webpack_require__(1010), __WEBPACK_IMPORTED_MODULE_4_lodash_max___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_max__), __WEBPACK_IMPORTED_MODULE_5_lodash_min__ = __webpack_require__(405), __WEBPACK_IMPORTED_MODULE_5_lodash_min___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_min__), __WEBPACK_IMPORTED_MODULE_6_lodash_isArray__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_6_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_7_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_7_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_8_lodash_get__ = __webpack_require__(152), __WEBPACK_IMPORTED_MODULE_8_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_get__), __WEBPACK_IMPORTED_MODULE_9_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_9_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_10_recharts_scale__ = __webpack_require__(1011), __WEBPACK_IMPORTED_MODULE_11_d3_scale__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_recharts_scale__),
- __webpack_require__(408)), __WEBPACK_IMPORTED_MODULE_12_d3_shape__ = __webpack_require__(235), __WEBPACK_IMPORTED_MODULE_13__DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_14__cartesian_ReferenceDot__ = __webpack_require__(441), __WEBPACK_IMPORTED_MODULE_15__cartesian_ReferenceLine__ = __webpack_require__(442), __WEBPACK_IMPORTED_MODULE_16__cartesian_ReferenceArea__ = __webpack_require__(443), __WEBPACK_IMPORTED_MODULE_17__cartesian_ErrorBar__ = __webpack_require__(117), __WEBPACK_IMPORTED_MODULE_18__component_Legend__ = __webpack_require__(233), __WEBPACK_IMPORTED_MODULE_19__ReactUtils__ = __webpack_require__(7), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_isEqual__ = __webpack_require__(34), __WEBPACK_IMPORTED_MODULE_0_lodash_isEqual___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isEqual__), __WEBPACK_IMPORTED_MODULE_1_lodash_sortBy__ = __webpack_require__(281), __WEBPACK_IMPORTED_MODULE_1_lodash_sortBy___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_sortBy__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__ = __webpack_require__(117), __WEBPACK_IMPORTED_MODULE_2_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNaN__), __WEBPACK_IMPORTED_MODULE_3_lodash_isString__ = __webpack_require__(164), __WEBPACK_IMPORTED_MODULE_3_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isString__), __WEBPACK_IMPORTED_MODULE_4_lodash_max__ = __webpack_require__(702), __WEBPACK_IMPORTED_MODULE_4_lodash_max___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_max__), __WEBPACK_IMPORTED_MODULE_5_lodash_min__ = __webpack_require__(284), __WEBPACK_IMPORTED_MODULE_5_lodash_min___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_min__), __WEBPACK_IMPORTED_MODULE_6_lodash_isArray__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_6_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_7_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_7_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_8_lodash_get__ = __webpack_require__(165), __WEBPACK_IMPORTED_MODULE_8_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_get__), __WEBPACK_IMPORTED_MODULE_9_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_9_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_10_recharts_scale__ = __webpack_require__(703), __WEBPACK_IMPORTED_MODULE_11_d3_scale__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_recharts_scale__),
+ __webpack_require__(287)), __WEBPACK_IMPORTED_MODULE_12_d3_shape__ = __webpack_require__(173), __WEBPACK_IMPORTED_MODULE_13__DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_14__cartesian_ReferenceDot__ = __webpack_require__(320), __WEBPACK_IMPORTED_MODULE_15__cartesian_ReferenceLine__ = __webpack_require__(321), __WEBPACK_IMPORTED_MODULE_16__cartesian_ReferenceArea__ = __webpack_require__(322), __WEBPACK_IMPORTED_MODULE_17__cartesian_ErrorBar__ = __webpack_require__(91), __WEBPACK_IMPORTED_MODULE_18__component_Legend__ = __webpack_require__(171), __WEBPACK_IMPORTED_MODULE_19__ReactUtils__ = __webpack_require__(4), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -1450,12 +1396,6 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
version: "2.5.3"
};
"number" == typeof __e && (__e = core);
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_arity__ = __webpack_require__(43), __WEBPACK_IMPORTED_MODULE_1__internal_curry1__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_2__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_3__internal_curryN__ = __webpack_require__(135), curryN = Object(__WEBPACK_IMPORTED_MODULE_2__internal_curry2__.a)(function(length, fn) {
- return 1 === length ? Object(__WEBPACK_IMPORTED_MODULE_1__internal_curry1__.a)(fn) : Object(__WEBPACK_IMPORTED_MODULE_0__internal_arity__.a)(length, Object(__WEBPACK_IMPORTED_MODULE_3__internal_curryN__.a)(length, [], fn));
- });
- __webpack_exports__.a = curryN;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function newInterval(floori, offseti, count, field) {
@@ -1496,7 +1436,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
__webpack_exports__.a = newInterval;
var t0 = new Date(), t1 = new Date();
}, function(module, exports, __webpack_require__) {
- var global = __webpack_require__(36), core = __webpack_require__(22), ctx = __webpack_require__(64), hide = __webpack_require__(56), $export = function(type, name, source) {
+ var global = __webpack_require__(24), core = __webpack_require__(17), ctx = __webpack_require__(47), hide = __webpack_require__(40), $export = function(type, name, source) {
var key, own, out, IS_FORCED = type & $export.F, IS_GLOBAL = type & $export.G, IS_STATIC = type & $export.S, IS_PROTO = type & $export.P, IS_BIND = type & $export.B, IS_WRAP = type & $export.W, exports = IS_GLOBAL ? core : core[name] || (core[name] = {}), expProto = exports.prototype, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {}).prototype;
IS_GLOBAL && (source = name);
for (key in source) (own = !IS_FORCED && target && void 0 !== target[key]) && key in exports || (out = own ? target[key] : source[key],
@@ -1523,108 +1463,25 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
$export.F = 1, $export.G = 2, $export.S = 4, $export.P = 8, $export.B = 16, $export.W = 32,
$export.U = 64, $export.R = 128, module.exports = $export;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _has(prop, obj) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- __webpack_exports__.a = _has;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__internal_dispatchable__ = __webpack_require__(15), __WEBPACK_IMPORTED_MODULE_2__internal_map__ = __webpack_require__(136), __WEBPACK_IMPORTED_MODULE_3__internal_reduce__ = __webpack_require__(30), __WEBPACK_IMPORTED_MODULE_4__internal_xmap__ = __webpack_require__(582), __WEBPACK_IMPORTED_MODULE_5__curryN__ = __webpack_require__(23), __WEBPACK_IMPORTED_MODULE_6__keys__ = __webpack_require__(44), map = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(Object(__WEBPACK_IMPORTED_MODULE_1__internal_dispatchable__.a)([ "fantasy-land/map", "map" ], __WEBPACK_IMPORTED_MODULE_4__internal_xmap__.a, function(fn, functor) {
- switch (Object.prototype.toString.call(functor)) {
- case "[object Function]":
- return Object(__WEBPACK_IMPORTED_MODULE_5__curryN__.a)(functor.length, function() {
- return fn.call(this, functor.apply(this, arguments));
- });
-
- case "[object Object]":
- return Object(__WEBPACK_IMPORTED_MODULE_3__internal_reduce__.a)(function(acc, key) {
- return acc[key] = fn(functor[key]), acc;
- }, {}, Object(__WEBPACK_IMPORTED_MODULE_6__keys__.a)(functor));
-
- default:
- return Object(__WEBPACK_IMPORTED_MODULE_2__internal_map__.a)(fn, functor);
- }
- }));
- __webpack_exports__.a = map;
}, function(module, exports) {
function isNil(value) {
return null == value;
}
module.exports = isNil;
}, function(module, exports, __webpack_require__) {
- var store = __webpack_require__(182)("wks"), uid = __webpack_require__(124), Symbol = __webpack_require__(36).Symbol, USE_SYMBOL = "function" == typeof Symbol;
+ var store = __webpack_require__(140)("wks"), uid = __webpack_require__(98), Symbol = __webpack_require__(24).Symbol, USE_SYMBOL = "function" == typeof Symbol;
(module.exports = function(name) {
return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)("Symbol." + name));
}).store = store;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _arrayReduce(xf, acc, list) {
- for (var idx = 0, len = list.length; idx < len; ) {
- if ((acc = xf["@@transducer/step"](acc, list[idx])) && acc["@@transducer/reduced"]) {
- acc = acc["@@transducer/value"];
- break;
- }
- idx += 1;
- }
- return xf["@@transducer/result"](acc);
- }
- function _iterableReduce(xf, acc, iter) {
- for (var step = iter.next(); !step.done; ) {
- if ((acc = xf["@@transducer/step"](acc, step.value)) && acc["@@transducer/reduced"]) {
- acc = acc["@@transducer/value"];
- break;
- }
- step = iter.next();
- }
- return xf["@@transducer/result"](acc);
- }
- function _methodReduce(xf, acc, obj, methodName) {
- return xf["@@transducer/result"](obj[methodName](Object(__WEBPACK_IMPORTED_MODULE_2__bind__.a)(xf["@@transducer/step"], xf), acc));
- }
- function _reduce(fn, acc, list) {
- if ("function" == typeof fn && (fn = Object(__WEBPACK_IMPORTED_MODULE_1__xwrap__.a)(fn)),
- Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike__.a)(list)) return _arrayReduce(fn, acc, list);
- if ("function" == typeof list["fantasy-land/reduce"]) return _methodReduce(fn, acc, list, "fantasy-land/reduce");
- if (null != list[symIterator]) return _iterableReduce(fn, acc, list[symIterator]());
- if ("function" == typeof list.next) return _iterableReduce(fn, acc, list);
- if ("function" == typeof list.reduce) return _methodReduce(fn, acc, list, "reduce");
- throw new TypeError("reduce: list must be array or iterable");
- }
- __webpack_exports__.a = _reduce;
- var __WEBPACK_IMPORTED_MODULE_0__isArrayLike__ = __webpack_require__(137), __WEBPACK_IMPORTED_MODULE_1__xwrap__ = __webpack_require__(298), __WEBPACK_IMPORTED_MODULE_2__bind__ = __webpack_require__(299), symIterator = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator";
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__internal_equals__ = __webpack_require__(605), equals = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(a, b) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__internal_equals__.a)(a, b, [], []);
- });
- __webpack_exports__.a = equals;
}, function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(65), IE8_DOM_DEFINE = __webpack_require__(270), toPrimitive = __webpack_require__(176), dP = Object.defineProperty;
- exports.f = __webpack_require__(37) ? Object.defineProperty : function(O, P, Attributes) {
+ var anObject = __webpack_require__(48), IE8_DOM_DEFINE = __webpack_require__(207), toPrimitive = __webpack_require__(134), dP = Object.defineProperty;
+ exports.f = __webpack_require__(25) ? Object.defineProperty : function(O, P, Attributes) {
if (anObject(O), P = toPrimitive(P, !0), anObject(Attributes), IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) {}
if ("get" in Attributes || "set" in Attributes) throw TypeError("Accessors not supported!");
return "value" in Attributes && (O[P] = Attributes.value), O;
};
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _concat(set1, set2) {
- set1 = set1 || [], set2 = set2 || [];
- var idx, len1 = set1.length, len2 = set2.length, result = [];
- for (idx = 0; idx < len1; ) result[result.length] = set1[idx], idx += 1;
- for (idx = 0; idx < len2; ) result[result.length] = set2[idx], idx += 1;
- return result;
- }
- __webpack_exports__.a = _concat;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_checkForMethod__ = __webpack_require__(99), __WEBPACK_IMPORTED_MODULE_1__internal_curry3__ = __webpack_require__(5), slice = Object(__WEBPACK_IMPORTED_MODULE_1__internal_curry3__.a)(Object(__WEBPACK_IMPORTED_MODULE_0__internal_checkForMethod__.a)("slice", function(fromIndex, toIndex, list) {
- return Array.prototype.slice.call(list, fromIndex, toIndex);
- }));
- __webpack_exports__.a = slice;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function _defineProperty(obj, key, value) {
@@ -1646,7 +1503,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "d", function() {
return inRangeOfSector;
});
- var __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1__DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_2__ChartUtils__ = __webpack_require__(21), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1__DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_2__ChartUtils__ = __webpack_require__(16), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -1747,7 +1604,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var global = module.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = global);
}, function(module, exports, __webpack_require__) {
- module.exports = !__webpack_require__(66)(function() {
+ module.exports = !__webpack_require__(49)(function() {
return 7 != Object.defineProperty({}, "a", {
get: function() {
return 7;
@@ -1756,7 +1613,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
});
}, function(module, exports, __webpack_require__) {
module.exports = {
- default: __webpack_require__(472),
+ default: __webpack_require__(350),
__esModule: !0
};
}, function(module, exports, __webpack_require__) {
@@ -1767,7 +1624,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = !0;
- var _defineProperty = __webpack_require__(185), _defineProperty2 = function(obj) {
+ var _defineProperty = __webpack_require__(143), _defineProperty2 = function(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -1788,7 +1645,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = !0;
- var _typeof2 = __webpack_require__(126), _typeof3 = function(obj) {
+ var _typeof2 = __webpack_require__(100), _typeof3 = function(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -1805,7 +1662,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
}
exports.__esModule = !0;
- var _setPrototypeOf = __webpack_require__(489), _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf), _create = __webpack_require__(493), _create2 = _interopRequireDefault(_create), _typeof2 = __webpack_require__(126), _typeof3 = _interopRequireDefault(_typeof2);
+ var _setPrototypeOf = __webpack_require__(367), _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf), _create = __webpack_require__(371), _create2 = _interopRequireDefault(_create), _typeof2 = __webpack_require__(100), _typeof3 = _interopRequireDefault(_typeof2);
exports.default = function(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + (void 0 === superClass ? "undefined" : (0,
_typeof3.default)(superClass)));
@@ -1818,107 +1675,15 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (_setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass);
};
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _arity(n, fn) {
- switch (n) {
- case 0:
- return function() {
- return fn.apply(this, arguments);
- };
-
- case 1:
- return function(a0) {
- return fn.apply(this, arguments);
- };
-
- case 2:
- return function(a0, a1) {
- return fn.apply(this, arguments);
- };
-
- case 3:
- return function(a0, a1, a2) {
- return fn.apply(this, arguments);
- };
-
- case 4:
- return function(a0, a1, a2, a3) {
- return fn.apply(this, arguments);
- };
-
- case 5:
- return function(a0, a1, a2, a3, a4) {
- return fn.apply(this, arguments);
- };
-
- case 6:
- return function(a0, a1, a2, a3, a4, a5) {
- return fn.apply(this, arguments);
- };
-
- case 7:
- return function(a0, a1, a2, a3, a4, a5, a6) {
- return fn.apply(this, arguments);
- };
-
- case 8:
- return function(a0, a1, a2, a3, a4, a5, a6, a7) {
- return fn.apply(this, arguments);
- };
-
- case 9:
- return function(a0, a1, a2, a3, a4, a5, a6, a7, a8) {
- return fn.apply(this, arguments);
- };
-
- case 10:
- return function(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
- return fn.apply(this, arguments);
- };
-
- default:
- throw new Error("First argument to _arity must be a non-negative integer no greater than ten");
- }
- }
- __webpack_exports__.a = _arity;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry1__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_1__internal_has__ = __webpack_require__(26), __WEBPACK_IMPORTED_MODULE_2__internal_isArguments__ = __webpack_require__(300), hasEnumBug = !{
- toString: null
- }.propertyIsEnumerable("toString"), nonEnumerableProps = [ "constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString" ], hasArgsEnumBug = function() {
- return arguments.propertyIsEnumerable("length");
- }(), contains = function(list, item) {
- for (var idx = 0; idx < list.length; ) {
- if (list[idx] === item) return !0;
- idx += 1;
- }
- return !1;
- }, _keys = "function" != typeof Object.keys || hasArgsEnumBug ? function(obj) {
- if (Object(obj) !== obj) return [];
- var prop, nIdx, ks = [], checkArgsLength = hasArgsEnumBug && Object(__WEBPACK_IMPORTED_MODULE_2__internal_isArguments__.a)(obj);
- for (prop in obj) !Object(__WEBPACK_IMPORTED_MODULE_1__internal_has__.a)(prop, obj) || checkArgsLength && "length" === prop || (ks[ks.length] = prop);
- if (hasEnumBug) for (nIdx = nonEnumerableProps.length - 1; nIdx >= 0; ) prop = nonEnumerableProps[nIdx],
- Object(__WEBPACK_IMPORTED_MODULE_1__internal_has__.a)(prop, obj) && !contains(ks, prop) && (ks[ks.length] = prop),
- nIdx -= 1;
- return ks;
- } : function(obj) {
- return Object(obj) !== obj ? [] : Object.keys(obj);
- }, keys = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry1__.a)(_keys);
- __webpack_exports__.a = keys;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry3__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_1__internal_reduce__ = __webpack_require__(30), reduce = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry3__.a)(__WEBPACK_IMPORTED_MODULE_1__internal_reduce__.a);
- __webpack_exports__.a = reduce;
-}, function(module, exports, __webpack_require__) {
- var freeGlobal = __webpack_require__(365), freeSelf = "object" == typeof self && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
- module.exports = root;
}, function(module, exports) {
function isObject(value) {
var type = typeof value;
return null != value && ("object" == type || "function" == type);
}
module.exports = isObject;
+}, function(module, exports, __webpack_require__) {
+ var freeGlobal = __webpack_require__(242), freeSelf = "object" == typeof self && self && self.Object === Object && self, root = freeGlobal || freeSelf || Function("return this")();
+ module.exports = root;
}, function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
@@ -1929,7 +1694,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.translateStyle = exports.AnimateGroup = exports.configBezier = exports.configSpring = void 0;
- var _Animate = __webpack_require__(383), _Animate2 = _interopRequireDefault(_Animate), _easing = __webpack_require__(395), _util = __webpack_require__(165), _AnimateGroup = __webpack_require__(986), _AnimateGroup2 = _interopRequireDefault(_AnimateGroup);
+ var _Animate = __webpack_require__(263), _Animate2 = _interopRequireDefault(_Animate), _easing = __webpack_require__(275), _util = __webpack_require__(123), _AnimateGroup = __webpack_require__(679), _AnimateGroup2 = _interopRequireDefault(_AnimateGroup);
exports.configSpring = _easing.configSpring, exports.configBezier = _easing.configBezier,
exports.AnimateGroup = _AnimateGroup2.default, exports.translateStyle = _util.translateStyle,
exports.default = _Animate2.default;
@@ -1937,17 +1702,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
function isEqual(value, other) {
return baseIsEqual(value, other);
}
- var baseIsEqual = __webpack_require__(240);
+ var baseIsEqual = __webpack_require__(178);
module.exports = isEqual;
}, function(module, exports) {
module.exports = function(it) {
return "object" == typeof it ? null !== it : "function" == typeof it;
};
-}, function(module, exports, __webpack_require__) {
- module.exports = {
- default: __webpack_require__(500),
- __esModule: !0
- };
}, function(module, exports) {
function isObjectLike(value) {
return null != value && "object" == typeof value;
@@ -1955,32 +1715,32 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
module.exports = isObjectLike;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
- var __WEBPACK_IMPORTED_MODULE_0__src_bisect__ = __webpack_require__(409);
+ var __WEBPACK_IMPORTED_MODULE_0__src_bisect__ = __webpack_require__(288);
__webpack_require__.d(__webpack_exports__, "b", function() {
return __WEBPACK_IMPORTED_MODULE_0__src_bisect__.a;
});
- var __WEBPACK_IMPORTED_MODULE_1__src_ascending__ = __webpack_require__(84);
+ var __WEBPACK_IMPORTED_MODULE_1__src_ascending__ = __webpack_require__(64);
__webpack_require__.d(__webpack_exports__, "a", function() {
return __WEBPACK_IMPORTED_MODULE_1__src_ascending__.a;
});
- var __WEBPACK_IMPORTED_MODULE_2__src_bisector__ = __webpack_require__(410);
+ var __WEBPACK_IMPORTED_MODULE_2__src_bisector__ = __webpack_require__(289);
__webpack_require__.d(__webpack_exports__, "c", function() {
return __WEBPACK_IMPORTED_MODULE_2__src_bisector__.a;
});
- var __WEBPACK_IMPORTED_MODULE_18__src_quantile__ = (__webpack_require__(1015), __webpack_require__(1016),
- __webpack_require__(412), __webpack_require__(414), __webpack_require__(1017), __webpack_require__(1020),
- __webpack_require__(1021), __webpack_require__(418), __webpack_require__(1022),
- __webpack_require__(1023), __webpack_require__(1024), __webpack_require__(1025),
- __webpack_require__(419), __webpack_require__(411), __webpack_require__(1026), __webpack_require__(248));
+ var __WEBPACK_IMPORTED_MODULE_18__src_quantile__ = (__webpack_require__(707), __webpack_require__(708),
+ __webpack_require__(291), __webpack_require__(293), __webpack_require__(709), __webpack_require__(712),
+ __webpack_require__(713), __webpack_require__(297), __webpack_require__(714), __webpack_require__(715),
+ __webpack_require__(716), __webpack_require__(717), __webpack_require__(298), __webpack_require__(290),
+ __webpack_require__(718), __webpack_require__(185));
__webpack_require__.d(__webpack_exports__, "d", function() {
return __WEBPACK_IMPORTED_MODULE_18__src_quantile__.a;
});
- var __WEBPACK_IMPORTED_MODULE_19__src_range__ = __webpack_require__(416);
+ var __WEBPACK_IMPORTED_MODULE_19__src_range__ = __webpack_require__(295);
__webpack_require__.d(__webpack_exports__, "e", function() {
return __WEBPACK_IMPORTED_MODULE_19__src_range__.a;
});
- var __WEBPACK_IMPORTED_MODULE_23__src_ticks__ = (__webpack_require__(1027), __webpack_require__(1028),
- __webpack_require__(1029), __webpack_require__(417));
+ var __WEBPACK_IMPORTED_MODULE_23__src_ticks__ = (__webpack_require__(719), __webpack_require__(720),
+ __webpack_require__(721), __webpack_require__(296));
__webpack_require__.d(__webpack_exports__, "h", function() {
return __WEBPACK_IMPORTED_MODULE_23__src_ticks__.a;
}), __webpack_require__.d(__webpack_exports__, "f", function() {
@@ -1988,7 +1748,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "g", function() {
return __WEBPACK_IMPORTED_MODULE_23__src_ticks__.c;
});
- __webpack_require__(420), __webpack_require__(413), __webpack_require__(1030);
+ __webpack_require__(299), __webpack_require__(292), __webpack_require__(722);
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.d(__webpack_exports__, "d", function() {
@@ -2019,31 +1779,22 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return arg;
}, module.exports = emptyFunction;
}, function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(32), createDesc = __webpack_require__(91);
- module.exports = __webpack_require__(37) ? function(object, key, value) {
+ var dP = __webpack_require__(22), createDesc = __webpack_require__(71);
+ module.exports = __webpack_require__(25) ? function(object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function(object, key, value) {
return object[key] = value, object;
};
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_exports__.a = Array.isArray || function(val) {
- return null != val && val.length >= 0 && "[object Array]" === Object.prototype.toString.call(val);
+}, function(module, exports, __webpack_require__) {
+ module.exports = {
+ default: __webpack_require__(378),
+ __esModule: !0
};
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _reduced(x) {
- return x && x["@@transducer/reduced"] ? x : {
- "@@transducer/value": x,
- "@@transducer/reduced": !0
- };
- }
- __webpack_exports__.a = _reduced;
}, function(module, exports, __webpack_require__) {
function baseGetTag(value) {
return null == value ? void 0 === value ? undefinedTag : nullTag : symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
}
- var Symbol = __webpack_require__(104), getRawTag = __webpack_require__(861), objectToString = __webpack_require__(862), nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol ? Symbol.toStringTag : void 0;
+ var Symbol = __webpack_require__(77), getRawTag = __webpack_require__(520), objectToString = __webpack_require__(521), nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag = Symbol ? Symbol.toStringTag : void 0;
module.exports = baseGetTag;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -2069,7 +1820,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()("recharts-label", className)
}, attrs, positionAttrs), label);
}
- var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject__ = __webpack_require__(47), __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__), __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__), __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__), __WEBPACK_IMPORTED_MODULE_6__Text__ = __webpack_require__(72), __WEBPACK_IMPORTED_MODULE_7__util_ReactUtils__ = __webpack_require__(7), __WEBPACK_IMPORTED_MODULE_8__util_DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_9__util_PolarUtils__ = __webpack_require__(35), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject__ = __webpack_require__(31), __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__), __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__), __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__), __WEBPACK_IMPORTED_MODULE_6__Text__ = __webpack_require__(55), __WEBPACK_IMPORTED_MODULE_7__util_ReactUtils__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_8__util_DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_9__util_PolarUtils__ = __webpack_require__(23), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -2281,7 +2032,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
__webpack_exports__.a = Label;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
- var __WEBPACK_IMPORTED_MODULE_0__src_color__ = __webpack_require__(251);
+ var __WEBPACK_IMPORTED_MODULE_0__src_color__ = __webpack_require__(188);
__webpack_require__.d(__webpack_exports__, "a", function() {
return __WEBPACK_IMPORTED_MODULE_0__src_color__.e;
}), __webpack_require__.d(__webpack_exports__, "f", function() {
@@ -2289,13 +2040,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}), __webpack_require__.d(__webpack_exports__, "d", function() {
return __WEBPACK_IMPORTED_MODULE_0__src_color__.f;
});
- var __WEBPACK_IMPORTED_MODULE_1__src_lab__ = __webpack_require__(1038);
+ var __WEBPACK_IMPORTED_MODULE_1__src_lab__ = __webpack_require__(730);
__webpack_require__.d(__webpack_exports__, "e", function() {
return __WEBPACK_IMPORTED_MODULE_1__src_lab__.a;
}), __webpack_require__.d(__webpack_exports__, "c", function() {
return __WEBPACK_IMPORTED_MODULE_1__src_lab__.b;
});
- var __WEBPACK_IMPORTED_MODULE_2__src_cubehelix__ = __webpack_require__(1039);
+ var __WEBPACK_IMPORTED_MODULE_2__src_cubehelix__ = __webpack_require__(731);
__webpack_require__.d(__webpack_exports__, "b", function() {
return __WEBPACK_IMPORTED_MODULE_2__src_cubehelix__.a;
});
@@ -2331,7 +2082,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}));
})) : null;
}
- var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject__ = __webpack_require__(47), __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_3_lodash_last__ = __webpack_require__(1089), __WEBPACK_IMPORTED_MODULE_3_lodash_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_last__), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__), __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__), __WEBPACK_IMPORTED_MODULE_7__Label__ = __webpack_require__(60), __WEBPACK_IMPORTED_MODULE_8__container_Layer__ = __webpack_require__(18), __WEBPACK_IMPORTED_MODULE_9__util_ReactUtils__ = __webpack_require__(7), __WEBPACK_IMPORTED_MODULE_10__util_ChartUtils__ = __webpack_require__(21), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject__ = __webpack_require__(31), __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isObject__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_3_lodash_last__ = __webpack_require__(781), __WEBPACK_IMPORTED_MODULE_3_lodash_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_last__), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__), __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__), __WEBPACK_IMPORTED_MODULE_7__Label__ = __webpack_require__(43), __WEBPACK_IMPORTED_MODULE_8__container_Layer__ = __webpack_require__(14), __WEBPACK_IMPORTED_MODULE_9__util_ReactUtils__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_10__util_ChartUtils__ = __webpack_require__(16), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -2415,7 +2166,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var __WEBPACK_IMPORTED_MODULE_0_lodash_sortBy__ = __webpack_require__(402), __WEBPACK_IMPORTED_MODULE_0_lodash_sortBy___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_sortBy__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_get__ = __webpack_require__(152), __WEBPACK_IMPORTED_MODULE_2_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_get__), __WEBPACK_IMPORTED_MODULE_3_lodash_range__ = __webpack_require__(450), __WEBPACK_IMPORTED_MODULE_3_lodash_range___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_range__), __WEBPACK_IMPORTED_MODULE_4_lodash_throttle__ = __webpack_require__(1097), __WEBPACK_IMPORTED_MODULE_4_lodash_throttle___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_throttle__), __WEBPACK_IMPORTED_MODULE_5_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_6_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_6_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react__), __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__), __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__), __WEBPACK_IMPORTED_MODULE_9__container_Surface__ = __webpack_require__(103), __WEBPACK_IMPORTED_MODULE_10__container_Layer__ = __webpack_require__(18), __WEBPACK_IMPORTED_MODULE_11__component_Tooltip__ = __webpack_require__(164), __WEBPACK_IMPORTED_MODULE_12__component_Legend__ = __webpack_require__(233), __WEBPACK_IMPORTED_MODULE_13__shape_Curve__ = __webpack_require__(86), __WEBPACK_IMPORTED_MODULE_14__shape_Cross__ = __webpack_require__(444), __WEBPACK_IMPORTED_MODULE_15__shape_Sector__ = __webpack_require__(170), __WEBPACK_IMPORTED_MODULE_16__shape_Dot__ = __webpack_require__(74), __WEBPACK_IMPORTED_MODULE_17__shape_Rectangle__ = __webpack_require__(85), __WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__ = __webpack_require__(7), __WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__ = __webpack_require__(451), __WEBPACK_IMPORTED_MODULE_20__cartesian_Brush__ = __webpack_require__(449), __WEBPACK_IMPORTED_MODULE_21__util_DOMUtils__ = __webpack_require__(247), __WEBPACK_IMPORTED_MODULE_22__util_DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__ = __webpack_require__(21), __WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__ = __webpack_require__(35), __WEBPACK_IMPORTED_MODULE_25__util_PureRender__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_26__util_Events__ = __webpack_require__(1098), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_lodash_sortBy__ = __webpack_require__(281), __WEBPACK_IMPORTED_MODULE_0_lodash_sortBy___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_sortBy__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_lodash_range__ = __webpack_require__(329), __WEBPACK_IMPORTED_MODULE_2_lodash_range___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_range__), __WEBPACK_IMPORTED_MODULE_3_lodash_throttle__ = __webpack_require__(790), __WEBPACK_IMPORTED_MODULE_3_lodash_throttle___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_throttle__), __WEBPACK_IMPORTED_MODULE_4_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__), __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__), __WEBPACK_IMPORTED_MODULE_7_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_7_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_classnames__), __WEBPACK_IMPORTED_MODULE_8__container_Surface__ = __webpack_require__(78), __WEBPACK_IMPORTED_MODULE_9__container_Layer__ = __webpack_require__(14), __WEBPACK_IMPORTED_MODULE_10__component_Tooltip__ = __webpack_require__(122), __WEBPACK_IMPORTED_MODULE_11__component_Legend__ = __webpack_require__(171), __WEBPACK_IMPORTED_MODULE_12__shape_Curve__ = __webpack_require__(66), __WEBPACK_IMPORTED_MODULE_13__shape_Cross__ = __webpack_require__(323), __WEBPACK_IMPORTED_MODULE_14__shape_Sector__ = __webpack_require__(128), __WEBPACK_IMPORTED_MODULE_15__shape_Dot__ = __webpack_require__(57), __WEBPACK_IMPORTED_MODULE_16__shape_Rectangle__ = __webpack_require__(65), __WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__ = __webpack_require__(330), __WEBPACK_IMPORTED_MODULE_19__cartesian_Brush__ = __webpack_require__(328), __WEBPACK_IMPORTED_MODULE_20__util_DOMUtils__ = __webpack_require__(184), __WEBPACK_IMPORTED_MODULE_21__util_DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__ = __webpack_require__(23), __WEBPACK_IMPORTED_MODULE_24__util_PureRender__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_25__util_Events__ = __webpack_require__(791), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -2453,22 +2204,22 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
props: props
}, defaultState, {
updateId: 0
- }))), _this.uniqueChartId = __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(props.id) ? Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.j)("recharts") : props.id,
- props.throttleDelay && (_this.triggeredAfterMouseMove = __WEBPACK_IMPORTED_MODULE_4_lodash_throttle___default()(_this.triggeredAfterMouseMove, props.throttleDelay)),
+ }))), _this.uniqueChartId = __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(props.id) ? Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.j)("recharts") : props.id,
+ props.throttleDelay && (_this.triggeredAfterMouseMove = __WEBPACK_IMPORTED_MODULE_3_lodash_throttle___default()(_this.triggeredAfterMouseMove, props.throttleDelay)),
_this;
}
return _inherits(CategoricalChartWrapper, _Component), _createClass(CategoricalChartWrapper, [ {
key: "componentDidMount",
value: function() {
- __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(this.props.syncId) || this.addListener();
+ __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(this.props.syncId) || this.addListener();
}
}, {
key: "componentWillReceiveProps",
value: function(nextProps) {
var _props = this.props, data = _props.data, children = _props.children, width = _props.width, height = _props.height, layout = _props.layout, stackOffset = _props.stackOffset, margin = _props.margin, updateId = this.state.updateId;
- if (nextProps.data === data && nextProps.width === width && nextProps.height === height && nextProps.layout === layout && nextProps.stackOffset === stackOffset && Object(__WEBPACK_IMPORTED_MODULE_25__util_PureRender__.b)(nextProps.margin, margin)) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.m)(nextProps.children, children)) {
- var hasGlobalData = !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(nextProps.data), newUpdateId = hasGlobalData ? updateId : updateId + 1, _state = this.state, dataStartIndex = _state.dataStartIndex, dataEndIndex = _state.dataEndIndex, _defaultState = _extends({}, this.constructor.createDefaultState(nextProps), {
+ if (nextProps.data === data && nextProps.width === width && nextProps.height === height && nextProps.layout === layout && nextProps.stackOffset === stackOffset && Object(__WEBPACK_IMPORTED_MODULE_24__util_PureRender__.b)(nextProps.margin, margin)) {
+ if (!Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.m)(nextProps.children, children)) {
+ var hasGlobalData = !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(nextProps.data), newUpdateId = hasGlobalData ? updateId : updateId + 1, _state = this.state, dataStartIndex = _state.dataStartIndex, dataEndIndex = _state.dataEndIndex, _defaultState = _extends({}, this.constructor.createDefaultState(nextProps), {
dataEndIndex: dataEndIndex,
dataStartIndex: dataStartIndex
});
@@ -2490,19 +2241,19 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
updateId: updateId + 1
}))));
}
- __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(this.props.syncId) && !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(nextProps.syncId) && this.addListener(),
- !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(this.props.syncId) && __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(nextProps.syncId) && this.removeListener();
+ __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(this.props.syncId) && !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(nextProps.syncId) && this.addListener(),
+ !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(this.props.syncId) && __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(nextProps.syncId) && this.removeListener();
}
}, {
key: "componentWillUnmount",
value: function() {
- __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(this.props.syncId) || this.removeListener(),
+ __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(this.props.syncId) || this.removeListener(),
"function" == typeof this.triggeredAfterMouseMove.cancel && this.triggeredAfterMouseMove.cancel();
}
}, {
key: "getAxisMap",
value: function(props, _ref2) {
- var _ref2$axisType = _ref2.axisType, axisType = void 0 === _ref2$axisType ? "xAxis" : _ref2$axisType, AxisComp = _ref2.AxisComp, graphicalItems = _ref2.graphicalItems, stackGroups = _ref2.stackGroups, dataStartIndex = _ref2.dataStartIndex, dataEndIndex = _ref2.dataEndIndex, children = props.children, axisIdKey = axisType + "Id", axes = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.h)(children, AxisComp), axisMap = {};
+ var _ref2$axisType = _ref2.axisType, axisType = void 0 === _ref2$axisType ? "xAxis" : _ref2$axisType, AxisComp = _ref2.AxisComp, graphicalItems = _ref2.graphicalItems, stackGroups = _ref2.stackGroups, dataStartIndex = _ref2.dataStartIndex, dataEndIndex = _ref2.dataEndIndex, children = props.children, axisIdKey = axisType + "Id", axes = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.h)(children, AxisComp), axisMap = {};
return axes && axes.length ? axisMap = this.getAxisMapByAxes(props, {
axes: axes,
graphicalItems: graphicalItems,
@@ -2524,7 +2275,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "getAxisMapByAxes",
value: function(props, _ref3) {
- var _this2 = this, axes = _ref3.axes, graphicalItems = _ref3.graphicalItems, axisType = _ref3.axisType, axisIdKey = _ref3.axisIdKey, stackGroups = _ref3.stackGroups, dataStartIndex = _ref3.dataStartIndex, dataEndIndex = _ref3.dataEndIndex, layout = props.layout, children = props.children, stackOffset = props.stackOffset, isCategorial = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.x)(layout, axisType);
+ var _this2 = this, axes = _ref3.axes, graphicalItems = _ref3.graphicalItems, axisType = _ref3.axisType, axisIdKey = _ref3.axisIdKey, stackGroups = _ref3.stackGroups, dataStartIndex = _ref3.dataStartIndex, dataEndIndex = _ref3.dataEndIndex, layout = props.layout, children = props.children, stackOffset = props.stackOffset, isCategorial = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.x)(layout, axisType);
return axes.reduce(function(result, child) {
var _child$props = child.props, type = _child$props.type, dataKey = _child$props.dataKey, allowDataOverflow = _child$props.allowDataOverflow, allowDuplicatedCategory = _child$props.allowDuplicatedCategory, scale = _child$props.scale, ticks = _child$props.ticks, axisId = child.props[axisIdKey], displayedData = _this2.constructor.getDisplayedData(props, {
graphicalItems: graphicalItems.filter(function(item) {
@@ -2536,28 +2287,28 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
if (!result[axisId]) {
var domain = void 0, duplicateDomain = void 0, categoricalDomain = void 0;
if (dataKey) {
- if (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.n)(displayedData, dataKey, type),
+ if (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.n)(displayedData, dataKey, type),
"category" === type && isCategorial) {
- var duplicate = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.d)(domain);
- allowDuplicatedCategory && duplicate ? (duplicateDomain = domain, domain = __WEBPACK_IMPORTED_MODULE_3_lodash_range___default()(0, len)) : allowDuplicatedCategory || (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.y)(child.props.domain, domain, child).reduce(function(finalDomain, entry) {
+ var duplicate = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.d)(domain);
+ allowDuplicatedCategory && duplicate ? (duplicateDomain = domain, domain = __WEBPACK_IMPORTED_MODULE_2_lodash_range___default()(0, len)) : allowDuplicatedCategory || (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.y)(child.props.domain, domain, child).reduce(function(finalDomain, entry) {
return finalDomain.indexOf(entry) >= 0 ? finalDomain : [].concat(_toConsumableArray(finalDomain), [ entry ]);
}, []));
} else if ("category" === type) domain = allowDuplicatedCategory ? domain.filter(function(entry) {
- return "" !== entry && !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(entry);
- }) : Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.y)(child.props.domain, domain, child).reduce(function(finalDomain, entry) {
- return finalDomain.indexOf(entry) >= 0 || "" === entry || __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(entry) ? finalDomain : [].concat(_toConsumableArray(finalDomain), [ entry ]);
+ return "" !== entry && !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(entry);
+ }) : Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.y)(child.props.domain, domain, child).reduce(function(finalDomain, entry) {
+ return finalDomain.indexOf(entry) >= 0 || "" === entry || __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(entry) ? finalDomain : [].concat(_toConsumableArray(finalDomain), [ entry ]);
}, []); else if ("number" === type) {
- var errorBarsDomain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.z)(displayedData, graphicalItems.filter(function(item) {
+ var errorBarsDomain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.z)(displayedData, graphicalItems.filter(function(item) {
return item.props[axisIdKey] === axisId && !item.props.hide;
}), dataKey, axisType);
errorBarsDomain && (domain = errorBarsDomain);
}
- !isCategorial || "number" !== type && "auto" === scale || (categoricalDomain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.n)(displayedData, dataKey, "category"));
- } else domain = isCategorial ? __WEBPACK_IMPORTED_MODULE_3_lodash_range___default()(0, len) : stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && "number" === type ? "expand" === stackOffset ? [ 0, 1 ] : Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.p)(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex) : Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.o)(displayedData, graphicalItems.filter(function(item) {
+ !isCategorial || "number" !== type && "auto" === scale || (categoricalDomain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.n)(displayedData, dataKey, "category"));
+ } else domain = isCategorial ? __WEBPACK_IMPORTED_MODULE_2_lodash_range___default()(0, len) : stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && "number" === type ? "expand" === stackOffset ? [ 0, 1 ] : Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.p)(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex) : Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.o)(displayedData, graphicalItems.filter(function(item) {
return item.props[axisIdKey] === axisId && !item.props.hide;
}), type, !0);
- return "number" === type && (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.e)(children, domain, axisId, axisType, ticks),
- child.props.domain && (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.B)(child.props.domain, domain, allowDataOverflow))),
+ return "number" === type && (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.e)(children, domain, axisId, axisType, ticks),
+ child.props.domain && (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.B)(child.props.domain, domain, allowDataOverflow))),
_extends({}, result, _defineProperty({}, axisId, _extends({}, child.props, {
axisType: axisType,
domain: domain,
@@ -2578,16 +2329,16 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
graphicalItems: graphicalItems,
dataStartIndex: dataStartIndex,
dataEndIndex: dataEndIndex
- }), len = displayedData.length, isCategorial = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.x)(layout, axisType), index = -1;
+ }), len = displayedData.length, isCategorial = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.x)(layout, axisType), index = -1;
return graphicalItems.reduce(function(result, child) {
var axisId = child.props[axisIdKey];
if (!result[axisId]) {
index++;
var domain = void 0;
- return isCategorial ? domain = __WEBPACK_IMPORTED_MODULE_3_lodash_range___default()(0, len) : stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack ? (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.p)(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex),
- domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.e)(children, domain, axisId, axisType)) : (domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.B)(Axis.defaultProps.domain, Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.o)(displayedData, graphicalItems.filter(function(item) {
+ return isCategorial ? domain = __WEBPACK_IMPORTED_MODULE_2_lodash_range___default()(0, len) : stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack ? (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.p)(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex),
+ domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.e)(children, domain, axisId, axisType)) : (domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.B)(Axis.defaultProps.domain, Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.o)(displayedData, graphicalItems.filter(function(item) {
return item.props[axisIdKey] === axisId && !item.props.hide;
- }), "number"), Axis.defaultProps.allowDataOverflow), domain = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.e)(children, domain, axisId, axisType)),
+ }), "number"), Axis.defaultProps.allowDataOverflow), domain = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.e)(children, domain, axisId, axisType)),
_extends({}, result, _defineProperty({}, axisId, _extends({
axisType: axisType
}, Axis.defaultProps, {
@@ -2605,9 +2356,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "getActiveCoordinate",
value: function(tooltipTicks, activeIndex, rangeObj) {
- var layout = this.props.layout, entry = __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(tooltipTicks.filter(function(tick) {
+ var layout = this.props.layout, entry = tooltipTicks.find(function(tick) {
return tick && tick.index === activeIndex;
- }), "[0]");
+ });
if (entry) {
if ("horizontal" === layout) return {
x: entry.coordinate,
@@ -2619,13 +2370,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
if ("centric" === layout) {
var _angle = entry.coordinate, _radius = rangeObj.radius;
- return _extends({}, rangeObj, Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(rangeObj.cx, rangeObj.cy, _radius, _angle), {
+ return _extends({}, rangeObj, Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(rangeObj.cx, rangeObj.cy, _radius, _angle), {
angle: _angle,
radius: _radius
});
}
var radius = entry.coordinate, angle = rangeObj.angle;
- return _extends({}, rangeObj, Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(rangeObj.cx, rangeObj.cy, radius, angle), {
+ return _extends({}, rangeObj, Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(rangeObj.cx, rangeObj.cy, radius, angle), {
angle: angle,
radius: radius
});
@@ -2636,17 +2387,17 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
key: "getMouseInfo",
value: function(event) {
if (!this.container) return null;
- var containerOffset = Object(__WEBPACK_IMPORTED_MODULE_21__util_DOMUtils__.b)(this.container), e = Object(__WEBPACK_IMPORTED_MODULE_21__util_DOMUtils__.a)(event, containerOffset), rangeObj = this.inRange(e.chartX, e.chartY);
+ var containerOffset = Object(__WEBPACK_IMPORTED_MODULE_20__util_DOMUtils__.b)(this.container), e = Object(__WEBPACK_IMPORTED_MODULE_20__util_DOMUtils__.a)(event, containerOffset), rangeObj = this.inRange(e.chartX, e.chartY);
if (!rangeObj) return null;
var _state2 = this.state, xAxisMap = _state2.xAxisMap, yAxisMap = _state2.yAxisMap;
if ("axis" !== eventType && xAxisMap && yAxisMap) {
- var xScale = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(xAxisMap).scale, yScale = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(yAxisMap).scale, xValue = xScale && xScale.invert ? xScale.invert(e.chartX) : null, yValue = yScale && yScale.invert ? yScale.invert(e.chartY) : null;
+ var xScale = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(xAxisMap).scale, yScale = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(yAxisMap).scale, xValue = xScale && xScale.invert ? xScale.invert(e.chartX) : null, yValue = yScale && yScale.invert ? yScale.invert(e.chartY) : null;
return _extends({}, e, {
xValue: xValue,
yValue: yValue
});
}
- var _state3 = this.state, ticks = _state3.orderedTooltipTicks, axis = _state3.tooltipAxis, tooltipTicks = _state3.tooltipTicks, pos = this.calculateTooltipPos(rangeObj), activeIndex = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.b)(pos, ticks, tooltipTicks, axis);
+ var _state3 = this.state, ticks = _state3.orderedTooltipTicks, axis = _state3.tooltipAxis, tooltipTicks = _state3.tooltipTicks, pos = this.calculateTooltipPos(rangeObj), activeIndex = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.b)(pos, ticks, tooltipTicks, axis);
if (activeIndex >= 0 && tooltipTicks) {
var activeLabel = tooltipTicks[activeIndex] && tooltipTicks[activeIndex].value, activePayload = this.getTooltipContent(activeIndex, activeLabel), activeCoordinate = this.getActiveCoordinate(ticks, activeIndex, rangeObj);
return _extends({}, e, {
@@ -2665,14 +2416,14 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return activeIndex < 0 || !graphicalItems || !graphicalItems.length || activeIndex >= displayedData.length ? null : graphicalItems.reduce(function(result, child) {
if (child.props.hide) return result;
var _child$props2 = child.props, dataKey = _child$props2.dataKey, name = _child$props2.name, unit = _child$props2.unit, formatter = _child$props2.formatter, data = _child$props2.data, payload = void 0;
- return payload = tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory ? Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.a)(data || displayedData, tooltipAxis.dataKey, activeLabel) : displayedData[activeIndex],
- payload ? [].concat(_toConsumableArray(result), [ _extends({}, Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.k)(child), {
+ return payload = tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory ? Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.a)(data || displayedData, tooltipAxis.dataKey, activeLabel) : displayedData[activeIndex],
+ payload ? [].concat(_toConsumableArray(result), [ _extends({}, Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.k)(child), {
dataKey: dataKey,
unit: unit,
formatter: formatter,
name: name || dataKey,
- color: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.r)(child),
- value: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.w)(payload, dataKey),
+ color: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.r)(child),
+ value: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.w)(payload, dataKey),
payload: payload
}) ]) : result;
}, []);
@@ -2680,7 +2431,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "getFormatItems",
value: function(props, currentState) {
- var _this3 = this, graphicalItems = currentState.graphicalItems, stackGroups = currentState.stackGroups, offset = currentState.offset, updateId = currentState.updateId, dataStartIndex = currentState.dataStartIndex, dataEndIndex = currentState.dataEndIndex, barSize = props.barSize, layout = props.layout, barGap = props.barGap, barCategoryGap = props.barCategoryGap, globalMaxBarSize = props.maxBarSize, _getAxisNameByLayout = this.getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout.numericAxisName, cateAxisName = _getAxisNameByLayout.cateAxisName, hasBar = this.constructor.hasBar(graphicalItems), sizeList = hasBar && Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.i)({
+ var _this3 = this, graphicalItems = currentState.graphicalItems, stackGroups = currentState.stackGroups, offset = currentState.offset, updateId = currentState.updateId, dataStartIndex = currentState.dataStartIndex, dataEndIndex = currentState.dataEndIndex, barSize = props.barSize, layout = props.layout, barGap = props.barGap, barCategoryGap = props.barCategoryGap, globalMaxBarSize = props.maxBarSize, _getAxisNameByLayout = this.getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout.numericAxisName, cateAxisName = _getAxisNameByLayout.cateAxisName, hasBar = this.constructor.hasBar(graphicalItems), sizeList = hasBar && Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.i)({
barSize: barSize,
stackGroups: stackGroups
}), formatedItems = [];
@@ -2691,9 +2442,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, item), _item$props = item.props, dataKey = _item$props.dataKey, childMaxBarSize = _item$props.maxBarSize, numericAxisId = item.props[numericAxisName + "Id"], cateAxisId = item.props[cateAxisName + "Id"], axisObj = axisComponents.reduce(function(result, entry) {
var _extends4, axisMap = currentState[entry.axisType + "Map"], id = item.props[entry.axisType + "Id"], axis = axisMap && axisMap[id];
return _extends({}, result, (_extends4 = {}, _defineProperty(_extends4, entry.axisType, axis),
- _defineProperty(_extends4, entry.axisType + "Ticks", Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(axis)),
+ _defineProperty(_extends4, entry.axisType + "Ticks", Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(axis)),
_extends4));
- }, {}), cateAxis = axisObj[cateAxisName], cateTicks = axisObj[cateAxisName + "Ticks"], stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.t)(item, stackGroups[numericAxisId].stackGroups), bandSize = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.g)(cateAxis, cateTicks), maxBarSize = __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize, barPosition = hasBar && Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.h)({
+ }, {}), cateAxis = axisObj[cateAxisName], cateTicks = axisObj[cateAxisName + "Ticks"], stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.t)(item, stackGroups[numericAxisId].stackGroups), bandSize = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.g)(cateAxis, cateTicks), maxBarSize = __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize, barPosition = hasBar && Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.h)({
barGap: barGap,
barCategoryGap: barCategoryGap,
bandSize: bandSize,
@@ -2715,13 +2466,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
layout: layout,
dataStartIndex: dataStartIndex,
dataEndIndex: dataEndIndex,
- onItemMouseLeave: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.d)(_this3.handleItemMouseLeave, null, item.props.onMouseLeave),
- onItemMouseEnter: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.d)(_this3.handleItemMouseEnter, null, item.props.onMouseEnter)
+ onItemMouseLeave: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.d)(_this3.handleItemMouseLeave, null, item.props.onMouseLeave),
+ onItemMouseEnter: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.d)(_this3.handleItemMouseEnter, null, item.props.onMouseEnter)
})), (_extends5 = {
key: item.key || "item-" + index
}, _defineProperty(_extends5, numericAxisName, axisObj[numericAxisName]), _defineProperty(_extends5, cateAxisName, axisObj[cateAxisName]),
_defineProperty(_extends5, "animationId", updateId), _extends5)),
- childIndex: Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.o)(item, props.children),
+ childIndex: Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.o)(item, props.children),
item: item
});
}
@@ -2746,9 +2497,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var layout = this.props.layout, _state6 = this.state, activeCoordinate = _state6.activeCoordinate, offset = _state6.offset, x1 = void 0, y1 = void 0, x2 = void 0, y2 = void 0;
if ("horizontal" === layout) x1 = activeCoordinate.x, x2 = x1, y1 = offset.top,
y2 = offset.top + offset.height; else if ("vertical" === layout) y1 = activeCoordinate.y,
- y2 = y1, x1 = offset.left, x2 = offset.left + offset.width; else if (!__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(activeCoordinate.cx) || !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(activeCoordinate.cy)) {
+ y2 = y1, x1 = offset.left, x2 = offset.left + offset.width; else if (!__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(activeCoordinate.cx) || !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(activeCoordinate.cy)) {
if ("centric" !== layout) {
- var _cx = activeCoordinate.cx, _cy = activeCoordinate.cy, radius = activeCoordinate.radius, startAngle = activeCoordinate.startAngle, endAngle = activeCoordinate.endAngle, startPoint = Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(_cx, _cy, radius, startAngle), endPoint = Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(_cx, _cy, radius, endAngle);
+ var _cx = activeCoordinate.cx, _cy = activeCoordinate.cy, radius = activeCoordinate.radius, startAngle = activeCoordinate.startAngle, endAngle = activeCoordinate.endAngle, startPoint = Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(_cx, _cy, radius, startAngle), endPoint = Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(_cx, _cy, radius, endAngle);
return {
points: [ startPoint, endPoint ],
cx: _cx,
@@ -2758,7 +2509,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
endAngle: endAngle
};
}
- var cx = activeCoordinate.cx, cy = activeCoordinate.cy, innerRadius = activeCoordinate.innerRadius, outerRadius = activeCoordinate.outerRadius, angle = activeCoordinate.angle, innerPoint = Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(cx, cy, innerRadius, angle), outerPoint = Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.e)(cx, cy, outerRadius, angle);
+ var cx = activeCoordinate.cx, cy = activeCoordinate.cy, innerRadius = activeCoordinate.innerRadius, outerRadius = activeCoordinate.outerRadius, angle = activeCoordinate.angle, innerPoint = Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(cx, cy, innerRadius, angle), outerPoint = Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.e)(cx, cy, outerRadius, angle);
x1 = innerPoint.x, y1 = innerPoint.y, x2 = outerPoint.x, y2 = outerPoint.y;
}
return [ {
@@ -2805,8 +2556,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
var _state7 = this.state, angleAxisMap = _state7.angleAxisMap, radiusAxisMap = _state7.radiusAxisMap;
if (angleAxisMap && radiusAxisMap) {
- var angleAxis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(angleAxisMap);
- return Object(__WEBPACK_IMPORTED_MODULE_24__util_PolarUtils__.d)({
+ var angleAxis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(angleAxisMap);
+ return Object(__WEBPACK_IMPORTED_MODULE_23__util_PolarUtils__.d)({
x: x,
y: y
}, angleAxis);
@@ -2816,22 +2567,22 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "parseEventsOfWrapper",
value: function() {
- var children = this.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_11__component_Tooltip__.a), tooltipEvents = tooltipItem && "axis" === eventType ? {
+ var children = this.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_10__component_Tooltip__.a), tooltipEvents = tooltipItem && "axis" === eventType ? {
onMouseEnter: this.handleMouseEnter,
onMouseMove: this.handleMouseMove,
onMouseLeave: this.handleMouseLeave,
onTouchMove: this.handleTouchMove
- } : {}, outerEvents = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.e)(this.props, this.handleOuterEvent);
+ } : {}, outerEvents = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.e)(this.props, this.handleOuterEvent);
return _extends({}, outerEvents, tooltipEvents);
}
}, {
key: "updateStateOfAxisMapsOffsetAndStackGroups",
value: function(_ref5) {
var _this4 = this, props = _ref5.props, dataStartIndex = _ref5.dataStartIndex, dataEndIndex = _ref5.dataEndIndex, updateId = _ref5.updateId;
- if (!Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.q)({
+ if (!Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.q)({
props: props
})) return null;
- var children = props.children, layout = props.layout, stackOffset = props.stackOffset, data = props.data, reverseStackOrder = props.reverseStackOrder, _getAxisNameByLayout2 = this.getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout2.numericAxisName, cateAxisName = _getAxisNameByLayout2.cateAxisName, graphicalItems = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.h)(children, GraphicalChild), stackGroups = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.s)(data, graphicalItems, numericAxisName + "Id", cateAxisName + "Id", stackOffset, reverseStackOrder), axisObj = axisComponents.reduce(function(result, entry) {
+ var children = props.children, layout = props.layout, stackOffset = props.stackOffset, data = props.data, reverseStackOrder = props.reverseStackOrder, _getAxisNameByLayout2 = this.getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout2.numericAxisName, cateAxisName = _getAxisNameByLayout2.cateAxisName, graphicalItems = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.h)(children, GraphicalChild), stackGroups = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.s)(data, graphicalItems, numericAxisName + "Id", cateAxisName + "Id", stackOffset, reverseStackOrder), axisObj = axisComponents.reduce(function(result, entry) {
var name = entry.axisType + "Map";
return _extends({}, result, _defineProperty({}, name, _this4.getAxisMap(props, _extends({}, entry, {
graphicalItems: graphicalItems,
@@ -2864,19 +2615,19 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "addListener",
value: function() {
- __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.on(__WEBPACK_IMPORTED_MODULE_26__util_Events__.a, this.handleReceiveSyncEvent),
- __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.setMaxListeners && __WEBPACK_IMPORTED_MODULE_26__util_Events__.b._maxListeners && __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.setMaxListeners(__WEBPACK_IMPORTED_MODULE_26__util_Events__.b._maxListeners + 1);
+ __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.on(__WEBPACK_IMPORTED_MODULE_25__util_Events__.a, this.handleReceiveSyncEvent),
+ __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.setMaxListeners && __WEBPACK_IMPORTED_MODULE_25__util_Events__.b._maxListeners && __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.setMaxListeners(__WEBPACK_IMPORTED_MODULE_25__util_Events__.b._maxListeners + 1);
}
}, {
key: "removeListener",
value: function() {
- __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.removeListener(__WEBPACK_IMPORTED_MODULE_26__util_Events__.a, this.handleReceiveSyncEvent),
- __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.setMaxListeners && __WEBPACK_IMPORTED_MODULE_26__util_Events__.b._maxListeners && __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.setMaxListeners(__WEBPACK_IMPORTED_MODULE_26__util_Events__.b._maxListeners - 1);
+ __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.removeListener(__WEBPACK_IMPORTED_MODULE_25__util_Events__.a, this.handleReceiveSyncEvent),
+ __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.setMaxListeners && __WEBPACK_IMPORTED_MODULE_25__util_Events__.b._maxListeners && __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.setMaxListeners(__WEBPACK_IMPORTED_MODULE_25__util_Events__.b._maxListeners - 1);
}
}, {
key: "calculateOffset",
value: function(_ref6) {
- var props = _ref6.props, graphicalItems = _ref6.graphicalItems, _ref6$xAxisMap = _ref6.xAxisMap, xAxisMap = void 0 === _ref6$xAxisMap ? {} : _ref6$xAxisMap, _ref6$yAxisMap = _ref6.yAxisMap, yAxisMap = void 0 === _ref6$yAxisMap ? {} : _ref6$yAxisMap, width = props.width, height = props.height, children = props.children, margin = props.margin || {}, brushItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_20__cartesian_Brush__.a), legendItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_12__component_Legend__.a), offsetH = Object.keys(yAxisMap).reduce(function(result, id) {
+ var props = _ref6.props, graphicalItems = _ref6.graphicalItems, _ref6$xAxisMap = _ref6.xAxisMap, xAxisMap = void 0 === _ref6$xAxisMap ? {} : _ref6$xAxisMap, _ref6$yAxisMap = _ref6.yAxisMap, yAxisMap = void 0 === _ref6$yAxisMap ? {} : _ref6$yAxisMap, width = props.width, height = props.height, children = props.children, margin = props.margin || {}, brushItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_19__cartesian_Brush__.a), legendItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_11__component_Legend__.a), offsetH = Object.keys(yAxisMap).reduce(function(result, id) {
var entry = yAxisMap[id], orientation = entry.orientation;
return entry.mirror || entry.hide ? result : _extends({}, result, _defineProperty({}, orientation, result[orientation] + entry.width));
}, {
@@ -2889,10 +2640,10 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
top: margin.top || 0,
bottom: margin.bottom || 0
}), offset = _extends({}, offsetV, offsetH), brushBottom = offset.bottom;
- if (brushItem && (offset.bottom += brushItem.props.height || __WEBPACK_IMPORTED_MODULE_20__cartesian_Brush__.a.defaultProps.height),
+ if (brushItem && (offset.bottom += brushItem.props.height || __WEBPACK_IMPORTED_MODULE_19__cartesian_Brush__.a.defaultProps.height),
legendItem && this.legendInstance) {
var legendBox = this.legendInstance.getBBox();
- offset = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.a)(offset, graphicalItems, props, legendBox);
+ offset = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.a)(offset, graphicalItems, props, legendBox);
}
return _extends({
brushBottom: brushBottom
@@ -2905,14 +2656,14 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
key: "triggerSyncEvent",
value: function(data) {
var syncId = this.props.syncId;
- __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(syncId) || __WEBPACK_IMPORTED_MODULE_26__util_Events__.b.emit(__WEBPACK_IMPORTED_MODULE_26__util_Events__.a, syncId, this.uniqueChartId, data);
+ __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(syncId) || __WEBPACK_IMPORTED_MODULE_25__util_Events__.b.emit(__WEBPACK_IMPORTED_MODULE_25__util_Events__.a, syncId, this.uniqueChartId, data);
}
}, {
key: "filterFormatItem",
value: function(item, displayName, childIndex) {
for (var formatedGraphicalItems = this.state.formatedGraphicalItems, i = 0, len = formatedGraphicalItems.length; i < len; i++) {
var entry = formatedGraphicalItems[i];
- if (entry.item === item || entry.props.key === item.key || displayName === Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.j)(entry.item.type) && childIndex === entry.childIndex) return entry;
+ if (entry.item === item || entry.props.key === item.key || displayName === Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.j)(entry.item.type) && childIndex === entry.childIndex) return entry;
}
return null;
}
@@ -2920,7 +2671,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
key: "renderAxis",
value: function(axisOptions, element, displayName, index) {
var _props2 = this.props, width = _props2.width, height = _props2.height;
- return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__.a, _extends({}, axisOptions, {
+ return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__.a, _extends({}, axisOptions, {
className: "recharts-" + axisOptions.axisType + " " + axisOptions.axisType,
key: element.key || displayName + "-" + index,
viewBox: {
@@ -2935,7 +2686,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "renderLegend",
value: function() {
- var _this5 = this, formatedGraphicalItems = this.state.formatedGraphicalItems, _props3 = this.props, children = _props3.children, width = _props3.width, height = _props3.height, margin = this.props.margin || {}, legendWidth = width - (margin.left || 0) - (margin.right || 0), legendHeight = height - (margin.top || 0) - (margin.bottom || 0), props = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.q)({
+ var _this5 = this, formatedGraphicalItems = this.state.formatedGraphicalItems, _props3 = this.props, children = _props3.children, width = _props3.width, height = _props3.height, margin = this.props.margin || {}, legendWidth = width - (margin.left || 0) - (margin.right || 0), legendHeight = height - (margin.top || 0) - (margin.bottom || 0), props = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.q)({
children: children,
formatedGraphicalItems: formatedGraphicalItems,
legendWidth: legendWidth,
@@ -2944,7 +2695,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
});
if (!props) return null;
var item = props.item, otherProps = _objectWithoutProperties(props, [ "item" ]);
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(item, _extends({}, otherProps, {
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(item, _extends({}, otherProps, {
chartWidth: width,
chartHeight: height,
margin: margin,
@@ -2957,10 +2708,10 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, {
key: "renderTooltip",
value: function() {
- var children = this.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_11__component_Tooltip__.a);
+ var children = this.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_10__component_Tooltip__.a);
if (!tooltipItem) return null;
var _state8 = this.state, isTooltipActive = _state8.isTooltipActive, activeCoordinate = _state8.activeCoordinate, activePayload = _state8.activePayload, activeLabel = _state8.activeLabel, offset = _state8.offset;
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(tooltipItem, {
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(tooltipItem, {
viewBox: _extends({}, offset, {
x: offset.left,
y: offset.top
@@ -2975,8 +2726,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
key: "renderActiveDot",
value: function(option, props) {
var dot = void 0;
- return dot = Object(__WEBPACK_IMPORTED_MODULE_6_react__.isValidElement)(option) ? Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(option, props) : __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(option) ? option(props) : __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_16__shape_Dot__.a, props),
- __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__container_Layer__.a, {
+ return dot = Object(__WEBPACK_IMPORTED_MODULE_5_react__.isValidElement)(option) ? Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(option, props) : __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(option) ? option(props) : __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__shape_Dot__.a, props),
+ __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__container_Layer__.a, {
className: "recharts-active-dot",
key: props.key
}, dot);
@@ -2990,13 +2741,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
cx: activePoint.x,
cy: activePoint.y,
r: 4,
- fill: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.r)(item.item),
+ fill: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.r)(item.item),
strokeWidth: 2,
stroke: "#fff",
payload: activePoint.payload,
value: activePoint.value,
key: key + "-activePoint-" + childIndex
- }, Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.k)(activeDot), Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.e)(activeDot));
+ }, Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.k)(activeDot), Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.e)(activeDot));
return result.push(this.renderActiveDot(activeDot, dotProps, childIndex)), basePoint ? result.push(this.renderActiveDot(activeDot, _extends({}, dotProps, {
cx: basePoint.x,
cy: basePoint.y,
@@ -3007,8 +2758,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
key: "render",
value: function() {
var _this6 = this;
- if (!Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.q)(this)) return null;
- var _props4 = this.props, children = _props4.children, className = _props4.className, width = _props4.width, height = _props4.height, style = _props4.style, compact = _props4.compact, others = _objectWithoutProperties(_props4, [ "children", "className", "width", "height", "style", "compact" ]), attrs = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.k)(others), map = {
+ if (!Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.q)(this)) return null;
+ var _props4 = this.props, children = _props4.children, className = _props4.className, width = _props4.width, height = _props4.height, style = _props4.style, compact = _props4.compact, others = _objectWithoutProperties(_props4, [ "children", "className", "width", "height", "style", "compact" ]), attrs = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.k)(others), map = {
CartesianGrid: {
handler: this.renderGrid,
once: !0
@@ -3068,13 +2819,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
handler: this.renderPolarAxis
}
};
- if (compact) return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__container_Surface__.a, _extends({}, attrs, {
+ if (compact) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__container_Surface__.a, _extends({}, attrs, {
width: width,
height: height
- }), Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.p)(children, map));
+ }), Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.p)(children, map));
var events = this.parseEventsOfWrapper();
- return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement("div", _extends({
- className: __WEBPACK_IMPORTED_MODULE_8_classnames___default()("recharts-wrapper", className),
+ return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement("div", _extends({
+ className: __WEBPACK_IMPORTED_MODULE_7_classnames___default()("recharts-wrapper", className),
style: _extends({}, style, {
position: "relative",
cursor: "default",
@@ -3085,43 +2836,43 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
ref: function(node) {
_this6.container = node;
}
- }), __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__container_Surface__.a, _extends({}, attrs, {
+ }), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__container_Surface__.a, _extends({}, attrs, {
width: width,
height: height
- }), Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.p)(children, map)), this.renderLegend(), this.renderTooltip());
+ }), Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.p)(children, map)), this.renderLegend(), this.renderTooltip());
}
} ]), CategoricalChartWrapper;
- }(__WEBPACK_IMPORTED_MODULE_6_react__.Component), _class.displayName = chartName,
+ }(__WEBPACK_IMPORTED_MODULE_5_react__.Component), _class.displayName = chartName,
_class.propTypes = _extends({
- syncId: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number ]),
- compact: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
- width: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- height: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- data: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object),
- layout: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOf([ "horizontal", "vertical" ]),
- stackOffset: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOf([ "sign", "expand", "none", "wiggle", "silhouette" ]),
- throttleDelay: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- margin: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.shape({
- top: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- right: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- bottom: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- left: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number
+ syncId: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number ]),
+ compact: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+ width: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ height: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ data: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object),
+ layout: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOf([ "horizontal", "vertical" ]),
+ stackOffset: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOf([ "sign", "expand", "none", "wiggle", "silhouette" ]),
+ throttleDelay: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ margin: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.shape({
+ top: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ right: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ bottom: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ left: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number
}),
- barCategoryGap: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string ]),
- barGap: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string ]),
- barSize: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string ]),
- maxBarSize: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number,
- style: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object,
- className: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,
- children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node ]),
- onClick: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- onMouseLeave: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- onMouseEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- onMouseMove: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- onMouseDown: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- onMouseUp: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,
- reverseStackOrder: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
- id: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string
+ barCategoryGap: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string ]),
+ barGap: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string ]),
+ barSize: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string ]),
+ maxBarSize: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.number,
+ style: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
+ className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
+ children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node ]),
+ onClick: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ onMouseLeave: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ onMouseEnter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ onMouseMove: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ onMouseDown: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ onMouseUp: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
+ reverseStackOrder: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
+ id: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string
}, propTypes), _class.defaultProps = _extends({
layout: "horizontal",
stackOffset: "none",
@@ -3135,7 +2886,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
},
reverseStackOrder: !1
}, defaultProps), _class.createDefaultState = function(props) {
- var children = props.children, brushItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_20__cartesian_Brush__.a);
+ var children = props.children, brushItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_19__cartesian_Brush__.a);
return {
chartX: 0,
chartY: 0,
@@ -3146,7 +2897,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
}, _class.hasBar = function(graphicalItems) {
return !(!graphicalItems || !graphicalItems.length) && graphicalItems.some(function(item) {
- var name = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.j)(item && item.type);
+ var name = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.j)(item && item.type);
return name && name.indexOf("Bar") >= 0;
});
}, _class.getDisplayedData = function(props, _ref8, item) {
@@ -3157,7 +2908,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
if (itemsData && itemsData.length > 0) return itemsData;
if (item && item.props && item.props.data && item.props.data.length > 0) return item.props.data;
var data = props.data;
- return data && data.length && Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(dataStartIndex) && Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(dataEndIndex) ? data.slice(dataStartIndex, dataEndIndex + 1) : [];
+ return data && data.length && Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(dataStartIndex) && Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(dataEndIndex) ? data.slice(dataStartIndex, dataEndIndex + 1) : [];
}, _initialiseProps = function() {
var _this7 = this;
this.handleLegendBBoxUpdate = function(box) {
@@ -3174,7 +2925,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var _props5 = _this7.props, syncId = _props5.syncId, layout = _props5.layout, updateId = _this7.state.updateId;
if (syncId === cId && chartId !== _this7.uniqueChartId) {
var dataStartIndex = data.dataStartIndex, dataEndIndex = data.dataEndIndex;
- if (__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(data.dataStartIndex) && __WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(data.dataEndIndex)) if (__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(data.activeTooltipIndex)) _this7.setState(data); else {
+ if (__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(data.dataStartIndex) && __WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(data.dataEndIndex)) if (__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(data.activeTooltipIndex)) _this7.setState(data); else {
var chartX = data.chartX, chartY = data.chartY, activeTooltipIndex = data.activeTooltipIndex, _state10 = _this7.state, offset = _state10.offset, tooltipTicks = _state10.tooltipTicks;
if (!offset) return;
var viewBox = _extends({}, offset, {
@@ -3203,15 +2954,17 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var startIndex = _ref9.startIndex, endIndex = _ref9.endIndex;
if (startIndex !== _this7.state.dataStartIndex || endIndex !== _this7.state.dataEndIndex) {
var updateId = _this7.state.updateId;
- _this7.setState(_extends({
- dataStartIndex: startIndex,
- dataEndIndex: endIndex
- }, _this7.updateStateOfAxisMapsOffsetAndStackGroups({
- props: _this7.props,
- dataStartIndex: startIndex,
- dataEndIndex: endIndex,
- updateId: updateId
- }))), _this7.triggerSyncEvent({
+ _this7.setState(function() {
+ return _extends({
+ dataStartIndex: startIndex,
+ dataEndIndex: endIndex
+ }, _this7.updateStateOfAxisMapsOffsetAndStackGroups({
+ props: _this7.props,
+ dataStartIndex: startIndex,
+ dataEndIndex: endIndex,
+ updateId: updateId
+ }));
+ }), _this7.triggerSyncEvent({
dataStartIndex: startIndex,
dataEndIndex: endIndex
});
@@ -3232,18 +2985,22 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
_this7.setState(nextState), _this7.triggerSyncEvent(nextState), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(onMouseMove) && onMouseMove(nextState, e);
}, this.handleItemMouseEnter = function(el) {
- _this7.setState({
- isTooltipActive: !0,
- activeItem: el,
- activePayload: el.tooltipPayload,
- activeCoordinate: el.tooltipPosition || {
- x: el.cx,
- y: el.cy
- }
+ _this7.setState(function() {
+ return {
+ isTooltipActive: !0,
+ activeItem: el,
+ activePayload: el.tooltipPayload,
+ activeCoordinate: el.tooltipPosition || {
+ x: el.cx,
+ y: el.cy
+ }
+ };
});
}, this.handleItemMouseLeave = function() {
- _this7.setState({
- isTooltipActive: !1
+ _this7.setState(function() {
+ return {
+ isTooltipActive: !1
+ };
});
}, this.handleMouseMove = function(e) {
e && __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(e.persist) && e.persist(),
@@ -3254,7 +3011,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
_this7.setState(nextState), _this7.triggerSyncEvent(nextState), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(onMouseLeave) && onMouseLeave(nextState, e);
}, this.handleOuterEvent = function(e) {
- var eventName = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.l)(e);
+ var eventName = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.l)(e);
if (eventName && __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default()(_this7.props[eventName])) {
var mouse = _this7.getMouseInfo(e);
(0, _this7.props[eventName])(mouse, e);
@@ -3278,8 +3035,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
null != e.changedTouches && e.changedTouches.length > 0 && _this7.handleMouseMove(e.changedTouches[0]);
}, this.verticalCoordinatesGenerator = function(_ref10) {
var xAxis = _ref10.xAxis, width = _ref10.width, height = _ref10.height, offset = _ref10.offset;
- return Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.m)(__WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__.a.getTicks(_extends({}, __WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__.a.defaultProps, xAxis, {
- ticks: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(xAxis, !0),
+ return Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.m)(__WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__.a.getTicks(_extends({}, __WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__.a.defaultProps, xAxis, {
+ ticks: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(xAxis, !0),
viewBox: {
x: 0,
y: 0,
@@ -3289,8 +3046,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
})), offset.left, offset.left + offset.width);
}, this.horizontalCoordinatesGenerator = function(_ref11) {
var yAxis = _ref11.yAxis, width = _ref11.width, height = _ref11.height, offset = _ref11.offset;
- return Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.m)(__WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__.a.getTicks(_extends({}, __WEBPACK_IMPORTED_MODULE_19__cartesian_CartesianAxis__.a.defaultProps, yAxis, {
- ticks: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(yAxis, !0),
+ return Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.m)(__WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__.a.getTicks(_extends({}, __WEBPACK_IMPORTED_MODULE_18__cartesian_CartesianAxis__.a.defaultProps, yAxis, {
+ ticks: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(yAxis, !0),
viewBox: {
x: 0,
y: 0,
@@ -3299,23 +3056,23 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
})), offset.top, offset.top + offset.height);
}, this.axesTicksGenerator = function(axis) {
- return Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(axis, !0);
+ return Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(axis, !0);
}, this.tooltipTicksGenerator = function(axisMap) {
- var axis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(axisMap), tooltipTicks = Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(axis, !1, !0);
+ var axis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(axisMap), tooltipTicks = Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(axis, !1, !0);
return {
tooltipTicks: tooltipTicks,
orderedTooltipTicks: __WEBPACK_IMPORTED_MODULE_0_lodash_sortBy___default()(tooltipTicks, function(o) {
return o.coordinate;
}),
tooltipAxis: axis,
- tooltipAxisBandSize: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.g)(axis)
+ tooltipAxisBandSize: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.g)(axis)
};
}, this.renderCursor = function(element) {
var _state11 = _this7.state, isTooltipActive = _state11.isTooltipActive, activeCoordinate = _state11.activeCoordinate, activePayload = _state11.activePayload, offset = _state11.offset;
if (!(element && element.props.cursor && isTooltipActive && activeCoordinate)) return null;
- var layout = _this7.props.layout, restProps = void 0, cursorComp = __WEBPACK_IMPORTED_MODULE_13__shape_Curve__.a;
- if ("ScatterChart" === chartName) restProps = activeCoordinate, cursorComp = __WEBPACK_IMPORTED_MODULE_14__shape_Cross__.a; else if ("BarChart" === chartName) restProps = _this7.getCursorRectangle(),
- cursorComp = __WEBPACK_IMPORTED_MODULE_17__shape_Rectangle__.a; else if ("radial" === layout) {
+ var layout = _this7.props.layout, restProps = void 0, cursorComp = __WEBPACK_IMPORTED_MODULE_12__shape_Curve__.a;
+ if ("ScatterChart" === chartName) restProps = activeCoordinate, cursorComp = __WEBPACK_IMPORTED_MODULE_13__shape_Cross__.a; else if ("BarChart" === chartName) restProps = _this7.getCursorRectangle(),
+ cursorComp = __WEBPACK_IMPORTED_MODULE_16__shape_Rectangle__.a; else if ("radial" === layout) {
var _getCursorPoints = _this7.getCursorPoints(), cx = _getCursorPoints.cx, cy = _getCursorPoints.cy, radius = _getCursorPoints.radius, startAngle = _getCursorPoints.startAngle, endAngle = _getCursorPoints.endAngle;
restProps = {
cx: cx,
@@ -3324,24 +3081,24 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
endAngle: endAngle,
innerRadius: radius,
outerRadius: radius
- }, cursorComp = __WEBPACK_IMPORTED_MODULE_15__shape_Sector__.a;
+ }, cursorComp = __WEBPACK_IMPORTED_MODULE_14__shape_Sector__.a;
} else restProps = {
points: _this7.getCursorPoints()
- }, cursorComp = __WEBPACK_IMPORTED_MODULE_13__shape_Curve__.a;
+ }, cursorComp = __WEBPACK_IMPORTED_MODULE_12__shape_Curve__.a;
var key = element.key || "_recharts-cursor", cursorProps = _extends({
stroke: "#ccc"
- }, offset, restProps, Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.k)(element.props.cursor), {
+ }, offset, restProps, Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.k)(element.props.cursor), {
payload: activePayload,
key: key,
className: "recharts-tooltip-cursor"
});
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.isValidElement)(element.props.cursor) ? Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element.props.cursor, cursorProps) : Object(__WEBPACK_IMPORTED_MODULE_6_react__.createElement)(cursorComp, cursorProps);
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.isValidElement)(element.props.cursor) ? Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element.props.cursor, cursorProps) : Object(__WEBPACK_IMPORTED_MODULE_5_react__.createElement)(cursorComp, cursorProps);
}, this.renderPolarAxis = function(element, displayName, index) {
var axisType = element.type.axisType, axisMap = _this7.state[axisType + "Map"], axisOption = axisMap[element.props[axisType + "Id"]];
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, _extends({}, axisOption, {
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, _extends({}, axisOption, {
className: axisType,
key: element.key || displayName + "-" + index,
- ticks: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(axisOption, !0)
+ ticks: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(axisOption, !0)
}));
}, this.renderXAxis = function(element, displayName, index) {
var xAxisMap = _this7.state.xAxisMap, axisObj = xAxisMap[element.props.xAxisId];
@@ -3350,13 +3107,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var yAxisMap = _this7.state.yAxisMap, axisObj = yAxisMap[element.props.yAxisId];
return _this7.renderAxis(axisObj, element, displayName, index);
}, this.renderGrid = function(element) {
- var _state12 = _this7.state, xAxisMap = _state12.xAxisMap, yAxisMap = _state12.yAxisMap, offset = _state12.offset, _props6 = _this7.props, width = _props6.width, height = _props6.height, xAxis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(xAxisMap), yAxis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(yAxisMap), props = element.props || {};
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, {
+ var _state12 = _this7.state, xAxisMap = _state12.xAxisMap, yAxisMap = _state12.yAxisMap, offset = _state12.offset, _props6 = _this7.props, width = _props6.width, height = _props6.height, xAxis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(xAxisMap), yAxis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(yAxisMap), props = element.props || {};
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, {
key: element.key || "grid",
- x: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(props.x) ? props.x : offset.left,
- y: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(props.y) ? props.y : offset.top,
- width: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(props.width) ? props.width : offset.width,
- height: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(props.height) ? props.height : offset.height,
+ x: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(props.x) ? props.x : offset.left,
+ y: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(props.y) ? props.y : offset.top,
+ width: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(props.width) ? props.width : offset.width,
+ height: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(props.height) ? props.height : offset.height,
xAxis: xAxis,
yAxis: yAxis,
offset: offset,
@@ -3366,12 +3123,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
horizontalCoordinatesGenerator: _this7.horizontalCoordinatesGenerator
});
}, this.renderPolarGrid = function(element) {
- var _state13 = _this7.state, radiusAxisMap = _state13.radiusAxisMap, angleAxisMap = _state13.angleAxisMap, radiusAxis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(radiusAxisMap), angleAxis = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.b)(angleAxisMap), cx = angleAxis.cx, cy = angleAxis.cy, innerRadius = angleAxis.innerRadius, outerRadius = angleAxis.outerRadius;
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, {
- polarAngles: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(angleAxis, !0).map(function(entry) {
+ var _state13 = _this7.state, radiusAxisMap = _state13.radiusAxisMap, angleAxisMap = _state13.angleAxisMap, radiusAxis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(radiusAxisMap), angleAxis = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.b)(angleAxisMap), cx = angleAxis.cx, cy = angleAxis.cy, innerRadius = angleAxis.innerRadius, outerRadius = angleAxis.outerRadius;
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, {
+ polarAngles: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(angleAxis, !0).map(function(entry) {
return entry.coordinate;
}),
- polarRadius: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.u)(radiusAxis, !0).map(function(entry) {
+ polarRadius: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.u)(radiusAxis, !0).map(function(entry) {
return entry.coordinate;
}),
cx: cx,
@@ -3382,13 +3139,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
});
}, this.renderBrush = function(element) {
var _props7 = _this7.props, margin = _props7.margin, data = _props7.data, _state14 = _this7.state, offset = _state14.offset, dataStartIndex = _state14.dataStartIndex, dataEndIndex = _state14.dataEndIndex, updateId = _state14.updateId;
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, {
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, {
key: element.key || "_recharts-brush",
- onChange: Object(__WEBPACK_IMPORTED_MODULE_23__util_ChartUtils__.d)(_this7.handleBrushChange, null, element.props.onChange),
+ onChange: Object(__WEBPACK_IMPORTED_MODULE_22__util_ChartUtils__.d)(_this7.handleBrushChange, null, element.props.onChange),
data: data,
- x: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(element.props.x) ? element.props.x : offset.left,
- y: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(element.props.y) ? element.props.y : offset.top + offset.height + offset.brushBottom - (margin.bottom || 0),
- width: Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.g)(element.props.width) ? element.props.width : offset.width,
+ x: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(element.props.x) ? element.props.x : offset.left,
+ y: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(element.props.y) ? element.props.y : offset.top + offset.height + offset.brushBottom - (margin.bottom || 0),
+ width: Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.g)(element.props.width) ? element.props.width : offset.width,
startIndex: dataStartIndex,
endIndex: dataEndIndex,
updateId: "brush-" + updateId
@@ -3396,7 +3153,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, this.renderReferenceElement = function(element, displayName, index) {
if (!element) return null;
var _state15 = _this7.state, xAxisMap = _state15.xAxisMap, yAxisMap = _state15.yAxisMap, offset = _state15.offset, _element$props = element.props, xAxisId = _element$props.xAxisId, yAxisId = _element$props.yAxisId;
- return Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, {
+ return Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, {
key: element.key || displayName + "-" + index,
xAxis: xAxisMap[xAxisId],
yAxis: yAxisMap[yAxisId],
@@ -3410,12 +3167,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, this.renderGraphicChild = function(element, displayName, index) {
var item = _this7.filterFormatItem(element, displayName, index);
if (!item) return null;
- var graphicalItem = Object(__WEBPACK_IMPORTED_MODULE_6_react__.cloneElement)(element, item.props), _state16 = _this7.state, isTooltipActive = _state16.isTooltipActive, tooltipAxis = _state16.tooltipAxis, activeTooltipIndex = _state16.activeTooltipIndex, activeLabel = _state16.activeLabel, children = _this7.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_18__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_11__component_Tooltip__.a), _item$props2 = item.props, points = _item$props2.points, isRange = _item$props2.isRange, baseLine = _item$props2.baseLine, _item$item$props2 = item.item.props, activeDot = _item$item$props2.activeDot;
+ var graphicalItem = Object(__WEBPACK_IMPORTED_MODULE_5_react__.cloneElement)(element, item.props), _state16 = _this7.state, isTooltipActive = _state16.isTooltipActive, tooltipAxis = _state16.tooltipAxis, activeTooltipIndex = _state16.activeTooltipIndex, activeLabel = _state16.activeLabel, children = _this7.props.children, tooltipItem = Object(__WEBPACK_IMPORTED_MODULE_17__util_ReactUtils__.i)(children, __WEBPACK_IMPORTED_MODULE_10__component_Tooltip__.a), _item$props2 = item.props, points = _item$props2.points, isRange = _item$props2.isRange, baseLine = _item$props2.baseLine, _item$item$props2 = item.item.props, activeDot = _item$item$props2.activeDot;
if (!_item$item$props2.hide && isTooltipActive && tooltipItem && activeDot && activeTooltipIndex >= 0) {
var activePoint = void 0, basePoint = void 0;
- if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory ? (activePoint = Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.a)(points, "payload." + tooltipAxis.dataKey, activeLabel),
- basePoint = isRange && baseLine && Object(__WEBPACK_IMPORTED_MODULE_22__util_DataUtils__.a)(baseLine, "payload." + tooltipAxis.dataKey, activeLabel)) : (activePoint = points[activeTooltipIndex],
- basePoint = isRange && baseLine && baseLine[activeTooltipIndex]), !__WEBPACK_IMPORTED_MODULE_5_lodash_isNil___default()(activePoint)) return [ graphicalItem ].concat(_toConsumableArray(_this7.renderActivePoints({
+ if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory ? (activePoint = Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.a)(points, "payload." + tooltipAxis.dataKey, activeLabel),
+ basePoint = isRange && baseLine && Object(__WEBPACK_IMPORTED_MODULE_21__util_DataUtils__.a)(baseLine, "payload." + tooltipAxis.dataKey, activeLabel)) : (activePoint = points[activeTooltipIndex],
+ basePoint = isRange && baseLine && baseLine[activeTooltipIndex]), !__WEBPACK_IMPORTED_MODULE_4_lodash_isNil___default()(activePoint)) return [ graphicalItem ].concat(_toConsumableArray(_this7.renderActivePoints({
item: item,
activePoint: activePoint,
basePoint: basePoint,
@@ -3429,7 +3186,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
__webpack_exports__.a = generateCategoricalChart;
}, function(module, exports, __webpack_require__) {
- var aFunction = __webpack_require__(269);
+ var aFunction = __webpack_require__(206);
module.exports = function(fn, that, length) {
if (aFunction(fn), void 0 === that) return fn;
switch (length) {
@@ -3453,7 +3210,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
};
}, function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(50);
+ var isObject = __webpack_require__(35);
module.exports = function(it) {
if (!isObject(it)) throw TypeError(it + " is not an object!");
return it;
@@ -3526,17 +3283,17 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
Object.defineProperty(exports, "__esModule", {
value: !0
});
- var _typeof2 = __webpack_require__(126), _typeof3 = _interopRequireDefault(_typeof2), _keys = __webpack_require__(51), _keys2 = _interopRequireDefault(_keys);
+ var _typeof2 = __webpack_require__(100), _typeof3 = _interopRequireDefault(_typeof2), _keys = __webpack_require__(41), _keys2 = _interopRequireDefault(_keys);
exports.capitalizeFirstLetter = capitalizeFirstLetter, exports.contains = contains,
exports.findIndex = findIndex, exports.find = find, exports.createChainedFunction = createChainedFunction;
- var _warning = __webpack_require__(14), _warning2 = _interopRequireDefault(_warning);
- }).call(exports, __webpack_require__(3));
+ var _warning = __webpack_require__(11), _warning2 = _interopRequireDefault(_warning);
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : void 0;
}
- var baseIsNative = __webpack_require__(869), getValue = __webpack_require__(872);
+ var baseIsNative = __webpack_require__(562), getValue = __webpack_require__(565);
module.exports = getNative;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -3570,7 +3327,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _temp2, __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(28), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__), __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__), __WEBPACK_IMPORTED_MODULE_3_reduce_css_calc__ = __webpack_require__(994), __WEBPACK_IMPORTED_MODULE_3_reduce_css_calc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_reduce_css_calc__), __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__), __WEBPACK_IMPORTED_MODULE_5__util_DataUtils__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_6__util_ReactUtils__ = __webpack_require__(7), __WEBPACK_IMPORTED_MODULE_7__util_DOMUtils__ = __webpack_require__(247), _extends = Object.assign || function(target) {
+ var _class, _temp2, __WEBPACK_IMPORTED_MODULE_0_lodash_isNil__ = __webpack_require__(20), __WEBPACK_IMPORTED_MODULE_0_lodash_isNil___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isNil__), __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__), __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__), __WEBPACK_IMPORTED_MODULE_3_reduce_css_calc__ = __webpack_require__(686), __WEBPACK_IMPORTED_MODULE_3_reduce_css_calc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_reduce_css_calc__), __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__), __WEBPACK_IMPORTED_MODULE_5__util_DataUtils__ = __webpack_require__(9), __WEBPACK_IMPORTED_MODULE_6__util_ReactUtils__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_7__util_DOMUtils__ = __webpack_require__(184), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -3748,7 +3505,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3__util_PureRender__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_4__util_ReactUtils__ = __webpack_require__(7), _extends = Object.assign || function(target) {
+ var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3__util_PureRender__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_4__util_ReactUtils__ = __webpack_require__(4), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -3790,12 +3547,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, _class = _temp)) || _class;
__webpack_exports__.a = Dot;
}, function(module, exports, __webpack_require__) {
- var IObject = __webpack_require__(177), defined = __webpack_require__(179);
+ var IObject = __webpack_require__(135), defined = __webpack_require__(137);
module.exports = function(it) {
return IObject(defined(it));
};
}, function(module, exports, __webpack_require__) {
- var defined = __webpack_require__(179);
+ var defined = __webpack_require__(137);
module.exports = function(it) {
return Object(defined(it));
};
@@ -3834,7 +3591,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
- }(), _warning = __webpack_require__(14), _warning2 = _interopRequireDefault(_warning), _toCss = __webpack_require__(195), _toCss2 = _interopRequireDefault(_toCss), _toCssValue = __webpack_require__(196), _toCssValue2 = _interopRequireDefault(_toCssValue), StyleRule = function() {
+ }(), _warning = __webpack_require__(11), _warning2 = _interopRequireDefault(_warning), _toCss = __webpack_require__(153), _toCss2 = _interopRequireDefault(_toCss), _toCssValue = __webpack_require__(105), _toCssValue2 = _interopRequireDefault(_toCssValue), StyleRule = function() {
function StyleRule(key, style, options) {
_classCallCheck(this, StyleRule), this.type = "style", this.isProcessed = !1;
var sheet = options.sheet, Renderer = options.Renderer, selector = options.selector;
@@ -3896,42 +3653,69 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
} ]), StyleRule;
}();
exports.default = StyleRule;
-}, function(module, __webpack_exports__, __webpack_require__) {
+}, function(module, exports, __webpack_require__) {
"use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry1__ = __webpack_require__(4), always = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry1__.a)(function(val) {
- return function() {
- return val;
- };
+ Object.defineProperty(exports, "__esModule", {
+ value: !0
});
- __webpack_exports__.a = always;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), max = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(a, b) {
- return b > a ? b : a;
- });
- __webpack_exports__.a = max;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), path = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(paths, obj) {
- for (var val = obj, idx = 0; idx < paths.length; ) {
- if (null == val) return;
- val = val[paths[idx]], idx += 1;
+ var _extends = Object.assign || function(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+ for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
- return val;
- });
- __webpack_exports__.a = path;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _contains(a, list) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__indexOf__.a)(list, a, 0) >= 0;
- }
- __webpack_exports__.a = _contains;
- var __WEBPACK_IMPORTED_MODULE_0__indexOf__ = __webpack_require__(316);
+ return target;
+ }, menuSkeletons = [ {
+ id: "home",
+ menu: {
+ title: "Home",
+ icon: "home"
+ }
+ }, {
+ id: "chain",
+ menu: {
+ title: "Chain",
+ icon: "link"
+ }
+ }, {
+ id: "txpool",
+ menu: {
+ title: "TxPool",
+ icon: "credit-card"
+ }
+ }, {
+ id: "network",
+ menu: {
+ title: "Network",
+ icon: "globe"
+ }
+ }, {
+ id: "system",
+ menu: {
+ title: "System",
+ icon: "tachometer"
+ }
+ }, {
+ id: "logs",
+ menu: {
+ title: "Logs",
+ icon: "list"
+ }
+ } ];
+ exports.MENU = new Map(menuSkeletons.map(function(_ref) {
+ var id = _ref.id, menu = _ref.menu;
+ return [ id, _extends({
+ id: id
+ }, menu) ];
+ })), exports.DURATION = 200, exports.styles = {
+ light: {
+ color: "rgba(255, 255, 255, 0.54)"
+ }
+ };
}, function(module, exports, __webpack_require__) {
function isSymbol(value) {
return "symbol" == typeof value || isObjectLike(value) && baseGetTag(value) == symbolTag;
}
- var baseGetTag = __webpack_require__(59), isObjectLike = __webpack_require__(52), symbolTag = "[object Symbol]";
+ var baseGetTag = __webpack_require__(42), isObjectLike = __webpack_require__(36), symbolTag = "[object Symbol]";
module.exports = isSymbol;
}, function(module, exports) {
function identity(value) {
@@ -3963,7 +3747,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _class2, _temp2, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3_react_smooth__ = __webpack_require__(48), __WEBPACK_IMPORTED_MODULE_3_react_smooth___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_smooth__), __WEBPACK_IMPORTED_MODULE_4__util_PureRender__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_5__util_ReactUtils__ = __webpack_require__(7), _extends = Object.assign || function(target) {
+ var _class, _class2, _temp2, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3_react_smooth__ = __webpack_require__(33), __WEBPACK_IMPORTED_MODULE_3_react_smooth___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_smooth__), __WEBPACK_IMPORTED_MODULE_4__util_PureRender__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_5__util_ReactUtils__ = __webpack_require__(4), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -4008,12 +3792,12 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return _inherits(Rectangle, _Component), _createClass(Rectangle, [ {
key: "componentDidMount",
value: function() {
- if (this.node && this.node.getTotalLength) {
+ if (this.node && this.node.getTotalLength) try {
var totalLength = this.node.getTotalLength();
totalLength && this.setState({
totalLength: totalLength
});
- }
+ } catch (err) {}
}
}, {
key: "render",
@@ -4108,7 +3892,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_lodash_isArray__ = __webpack_require__(16), __WEBPACK_IMPORTED_MODULE_0_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(11), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__), __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__), __WEBPACK_IMPORTED_MODULE_4_d3_shape__ = __webpack_require__(235), __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__), __WEBPACK_IMPORTED_MODULE_6__util_PureRender__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_7__util_ReactUtils__ = __webpack_require__(7), __WEBPACK_IMPORTED_MODULE_8__util_DataUtils__ = __webpack_require__(12), _extends = Object.assign || function(target) {
+ var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_lodash_isArray__ = __webpack_require__(12), __WEBPACK_IMPORTED_MODULE_0_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isArray__), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_1_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isFunction__), __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__), __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__), __WEBPACK_IMPORTED_MODULE_4_d3_shape__ = __webpack_require__(173), __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__), __WEBPACK_IMPORTED_MODULE_6__util_PureRender__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_7__util_ReactUtils__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_8__util_DataUtils__ = __webpack_require__(9), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -4222,8 +4006,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
- __webpack_require__(2)), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__util_PureRender__ = __webpack_require__(8), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(7), _createClass = function() {
+ var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
+ __webpack_require__(1)), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__util_PureRender__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(4), _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
@@ -4317,8 +4101,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
- __webpack_require__(2)), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__util_PureRender__ = __webpack_require__(8), _createClass = function() {
+ var _class, _class2, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
+ __webpack_require__(1)), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__util_PureRender__ = __webpack_require__(5), _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
@@ -4445,7 +4229,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
"production" !== process.env.NODE_ENV && (validateFormat = function(format) {
if (void 0 === format) throw new Error("invariant requires an error message argument");
}), module.exports = invariant;
- }).call(exports, __webpack_require__(3));
+ }).call(exports, __webpack_require__(2));
}, function(module, exports) {
module.exports = function(bitmap, value) {
return {
@@ -4456,7 +4240,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
};
}, function(module, exports, __webpack_require__) {
- var $keys = __webpack_require__(272), enumBugKeys = __webpack_require__(183);
+ var $keys = __webpack_require__(209), enumBugKeys = __webpack_require__(141);
module.exports = Object.keys || function(O) {
return $keys(O, enumBugKeys);
};
@@ -4474,7 +4258,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return "@media (min-width:" + ("number" == typeof values[key] ? values[key] : key) + unit + ")";
}
function down(key) {
- return "@media (max-width:" + (("number" == typeof values[key] ? values[key] : key) - step / 100) + unit + ")";
+ var endIndex = keys.indexOf(key) + 1, upperbound = values[keys[endIndex]];
+ return endIndex === keys.length ? up("xs") : "@media (max-width:" + (("number" == typeof upperbound && endIndex > 0 ? upperbound : key) - step / 100) + unit + ")";
}
function between(start, end) {
var endIndex = keys.indexOf(end) + 1;
@@ -4507,13 +4292,13 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.keys = void 0;
- var _extends2 = __webpack_require__(10), _extends3 = _interopRequireDefault(_extends2), _objectWithoutProperties2 = __webpack_require__(9), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
+ var _extends2 = __webpack_require__(7), _extends3 = _interopRequireDefault(_extends2), _objectWithoutProperties2 = __webpack_require__(6), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
exports.default = createBreakpoints;
var keys = exports.keys = [ "xs", "sm", "md", "lg", "xl" ];
}, function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = !0;
- var _getDisplayName = __webpack_require__(289), _getDisplayName2 = function(obj) {
+ var _getDisplayName = __webpack_require__(226), _getDisplayName2 = function(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
@@ -4552,7 +4337,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
- }(), _createRule = __webpack_require__(131), _createRule2 = _interopRequireDefault(_createRule), _linkRule = __webpack_require__(294), _linkRule2 = _interopRequireDefault(_linkRule), _StyleRule = __webpack_require__(77), _StyleRule2 = _interopRequireDefault(_StyleRule), _escape = __webpack_require__(546), _escape2 = _interopRequireDefault(_escape), RuleList = function() {
+ }(), _createRule = __webpack_require__(106), _createRule2 = _interopRequireDefault(_createRule), _linkRule = __webpack_require__(231), _linkRule2 = _interopRequireDefault(_linkRule), _StyleRule = __webpack_require__(60), _StyleRule2 = _interopRequireDefault(_StyleRule), _escape = __webpack_require__(424), _escape2 = _interopRequireDefault(_escape), RuleList = function() {
function RuleList(options) {
_classCallCheck(this, RuleList), this.map = {}, this.raw = {}, this.index = [],
this.options = options, this.classes = options.classes;
@@ -4638,53 +4423,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
} ]), RuleList;
}();
exports.default = RuleList;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__map__ = __webpack_require__(27), __WEBPACK_IMPORTED_MODULE_2__prop__ = __webpack_require__(201), pluck = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(p, list) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__map__.a)(Object(__WEBPACK_IMPORTED_MODULE_2__prop__.a)(p), list);
- });
- __webpack_exports__.a = pluck;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _isString(x) {
- return "[object String]" === Object.prototype.toString.call(x);
- }
- __webpack_exports__.a = _isString;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function _checkForMethod(methodname, fn) {
- return function() {
- var length = arguments.length;
- if (0 === length) return fn();
- var obj = arguments[length - 1];
- return Object(__WEBPACK_IMPORTED_MODULE_0__isArray__.a)(obj) || "function" != typeof obj[methodname] ? fn.apply(this, arguments) : obj[methodname].apply(obj, Array.prototype.slice.call(arguments, 0, length - 1));
- };
- }
- __webpack_exports__.a = _checkForMethod;
- var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(57);
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry1__ = __webpack_require__(4), __WEBPACK_IMPORTED_MODULE_1__internal_toString__ = __webpack_require__(604), toString = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry1__.a)(function(val) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__internal_toString__.a)(val, []);
- });
- __webpack_exports__.a = toString;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__internal_isString__ = __webpack_require__(98), nth = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(offset, list) {
- var idx = offset < 0 ? list.length + offset : offset;
- return Object(__WEBPACK_IMPORTED_MODULE_1__internal_isString__.a)(list) ? list.charAt(idx) : list[idx];
- });
- __webpack_exports__.a = nth;
-}, function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var __WEBPACK_IMPORTED_MODULE_0__internal_curry2__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__internal_isFunction__ = __webpack_require__(140), __WEBPACK_IMPORTED_MODULE_2__curryN__ = __webpack_require__(23), __WEBPACK_IMPORTED_MODULE_3__toString__ = __webpack_require__(100), invoker = Object(__WEBPACK_IMPORTED_MODULE_0__internal_curry2__.a)(function(arity, method) {
- return Object(__WEBPACK_IMPORTED_MODULE_2__curryN__.a)(arity + 1, function() {
- var target = arguments[arity];
- if (null != target && Object(__WEBPACK_IMPORTED_MODULE_1__internal_isFunction__.a)(target[method])) return target[method].apply(target, Array.prototype.slice.call(arguments, 0, arity));
- throw new TypeError(Object(__WEBPACK_IMPORTED_MODULE_3__toString__.a)(target) + ' does not have a method named "' + method + '"');
- });
- });
- __webpack_exports__.a = invoker;
+}, function(module, exports, __webpack_require__) {
+ var root = __webpack_require__(32), Symbol = root.Symbol;
+ module.exports = Symbol;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function _objectWithoutProperties(obj, keys) {
@@ -4708,7 +4449,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
version: "1.1"
}), children);
}
- var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(6), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(7), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(3), __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(4), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -4728,12 +4469,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([ __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node ])
};
Surface.propTypes = propTypes, __webpack_exports__.a = Surface;
-}, function(module, exports, __webpack_require__) {
- var root = __webpack_require__(46), Symbol = root.Symbol;
- module.exports = Symbol;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
- var __WEBPACK_IMPORTED_MODULE_0__src_path__ = __webpack_require__(891);
+ var __WEBPACK_IMPORTED_MODULE_0__src_path__ = __webpack_require__(584);
__webpack_require__.d(__webpack_exports__, "a", function() {
return __WEBPACK_IMPORTED_MODULE_0__src_path__.a;
});
@@ -4785,21 +4523,21 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
function isArrayLike(value) {
return null != value && isLength(value.length) && !isFunction(value);
}
- var isFunction = __webpack_require__(11), isLength = __webpack_require__(244);
+ var isFunction = __webpack_require__(8), isLength = __webpack_require__(182);
module.exports = isArrayLike;
}, function(module, exports, __webpack_require__) {
function baseIteratee(value) {
return "function" == typeof value ? value : null == value ? identity : "object" == typeof value ? isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value) : property(value);
}
- var baseMatches = __webpack_require__(976), baseMatchesProperty = __webpack_require__(979), identity = __webpack_require__(83), isArray = __webpack_require__(16), property = __webpack_require__(983);
+ var baseMatches = __webpack_require__(669), baseMatchesProperty = __webpack_require__(672), identity = __webpack_require__(63), isArray = __webpack_require__(12), property = __webpack_require__(676);
module.exports = baseIteratee;
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function Cell() {
return null;
}
- var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1__util_ReactUtils__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
- __webpack_require__(7)), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_1__util_ReactUtils__ = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),
+ __webpack_require__(4)), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -4842,29 +4580,29 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}, linearish(scale);
}
__webpack_exports__.b = linearish, __webpack_exports__.a = linear;
- var __WEBPACK_IMPORTED_MODULE_0_d3_array__ = __webpack_require__(53), __WEBPACK_IMPORTED_MODULE_1_d3_interpolate__ = __webpack_require__(114), __WEBPACK_IMPORTED_MODULE_2__continuous__ = __webpack_require__(168), __WEBPACK_IMPORTED_MODULE_3__tickFormat__ = __webpack_require__(1050);
+ var __WEBPACK_IMPORTED_MODULE_0_d3_array__ = __webpack_require__(37), __WEBPACK_IMPORTED_MODULE_1_d3_interpolate__ = __webpack_require__(88), __WEBPACK_IMPORTED_MODULE_2__continuous__ = __webpack_require__(126), __WEBPACK_IMPORTED_MODULE_3__tickFormat__ = __webpack_require__(742);
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
- var __WEBPACK_IMPORTED_MODULE_0__src_value__ = __webpack_require__(250);
+ var __WEBPACK_IMPORTED_MODULE_0__src_value__ = __webpack_require__(187);
__webpack_require__.d(__webpack_exports__, "a", function() {
return __WEBPACK_IMPORTED_MODULE_0__src_value__.a;
});
- var __WEBPACK_IMPORTED_MODULE_5__src_number__ = (__webpack_require__(426), __webpack_require__(253),
- __webpack_require__(424), __webpack_require__(427), __webpack_require__(167));
+ var __WEBPACK_IMPORTED_MODULE_5__src_number__ = (__webpack_require__(305), __webpack_require__(190),
+ __webpack_require__(303), __webpack_require__(306), __webpack_require__(125));
__webpack_require__.d(__webpack_exports__, "c", function() {
return __WEBPACK_IMPORTED_MODULE_5__src_number__.a;
});
- var __WEBPACK_IMPORTED_MODULE_7__src_round__ = (__webpack_require__(428), __webpack_require__(1040));
+ var __WEBPACK_IMPORTED_MODULE_7__src_round__ = (__webpack_require__(307), __webpack_require__(732));
__webpack_require__.d(__webpack_exports__, "d", function() {
return __WEBPACK_IMPORTED_MODULE_7__src_round__.a;
});
- var __WEBPACK_IMPORTED_MODULE_15__src_cubehelix__ = (__webpack_require__(429), __webpack_require__(1041),
- __webpack_require__(1044), __webpack_require__(423), __webpack_require__(1045),
- __webpack_require__(1046), __webpack_require__(1047), __webpack_require__(1048));
+ var __WEBPACK_IMPORTED_MODULE_15__src_cubehelix__ = (__webpack_require__(308), __webpack_require__(733),
+ __webpack_require__(736), __webpack_require__(302), __webpack_require__(737), __webpack_require__(738),
+ __webpack_require__(739), __webpack_require__(740));
__webpack_require__.d(__webpack_exports__, "b", function() {
return __WEBPACK_IMPORTED_MODULE_15__src_cubehelix__.a;
});
- __webpack_require__(1049);
+ __webpack_require__(741);
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
function linear(a, d) {
@@ -4891,7 +4629,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return d ? linear(a, d) : Object(__WEBPACK_IMPORTED_MODULE_0__constant__.a)(isNaN(a) ? b : a);
}
__webpack_exports__.c = hue, __webpack_exports__.b = gamma, __webpack_exports__.a = nogamma;
- var __WEBPACK_IMPORTED_MODULE_0__constant__ = __webpack_require__(425);
+ var __WEBPACK_IMPORTED_MODULE_0__constant__ = __webpack_require__(304);
}, function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_exports__.a = function(s) {
@@ -4924,7 +4662,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
- var _class, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__container_Layer__ = __webpack_require__(18), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(7), _extends = Object.assign || function(target) {
+ var _class, _temp, __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0), __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__), __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1), __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__), __WEBPACK_IMPORTED_MODULE_2__container_Layer__ = __webpack_require__(14), __WEBPACK_IMPORTED_MODULE_3__util_ReactUtils__ = __webpack_require__(4), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -5035,7 +4773,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
__webpack_require__.d(__webpack_exports__, "a", function() {
return formatAxisMap;
});
- var __WEBPACK_IMPORTED_MODULE_0__ChartUtils__ = __webpack_require__(21), _extends = Object.assign || function(target) {
+ var __WEBPACK_IMPORTED_MODULE_0__ChartUtils__ = __webpack_require__(16), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
@@ -5082,11 +4820,11 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
(function(process) {
var emptyObject = {};
"production" !== process.env.NODE_ENV && Object.freeze(emptyObject), module.exports = emptyObject;
- }).call(exports, __webpack_require__(3));
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
"use strict";
(function(process) {
- var emptyFunction = __webpack_require__(55), warning = emptyFunction;
+ var emptyFunction = __webpack_require__(39), warning = emptyFunction;
if ("production" !== process.env.NODE_ENV) {
var printWarning = function(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
@@ -5107,7 +4845,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
}
module.exports = warning;
- }).call(exports, __webpack_require__(3));
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
"use strict";
(function(process) {
@@ -5121,8 +4859,8 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
}
}
}
- "production" === process.env.NODE_ENV ? (checkDCE(), module.exports = __webpack_require__(456)) : module.exports = __webpack_require__(459);
- }).call(exports, __webpack_require__(3));
+ "production" === process.env.NODE_ENV ? (checkDCE(), module.exports = __webpack_require__(334)) : module.exports = __webpack_require__(337);
+ }).call(exports, __webpack_require__(2));
}, function(module, exports, __webpack_require__) {
"use strict";
function is(x, y) {
@@ -5139,7 +4877,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = shallowEqual;
}, function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__(180), min = Math.min;
+ var toInteger = __webpack_require__(138), min = Math.min;
module.exports = function(it) {
return it > 0 ? min(toInteger(it), 9007199254740991) : 0;
};
@@ -5158,7 +4896,7 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
};
}
exports.__esModule = !0;
- var _iterator = __webpack_require__(474), _iterator2 = _interopRequireDefault(_iterator), _symbol = __webpack_require__(482), _symbol2 = _interopRequireDefault(_symbol), _typeof = "function" == typeof _symbol2.default && "symbol" == typeof _iterator2.default ? function(obj) {
+ var _iterator = __webpack_require__(352), _iterator2 = _interopRequireDefault(_iterator), _symbol = __webpack_require__(360), _symbol2 = _interopRequireDefault(_symbol), _typeof = "function" == typeof _symbol2.default && "symbol" == typeof _iterator2.default ? function(obj) {
return typeof obj;
} : function(obj) {
return obj && "function" == typeof _symbol2.default && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj;
@@ -5169,9 +4907,9 @@ var _publicBundleJs = []byte((((((((((`!function(modules) {
return obj && "function" == typeof _symbol2.default && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : void 0 === obj ? "undefined" : _typeof(obj);
};
}, function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(65), dPs = __webpack_require__(478), enumBugKeys = __webpack_require__(183), IE_PROTO = __webpack_require__(181)("IE_PROTO"), Empty = function() {}, createDict = function() {
- var iframeDocument, iframe = __webpack_require__(271)("iframe"), i = enumBugKeys.length;
- for (iframe.style.display = "none", __webpack_require__(479).appendChild(iframe),
+ var anObject = __webpack_require__(48), dPs = __webpack_require__(356), enumBugKeys = __webpack_require__(141), IE_PROTO = __webpack_require__(139)("IE_PROTO"), Empty = function() {}, createDict = function() {
+ var iframeDocument, iframe = __webpack_require__(208)("iframe"), i = enumBugKeys.length;
+ for (iframe.style.display = "none", __webpack_require__(357).appendChild(iframe),
iframe.src = "javascript:", iframeDocument = iframe.contentWindow.document, iframeDocument.open(),
iframeDocument.write("
-