Skip to content

Commit f6d9b86

Browse files
aldousalvarezTravis Paynejohnhomantaringjagpreetsinghsasan
committed
feat(quorum): private transaction support
----------------------------------------- - Added v2.3.0-deploy-contract-from-json-private.test.ts that would support private transaction test for Quorum. - Added a QuorumPrivateTransactionConfig on openapi.json - Added Web3JsQuorum on plugin-ledger-connector-quorum and added a transact private method to be able to proceed with the private transaction. - Currently the privateUrl in the test is being truely optional and we need to address this in the future. - We are just passing privateUrl in all the instances even though we don't need to do private transactions everywhere. Fixes hyperledger-cacti#951 Co-authored-by: Travis Payne <[email protected]> Co-authored-by: johnhomantaring <[email protected]> Co-authored-by: jagpreetsinghsasan <[email protected]> Co-authored-by: aldousalvarez [email protected]
1 parent 53922f1 commit f6d9b86

25 files changed

+594
-25
lines changed

packages/cactus-plugin-ledger-connector-quorum/src/main/json/openapi.json

+93-3
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,46 @@
301301
}
302302
}
303303
},
304+
"QuorumPrivateTransactionConfig" : {
305+
"type": "object",
306+
"required" : [
307+
"privateFor"
308+
],
309+
"properties" : {
310+
"privateFrom": {
311+
"type": "string",
312+
"nullable": false
313+
},
314+
"privateFor": {
315+
"type": "array",
316+
"default": [],
317+
"items": {},
318+
"nullable": false
319+
},
320+
"isPrivate": {
321+
"type": "boolean",
322+
"default": false,
323+
"nullable": false
324+
},
325+
"gasPrice": {
326+
"type": "number",
327+
"nullable": false
328+
},
329+
"gasLimit": {
330+
"type": "number",
331+
"nullable": false
332+
},
333+
"privateKey": {
334+
"type": "string",
335+
"nullable": false
336+
},
337+
"privacyGroupId": {
338+
"type": "string",
339+
"nullable": false
340+
}
341+
342+
}
343+
},
304344
"Web3TransactionReceipt": {
305345
"type": "object",
306346
"required": [
@@ -354,7 +394,33 @@
354394
"to": {
355395
"type": "string",
356396
"nullable": false
357-
}
397+
},
398+
"logs": {
399+
"type": "array",
400+
"default": [],
401+
"items": {},
402+
"nullable": false
403+
},
404+
"logsBloom": {
405+
"type": "string",
406+
"nullable": false
407+
},
408+
"revertReason": {
409+
"type": "string",
410+
"nullable": false
411+
},
412+
"output": {
413+
"type": "string",
414+
"nullable": false
415+
},
416+
"commitmentHash": {
417+
"type": "string",
418+
"nullable": false
419+
},
420+
"cumulativeGasUSed": {
421+
"type": "number",
422+
"nullable": false
423+
}
358424
}
359425
},
360426
"ContractJSON": {
@@ -436,6 +502,9 @@
436502
"minimum": 0,
437503
"default": 60000,
438504
"nullable": false
505+
},
506+
"privateTransactionConfig": {
507+
"$ref": "#/components/schemas/QuorumPrivateTransactionConfig"
439508
}
440509
}
441510
},
@@ -448,7 +517,7 @@
448517
"transactionReceipt": {
449518
"$ref": "#/components/schemas/Web3TransactionReceipt"
450519
}
451-
}
520+
}
452521
},
453522
"DeployContractSolidityBytecodeV1Request": {
454523
"type": "object",
@@ -470,6 +539,13 @@
470539
"$ref": "#/components/schemas/Web3SigningCredential",
471540
"nullable": false
472541
},
542+
"bytecode": {
543+
"type": "string",
544+
"nullable": false,
545+
"minLength": 1,
546+
"maxLength": 24576,
547+
"description": "See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode"
548+
},
473549
"keychainId": {
474550
"type": "string",
475551
"description": "The keychainId for retrieve the contracts json.",
@@ -482,7 +558,15 @@
482558
"nullable": false
483559
},
484560
"gasPrice": {
485-
"type": "string",
561+
"type": "number",
562+
"nullable": false
563+
},
564+
"nonce": {
565+
"type": "number",
566+
"nullable": false
567+
},
568+
"value": {
569+
"type": "number",
486570
"nullable": false
487571
},
488572
"timeoutMs": {
@@ -502,6 +586,9 @@
502586
"type": "array",
503587
"default": [],
504588
"items": {}
589+
},
590+
"privateTransactionConfig": {
591+
"$ref": "#/components/schemas/QuorumPrivateTransactionConfig"
505592
}
506593
}
507594
},
@@ -726,6 +813,9 @@
726813
"$ref": "#/components/schemas/ContractJSON",
727814
"description": "For use when not using keychain, pass the contract in as this variable",
728815
"nullable": false
816+
},
817+
"privateTransactionConfig": {
818+
"$ref": "#/components/schemas/QuorumPrivateTransactionConfig"
729819
}
730820
}
731821
},

packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/generated/openapi/typescript-axios/api.ts

+123-2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ export interface DeployContractSolidityBytecodeV1Request {
169169
* @memberof DeployContractSolidityBytecodeV1Request
170170
*/
171171
web3SigningCredential: Web3SigningCredential;
172+
/**
173+
* See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode
174+
* @type {string}
175+
* @memberof DeployContractSolidityBytecodeV1Request
176+
*/
177+
bytecode?: string;
172178
/**
173179
* The keychainId for retrieve the contracts json.
174180
* @type {string}
@@ -183,10 +189,22 @@ export interface DeployContractSolidityBytecodeV1Request {
183189
gas?: number;
184190
/**
185191
*
186-
* @type {string}
192+
* @type {number}
187193
* @memberof DeployContractSolidityBytecodeV1Request
188194
*/
189-
gasPrice?: string;
195+
gasPrice?: number;
196+
/**
197+
*
198+
* @type {number}
199+
* @memberof DeployContractSolidityBytecodeV1Request
200+
*/
201+
nonce?: number;
202+
/**
203+
*
204+
* @type {number}
205+
* @memberof DeployContractSolidityBytecodeV1Request
206+
*/
207+
value?: number;
190208
/**
191209
* The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing.
192210
* @type {number}
@@ -205,6 +223,12 @@ export interface DeployContractSolidityBytecodeV1Request {
205223
* @memberof DeployContractSolidityBytecodeV1Request
206224
*/
207225
constructorArgs?: Array<any>;
226+
/**
227+
*
228+
* @type {QuorumPrivateTransactionConfig}
229+
* @memberof DeployContractSolidityBytecodeV1Request
230+
*/
231+
privateTransactionConfig?: QuorumPrivateTransactionConfig;
208232
}
209233
/**
210234
*
@@ -315,6 +339,12 @@ export interface InvokeContractJsonObjectV1Request {
315339
* @memberof InvokeContractJsonObjectV1Request
316340
*/
317341
contractJSON: ContractJSON;
342+
/**
343+
*
344+
* @type {QuorumPrivateTransactionConfig}
345+
* @memberof InvokeContractJsonObjectV1Request
346+
*/
347+
privateTransactionConfig?: QuorumPrivateTransactionConfig;
318348
}
319349
/**
320350
*
@@ -526,6 +556,55 @@ export interface InvokeRawWeb3EthMethodV1Response {
526556
*/
527557
errorDetail?: string;
528558
}
559+
/**
560+
*
561+
* @export
562+
* @interface QuorumPrivateTransactionConfig
563+
*/
564+
export interface QuorumPrivateTransactionConfig {
565+
/**
566+
*
567+
* @type {string}
568+
* @memberof QuorumPrivateTransactionConfig
569+
*/
570+
privateFrom?: string;
571+
/**
572+
*
573+
* @type {Array<any>}
574+
* @memberof QuorumPrivateTransactionConfig
575+
*/
576+
privateFor: Array<any>;
577+
/**
578+
*
579+
* @type {boolean}
580+
* @memberof QuorumPrivateTransactionConfig
581+
*/
582+
isPrivate?: boolean;
583+
/**
584+
*
585+
* @type {number}
586+
* @memberof QuorumPrivateTransactionConfig
587+
*/
588+
gasPrice?: number;
589+
/**
590+
*
591+
* @type {number}
592+
* @memberof QuorumPrivateTransactionConfig
593+
*/
594+
gasLimit?: number;
595+
/**
596+
*
597+
* @type {string}
598+
* @memberof QuorumPrivateTransactionConfig
599+
*/
600+
privateKey?: string;
601+
/**
602+
*
603+
* @type {string}
604+
* @memberof QuorumPrivateTransactionConfig
605+
*/
606+
privacyGroupId?: string;
607+
}
529608
/**
530609
*
531610
* @export
@@ -607,6 +686,12 @@ export interface RunTransactionRequest {
607686
* @memberof RunTransactionRequest
608687
*/
609688
timeoutMs?: number;
689+
/**
690+
*
691+
* @type {QuorumPrivateTransactionConfig}
692+
* @memberof RunTransactionRequest
693+
*/
694+
privateTransactionConfig?: QuorumPrivateTransactionConfig;
610695
}
611696
/**
612697
*
@@ -1230,6 +1315,42 @@ export interface Web3TransactionReceipt {
12301315
* @memberof Web3TransactionReceipt
12311316
*/
12321317
to: string;
1318+
/**
1319+
*
1320+
* @type {Array<any>}
1321+
* @memberof Web3TransactionReceipt
1322+
*/
1323+
logs?: Array<any>;
1324+
/**
1325+
*
1326+
* @type {string}
1327+
* @memberof Web3TransactionReceipt
1328+
*/
1329+
logsBloom?: string;
1330+
/**
1331+
*
1332+
* @type {string}
1333+
* @memberof Web3TransactionReceipt
1334+
*/
1335+
revertReason?: string;
1336+
/**
1337+
*
1338+
* @type {string}
1339+
* @memberof Web3TransactionReceipt
1340+
*/
1341+
output?: string;
1342+
/**
1343+
*
1344+
* @type {string}
1345+
* @memberof Web3TransactionReceipt
1346+
*/
1347+
commitmentHash?: string;
1348+
/**
1349+
*
1350+
* @type {number}
1351+
* @memberof Web3TransactionReceipt
1352+
*/
1353+
cumulativeGasUSed?: number;
12331354
}
12341355

12351356
/**

0 commit comments

Comments
 (0)