Skip to content

Commit

Permalink
Tx receipt contract info (#212)
Browse files Browse the repository at this point in the history
* added contract name and tag to tx receipt

* bumping version

* upgrade package.json

* revent alpha compatible versions for SDK
  • Loading branch information
ggarri authored Dec 15, 2021
1 parent 6aa3ffa commit 59184c8
Show file tree
Hide file tree
Showing 10 changed files with 698 additions and 298 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ All notable changes to this project will be documented in this file.
### 🆕 Features

- Support for new transaction pricing mechanism (eip-1559)
- Support for go-quorum privacy privacy enhancements: `privacyFlags`, `mandatoryFor`
- Support for go-quorum private transaction with optional `privateFrom`.
- Support for contract name and tag in transaction receipts

### ⚠ BREAKING CHANGES

Expand Down
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ The Orchestrate library provides convenient access to the Orchestrate API from a

## Compatibility

| SDK versions | Orchestrate versions |
| ------------------- | ------------------------------ |
| master/HEAD | Orchestrate v21.10.0 or higher |
| SDK v5.0.x | Orchestrate v21.10.0 higher |
| SDK v4.1.x | Orchestrate v21.1.5 or higher |
| SDK v4.0.x | Orchestrate v21.1.0 or higher |
| SDK v3.1.1 | Orchestrate v2.4 or higher |
| SDK v3.1.x | Orchestrate v2.3 or higher |
| SDK v3.0.x | Orchestrate v2.3-rcX |
| SDK v2.3.x | Orchestrate v2.1 or higher |
| SDK v2.2.x | Orchestrate v2.1 or higher |
| SDK v2.1.x | Orchestrate v2.1 or higher |
| SDK v2.0.x | Orchestrate v2.0 |
| SDK v1.0.x or lower | Orchestrate v1.0 or lower |
| SDK versions | Orchestrate versions |
| ------------------- | ------------------------------------- |
| master/HEAD | Orchestrate v21.11.0-alpha2 or higher |
| SDK v5.2.x | Orchestrate v21.11.0-alpha2 or higher |
| SDK v5.1.x | Orchestrate v21.10.0-alpha3 or higher |
| SDK v5.0.x | Orchestrate v21.10.0-alpha1 or higher |
| SDK v4.1.x | Orchestrate v21.1.5 or higher |
| SDK v4.0.x | Orchestrate v21.1.0 or higher |
| SDK v3.1.1 | Orchestrate v2.4 or higher |
| SDK v3.1.x | Orchestrate v2.3 or higher |
| SDK v3.0.x | Orchestrate v2.3-rcX |
| SDK v2.3.x | Orchestrate v2.1 or higher |
| SDK v2.2.x | Orchestrate v2.1 or higher |
| SDK v2.1.x | Orchestrate v2.1 or higher |
| SDK v2.0.x | Orchestrate v2.0 |
| SDK v1.0.x or lower | Orchestrate v1.0 or lower |

## Orchestrate documentation

Expand Down
436 changes: 218 additions & 218 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pegasys-orchestrate",
"version": "5.1.0",
"version": "5.0.0",
"description": "The PegaSys Orchestrate library provides convenient access to the Codefi Orchestrate API from applications written in server-side JavaScript",
"main": "lib/index.js",
"files": [
Expand Down
14 changes: 11 additions & 3 deletions proto/ethereum/receipt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,26 @@ message Receipt {
// PRIVATE TX FIELDS //
///////////////////////

// DATA - RLP-encoded return value of a contract call for Orion Priv Tx
// DATA - RLP-encoded return value of a contract call for EEA Priv Tx
// Provisional till we migrate to TransactionManager Jobs
string output = 16;

// DATA (32 bytes) - Orion public key of the sender.
// DATA (32 bytes) - EEA public key of the sender.
// e.g A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=
string privateFrom = 17;

// e.g [Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=]
repeated string privateFor = 18;

// DATA (32 bytes) - Orion public keys or privacy group ID of the recipients.
// DATA (32 bytes) - EEA public keys or privacy group ID of the recipients.
// e.g Ko2bVqD+nNlNYL5EE7y3IdOnviftjiizpjRt+HTuFBs=
string privacyGroupId = 19;

///////////////////////
// CONTRACT ADDON //
///////////////////////

string contract_name = 20;

string contract_tag = 21;
}
57 changes: 43 additions & 14 deletions proto/tx/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ message TxRequest {

// [option]
map<string, string> context_labels = 6;

// Type of the job
JobType jobType = 7;
}

message TxEnvelope {
Expand All @@ -49,10 +52,19 @@ enum Method {
// Quorum Tessera
ETH_SENDRAWPRIVATETRANSACTION = 2;

// Besu Orion
// Besu EEA
EEA_SENDPRIVATETRANSACTION = 3;
}

enum JobType {
ETH_TX = 0;
ETH_RAW_TX = 1;
ETH_EEA_MARKING_TX = 2;
ETH_EEA_PRIVATE_TX = 3;
ETH_TESSERA_MARKING_TX = 4;
ETH_TESSERA_PRIVATE_TX = 5;
}

message Params {
// Sender of the transaction - Ethereum Account Address
// e.g 0xAf84242d70aE9D268E2bE3616ED497BA28A7b62C
Expand All @@ -69,38 +81,56 @@ message Params {
// e.g 0xaf23b
string gas_price = 5;

string gas_fee_cap = 6;

string gas_tip_cap = 7;

// Integer of the value sent with this transaction.
// e.g 0xaf23
string value = 6;
string value = 8;

// Integer of a nonce.
string nonce = 7;
string nonce = 9;

// Hash of the method signature (4 bytes) followed by encoded parameters.
// e.g 0xa9059cbb000000000000000000000000ff778b716fc07d98839f48ddb88d8be583beb684000000000000000000000000000000000000000000000000002386f26fc10000
string data = 8;
string data = 10;

string transaction_type = 11;

repeated ethereum.AccessTuple access_list = 12;

// The signed, RLP encoded transaction
string raw = 13;

//***********
// ADDITIONAL CONTRACT FIELD DATA
//***********
// Contract identifier
// e.g. "ERC20[v1.0.0]"
string contract = 9;
string contract = 14;

// Signature of the method to call on contract
// e.g "transfer(address,uint256)"
string method_signature = 10;
string method_signature = 15;

// Arguments to feed on transaction call
repeated string args = 11;
repeated string args = 16;

// The signed, RLP encoded transaction
string raw = 12;
//***********
// PRIVATE ONLY FIELDS
//***********
repeated string private_for = 17;

string private_from = 18;

repeated string private_for = 13;
string private_tx_type = 19;

string private_from = 14;
string privacy_group_id = 20;

string private_tx_type = 15;
repeated string mandatory_for = 21;

string privacy_group_id = 16;
int32 privacy_flag = 22;
}

message TxResponse {
Expand All @@ -120,7 +150,6 @@ message TxResponse {

ethereum.Transaction transaction = 4;
ethereum.Receipt receipt = 5;

// Name of the Chain as registered on the chain registry
// e.g. 1 for mainnet, 3 for Ropsten
string chain = 7;
Expand Down
4 changes: 3 additions & 1 deletion src/kafka/helpers/unmarshallers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ function parseReceipt(receipt?: ethereum.IReceipt | null): IReceipt | undefined
output: parseString(receipt.output),
privateFrom: parseString(receipt.privateFrom),
privateFor: receipt.privateFor ? receipt.privateFor : undefined,
privacyGroupId: parseString(receipt.privacyGroupId)
privacyGroupId: parseString(receipt.privacyGroupId),
contractName: parseString(receipt.contractName),
contractTag: parseString(receipt.contractTag)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/kafka/types/IReceipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export interface IReceipt {
privateFrom?: string
privateFor?: string[]
privacyGroupId?: string
contractName?: string
contractTag?: string
}
76 changes: 70 additions & 6 deletions src/stubs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6190,6 +6190,12 @@ export namespace ethereum {

/** Receipt privacyGroupId */
privacyGroupId?: (string|null);

/** Receipt contractName */
contractName?: (string|null);

/** Receipt contractTag */
contractTag?: (string|null);
}

/** Represents a Receipt. */
Expand Down Expand Up @@ -6252,6 +6258,12 @@ export namespace ethereum {
/** Receipt privacyGroupId. */
public privacyGroupId: string;

/** Receipt contractName. */
public contractName: string;

/** Receipt contractTag. */
public contractTag: string;

/**
* Creates a new Receipt instance using the specified properties.
* @param [properties] Properties to set
Expand Down Expand Up @@ -6605,6 +6617,9 @@ export namespace tx {

/** TxRequest contextLabels */
contextLabels?: ({ [k: string]: string }|null);

/** TxRequest jobType */
jobType?: (tx.JobType|null);
}

/** Represents a TxRequest. */
Expand Down Expand Up @@ -6634,6 +6649,9 @@ export namespace tx {
/** TxRequest contextLabels. */
public contextLabels: { [k: string]: string };

/** TxRequest jobType. */
public jobType: tx.JobType;

/**
* Creates a new TxRequest instance using the specified properties.
* @param [properties] Properties to set
Expand Down Expand Up @@ -6818,6 +6836,16 @@ export namespace tx {
EEA_SENDPRIVATETRANSACTION = 3
}

/** JobType enum. */
enum JobType {
ETH_TX = 0,
ETH_RAW_TX = 1,
ETH_EEA_MARKING_TX = 2,
ETH_EEA_PRIVATE_TX = 3,
ETH_TESSERA_MARKING_TX = 4,
ETH_TESSERA_PRIVATE_TX = 5
}

/** Properties of a Params. */
interface IParams {

Expand All @@ -6833,6 +6861,12 @@ export namespace tx {
/** Params gasPrice */
gasPrice?: (string|null);

/** Params gasFeeCap */
gasFeeCap?: (string|null);

/** Params gasTipCap */
gasTipCap?: (string|null);

/** Params value */
value?: (string|null);

Expand All @@ -6842,6 +6876,15 @@ export namespace tx {
/** Params data */
data?: (string|null);

/** Params transactionType */
transactionType?: (string|null);

/** Params accessList */
accessList?: (ethereum.IAccessTuple[]|null);

/** Params raw */
raw?: (string|null);

/** Params contract */
contract?: (string|null);

Expand All @@ -6851,9 +6894,6 @@ export namespace tx {
/** Params args */
args?: (string[]|null);

/** Params raw */
raw?: (string|null);

/** Params privateFor */
privateFor?: (string[]|null);

Expand All @@ -6865,6 +6905,12 @@ export namespace tx {

/** Params privacyGroupId */
privacyGroupId?: (string|null);

/** Params mandatoryFor */
mandatoryFor?: (string[]|null);

/** Params privacyFlag */
privacyFlag?: (number|null);
}

/** Represents a Params. */
Expand All @@ -6888,6 +6934,12 @@ export namespace tx {
/** Params gasPrice. */
public gasPrice: string;

/** Params gasFeeCap. */
public gasFeeCap: string;

/** Params gasTipCap. */
public gasTipCap: string;

/** Params value. */
public value: string;

Expand All @@ -6897,6 +6949,15 @@ export namespace tx {
/** Params data. */
public data: string;

/** Params transactionType. */
public transactionType: string;

/** Params accessList. */
public accessList: ethereum.IAccessTuple[];

/** Params raw. */
public raw: string;

/** Params contract. */
public contract: string;

Expand All @@ -6906,9 +6967,6 @@ export namespace tx {
/** Params args. */
public args: string[];

/** Params raw. */
public raw: string;

/** Params privateFor. */
public privateFor: string[];

Expand All @@ -6921,6 +6979,12 @@ export namespace tx {
/** Params privacyGroupId. */
public privacyGroupId: string;

/** Params mandatoryFor. */
public mandatoryFor: string[];

/** Params privacyFlag. */
public privacyFlag: number;

/**
* Creates a new Params instance using the specified properties.
* @param [properties] Properties to set
Expand Down
Loading

0 comments on commit 59184c8

Please sign in to comment.