Documentation ¶
Index ¶
- func DecryptPayload(ctx context.Context, tx *types.Transaction, client *rpc.Client) ([]byte, error)
- func IsPrivateTx(tx *types.Transaction) bool
- func NewPrivateTransactor(hc *http.Client, key *ecdsa.PrivateKey, enclaveURL string) *bind.TransactOpts
- func RestoreTxToSignedForm(tx *types.Transaction) *types.Transaction
- type PrivateTxClient
- func DialHTTP(rawurl string, privateFor []string, quorumEnclave string) (*PrivateTxClient, error)
- func DialHTTPWithClient(rawurl string, privateFor []string, quorumEnclave string, hc *http.Client) (*PrivateTxClient, error)
- func NewClient(c *rpc.Client, hc *http.Client, privateFor []string, quorumEnclave string) *PrivateTxClient
- func (ec *PrivateTxClient) DecryptPayload(ctx context.Context, tx *types.Transaction) (bs []byte, err error)
- func (ec *PrivateTxClient) GetSenderPublicKey(t *types.Transaction) (*ecdsa.PublicKey, error)
- func (ec *PrivateTxClient) NewKeyedTransactor(key *ecdsa.PrivateKey) *bind.TransactOpts
- func (ec *PrivateTxClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptPayload ¶
DecryptPayload decrypts Quorum's private transaction.
It uses private data hash from "input" field and replaces it with decoded data that comes from calling `eth_getQuorumPayload` RPC method. Provided backend object must be connected to Quorum node which is a party to this private tx.
func IsPrivateTx ¶
func IsPrivateTx(tx *types.Transaction) bool
IsPrivateTx checks whether given transaction is Quorum's private TX Tx is private when V value is 37 or 38
func NewPrivateTransactor ¶
func NewPrivateTransactor(hc *http.Client, key *ecdsa.PrivateKey, enclaveURL string) *bind.TransactOpts
NewPrivateTransactor is a utility method to easily create a transaction signer from a single private key for Quorum private transactions.
func RestoreTxToSignedForm ¶
func RestoreTxToSignedForm(tx *types.Transaction) *types.Transaction
RestoreTxToSignedForm restores private transaction, retrieved from Quorum, to the form, which resulted after transaction signing. This includes modifying transaction's `v` field to its original value (because it is modified for private transactions) so that it would be possible to recover sender's public key from transaction data.
Types ¶
type PrivateTxClient ¶
PrivateTxClient is a client to work with Quorum's private transactions
func DialHTTP ¶
func DialHTTP(rawurl string, privateFor []string, quorumEnclave string) (*PrivateTxClient, error)
DialHTTP connects a client to the given URL using provided context.
func DialHTTPWithClient ¶
func DialHTTPWithClient(rawurl string, privateFor []string, quorumEnclave string, hc *http.Client) (*PrivateTxClient, error)
DialHTTPWithClient connects a client to the given URL using provided context and uses given HTTP client for internal http requests.
func NewClient ¶
func NewClient(c *rpc.Client, hc *http.Client, privateFor []string, quorumEnclave string) *PrivateTxClient
NewClient creates a client that uses the given RPC client.
func (*PrivateTxClient) DecryptPayload ¶
func (ec *PrivateTxClient) DecryptPayload(ctx context.Context, tx *types.Transaction) (bs []byte, err error)
DecryptPayload decrypts transaction payload.
func (*PrivateTxClient) GetSenderPublicKey ¶
func (ec *PrivateTxClient) GetSenderPublicKey(t *types.Transaction) (*ecdsa.PublicKey, error)
GetSenderPublicKey retrieves public key of sender from transaction.
func (*PrivateTxClient) NewKeyedTransactor ¶
func (ec *PrivateTxClient) NewKeyedTransactor(key *ecdsa.PrivateKey) *bind.TransactOpts
NewKeyedTransactor is a utility method to easily create a transaction signer from a single private key.
func (*PrivateTxClient) SendTransaction ¶
func (ec *PrivateTxClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
SendTransaction injects a signed private transaction into the pending pool for execution.
If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.