diff --git a/core/private_state_test.go b/core/private_state_test.go index 787738aac..7d7129eb8 100644 --- a/core/private_state_test.go +++ b/core/private_state_test.go @@ -20,7 +20,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/private" - "github.com/ethereum/go-ethereum/private/constellation" + "github.com/ethereum/go-ethereum/private/privatetransactionmanager" ) // callmsg is the message type used for call transactions in the private state test @@ -128,7 +128,7 @@ func runConstellation() (*osExec.Cmd, error) { if constellationErr != nil { return nil, constellationErr } - private.P = constellation.MustNew(cfgFile.Name()) + private.P = privatetransactionmanager.MustNew(cfgFile.Name()) return constellationCmd, nil } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 27c03235c..a8b7452c6 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1784,12 +1784,12 @@ func (s *PublicTransactionPoolAPI) send(ctx context.Context, asyncArgs AsyncSend buf := new(bytes.Buffer) err := json.NewEncoder(buf).Encode(resultResponse) if err != nil { - log.Info("Error encoding callback JSON: %v", err) + log.Info("Error encoding callback JSON", "err", err.Error()) return } _, err = http.Post(asyncArgs.CallbackUrl, "application/json", buf) if err != nil { - log.Info("Error sending callback: %v", err) + log.Info("Error sending callback", "err", err.Error()) return } } diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 5ec9ff8ca..a0e9eae0b 100755 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -501,7 +501,21 @@ web3._extend({ call: 'eth_storageRoot', params: 2, inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] - }) + }), + // QUORUM + new web3._extend.Method({ + name: 'sendTransactionAsync', + call: 'eth_sendTransactionAsync', + params: 1, + inputFormatter: [web3._extend.formatters.inputTransactionFormatter] + }), + new web3._extend.Method({ + name: 'getQuorumPayload', + call: 'eth_getQuorumPayload', + params: 1, + inputFormatter: [null] + }), + // END-QUORUM ], properties: [ new web3._extend.Property({ diff --git a/private/private.go b/private/private.go index bcbad08da..7f1bd734d 100644 --- a/private/private.go +++ b/private/private.go @@ -3,7 +3,7 @@ package private import ( "os" - "github.com/ethereum/go-ethereum/private/constellation" + "github.com/ethereum/go-ethereum/private/privatetransactionmanager" ) type PrivateTransactionManager interface { @@ -17,7 +17,7 @@ func FromEnvironmentOrNil(name string) PrivateTransactionManager { if cfgPath == "" { return nil } - return constellation.MustNew(cfgPath) + return privatetransactionmanager.MustNew(cfgPath) } var P = FromEnvironmentOrNil("PRIVATE_CONFIG") diff --git a/private/constellation/config.go b/private/privatetransactionmanager/config.go similarity index 93% rename from private/constellation/config.go rename to private/privatetransactionmanager/config.go index dba0fe32e..ec9643483 100644 --- a/private/constellation/config.go +++ b/private/privatetransactionmanager/config.go @@ -1,4 +1,4 @@ -package constellation +package privatetransactionmanager import ( "github.com/BurntSushi/toml" diff --git a/private/constellation/node.go b/private/privatetransactionmanager/node.go similarity index 96% rename from private/constellation/node.go rename to private/privatetransactionmanager/node.go index 50c7ed566..f9af70c9c 100644 --- a/private/constellation/node.go +++ b/private/privatetransactionmanager/node.go @@ -1,4 +1,4 @@ -package constellation +package privatetransactionmanager import ( "bytes" @@ -56,7 +56,7 @@ func RunNode(socketPath string) error { if res.StatusCode == 200 { return nil } - return errors.New("Constellation Node API did not respond to upcheck request") + return errors.New("private transaction manager did not respond to upcheck request") } type Client struct { diff --git a/private/constellation/constellation.go b/private/privatetransactionmanager/tx_manager.go similarity index 56% rename from private/constellation/constellation.go rename to private/privatetransactionmanager/tx_manager.go index aaa597f7f..1a1107e1b 100644 --- a/private/constellation/constellation.go +++ b/private/privatetransactionmanager/tx_manager.go @@ -1,4 +1,4 @@ -package constellation +package privatetransactionmanager import ( "errors" @@ -11,18 +11,18 @@ import ( "github.com/patrickmn/go-cache" ) -type Constellation struct { - node *Client - c *cache.Cache - isConstellationNotInUse bool +type PrivateTransactionManager struct { + node *Client + c *cache.Cache + isPrivateTransactionManagerNotInUse bool } var ( errPrivateTransactionManagerNotUsed = errors.New("private transaction manager not in use") ) -func (g *Constellation) Send(data []byte, from string, to []string) (out []byte, err error) { - if g.isConstellationNotInUse { +func (g *PrivateTransactionManager) Send(data []byte, from string, to []string) (out []byte, err error) { + if g.isPrivateTransactionManagerNotInUse { return nil, errPrivateTransactionManagerNotUsed } out, err = g.node.SendPayload(data, from, to) @@ -33,8 +33,8 @@ func (g *Constellation) Send(data []byte, from string, to []string) (out []byte, return out, nil } -func (g *Constellation) SendSignedTx(data []byte, to []string) (out []byte, err error) { - if g.isConstellationNotInUse { +func (g *PrivateTransactionManager) SendSignedTx(data []byte, to []string) (out []byte, err error) { + if g.isPrivateTransactionManagerNotInUse { return nil, errPrivateTransactionManagerNotUsed } out, err = g.node.SendSignedPayload(data, to) @@ -44,8 +44,8 @@ func (g *Constellation) SendSignedTx(data []byte, to []string) (out []byte, err return out, nil } -func (g *Constellation) Receive(data []byte) ([]byte, error) { - if g.isConstellationNotInUse { +func (g *PrivateTransactionManager) Receive(data []byte) ([]byte, error) { + if g.isPrivateTransactionManagerNotInUse { return nil, nil } if len(data) == 0 { @@ -65,7 +65,7 @@ func (g *Constellation) Receive(data []byte) ([]byte, error) { return pl, nil } -func New(path string) (*Constellation, error) { +func New(path string) (*PrivateTransactionManager, error) { info, err := os.Lstat(path) if err != nil { return nil, err @@ -88,24 +88,24 @@ func New(path string) (*Constellation, error) { if err != nil { return nil, err } - return &Constellation{ - node: n, - c: cache.New(5*time.Minute, 5*time.Minute), - isConstellationNotInUse: false, + return &PrivateTransactionManager{ + node: n, + c: cache.New(5*time.Minute, 5*time.Minute), + isPrivateTransactionManagerNotInUse: false, }, nil } -func MustNew(path string) *Constellation { +func MustNew(path string) *PrivateTransactionManager { if strings.EqualFold(path, "ignore") { - return &Constellation{ - node: nil, - c: nil, - isConstellationNotInUse: true, + return &PrivateTransactionManager{ + node: nil, + c: nil, + isPrivateTransactionManagerNotInUse: true, } } g, err := New(path) if err != nil { - panic(fmt.Sprintf("MustNew: Failed to connect to Constellation (%s): %v", path, err)) + panic(fmt.Sprintf("MustNew: Failed to connect to private transaction manager (%s): %v", path, err)) } return g }