Skip to content

Commit

Permalink
quorum: add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bailantaotao committed Nov 12, 2017
1 parent 1f4ccf7 commit 6eded1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions quorum/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import (
ethClient "github.com/getamis/eth-client/client"
)

// client defines typed wrappers for the eth-client.
type client struct {
ethClient.Client
rpc *rpc.Client
}

// Dial connects a client to the given URL.
func Dial(rawurl string) (Client, error) {
rc, err := rpc.Dial(rawurl)
if err != nil {
Expand All @@ -45,6 +47,7 @@ func Dial(rawurl string) (Client, error) {
return c, nil
}

// CreateContract creates a contract with the given parameters.
func (c *client) CreateContract(ctx context.Context, from common.Address, bytecode string, gas *big.Int) (txHash string, err error) {
var hex hexutil.Bytes
arg := map[string]interface{}{
Expand All @@ -58,6 +61,8 @@ func (c *client) CreateContract(ctx context.Context, from common.Address, byteco
return
}

// CreatePrivateContract creates a private contract with the given parameters. The related information can refer
// to https://github.com/jpmorganchase/quorum/wiki/Using-Quorum#creating-private-transactionscontracts.
func (c *client) CreatePrivateContract(ctx context.Context, from common.Address, bytecode string, gas *big.Int, privateFor []string) (txHash string, err error) {
var hex hexutil.Bytes
arg := map[string]interface{}{
Expand Down

0 comments on commit 6eded1f

Please sign in to comment.