Skip to content

Commit e1aeb0e

Browse files
Use pb decode callbacks to parse nodes for clear signing.
1 parent abcfb73 commit e1aeb0e

86 files changed

Lines changed: 1157 additions & 323 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

proto/com/daml/ledger/api/v2/interactive/device.pb.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ PB_BIND(com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed, com_d
1515
PB_BIND(com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node, com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node, 4)
1616

1717

18+
PB_BIND(com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay, com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay, AUTO)
19+
20+
21+
PB_BIND(com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed, com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed, AUTO)
22+
23+
24+
PB_BIND(com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node, com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node, 4)
25+
26+
1827
PB_BIND(com_daml_ledger_api_v2_interactive_DeviceMetadata, com_daml_ledger_api_v2_interactive_DeviceMetadata, AUTO)
1928

2029

proto/com/daml/ledger/api/v2/interactive/device.pb.h

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,44 @@ typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransaction {
3535
struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed *node_seeds;
3636
} com_daml_ledger_api_v2_interactive_DeviceDamlTransaction;
3737

38+
typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay {
39+
char *version;
40+
pb_size_t roots_count;
41+
char **roots;
42+
int32_t nodes_count;
43+
pb_size_t node_seeds_count;
44+
struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed *node_seeds;
45+
} com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay;
46+
47+
typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node {
48+
char *node_id;
49+
pb_callback_t cb_versioned_node;
50+
pb_size_t which_versioned_node;
51+
union {
52+
com_daml_ledger_api_v2_interactive_transaction_v1_cb_NodeDisplay v1;
53+
};
54+
} com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node;
55+
56+
typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed {
57+
int32_t node_id;
58+
pb_bytes_array_t *seed;
59+
} com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed;
60+
61+
/* Device variant of Transaction Metadata
62+
Refer to the hashing documentation for information on how it should be hashed. */
3863
typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node {
3964
char *node_id;
65+
pb_callback_t cb_versioned_node;
4066
pb_size_t which_versioned_node;
4167
union {
4268
com_daml_ledger_api_v2_interactive_transaction_v1_Node v1;
4369
};
4470
} com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node;
4571

46-
/* Device variant of Transaction Metadata
47-
Refer to the hashing documentation for information on how it should be hashed. */
4872
typedef struct _com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed {
73+
/* Transaction version, will be >= max(nodes version) */
4974
int32_t node_id;
75+
/* Root nodes of the transaction */
5076
pb_bytes_array_t *seed;
5177
} com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed;
5278

@@ -88,14 +114,20 @@ extern "C" {
88114
/* Initializer values for message structs */
89115
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_init_default {NULL, 0, NULL, 0, 0, NULL}
90116
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_init_default {0, NULL}
91-
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_init_default {NULL, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_Node_init_default}}
117+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_init_default {NULL, {{NULL}, NULL}, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_Node_init_default}}
118+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_init_default {NULL, 0, NULL, 0, 0, NULL}
119+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_init_default {0, NULL}
120+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_init_default {NULL, {{NULL}, NULL}, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_cb_NodeDisplay_init_default}}
92121
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_init_default {false, com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_init_default, NULL, 0, NULL, 0, 0, false, 0, false, 0}
93122
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_init_default {0, NULL, NULL}
94123
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_GlobalKeyMappingEntry_init_default {false, com_daml_ledger_api_v2_interactive_GlobalKey_init_default, false, com_daml_ledger_api_v2_Value_init_default}
95124
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_InputContract_init_default {{{NULL}, NULL}, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_Create_init_default}, 0}
96125
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_init_zero {NULL, 0, NULL, 0, 0, NULL}
97126
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_init_zero {0, NULL}
98-
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_init_zero {NULL, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_Node_init_zero}}
127+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_init_zero {NULL, {{NULL}, NULL}, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_Node_init_zero}}
128+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_init_zero {NULL, 0, NULL, 0, 0, NULL}
129+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_init_zero {0, NULL}
130+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_init_zero {NULL, {{NULL}, NULL}, 0, {com_daml_ledger_api_v2_interactive_transaction_v1_cb_NodeDisplay_init_zero}}
99131
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_init_zero {false, com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_init_zero, NULL, 0, NULL, 0, 0, false, 0, false, 0}
100132
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_init_zero {0, NULL, NULL}
101133
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_GlobalKeyMappingEntry_init_zero {false, com_daml_ledger_api_v2_interactive_GlobalKey_init_zero, false, com_daml_ledger_api_v2_Value_init_zero}
@@ -108,6 +140,14 @@ extern "C" {
108140
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_roots_tag 2
109141
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_nodes_count_tag 3
110142
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_node_seeds_tag 4
143+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_version_tag 1
144+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_roots_tag 2
145+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_nodes_count_tag 3
146+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_node_seeds_tag 4
147+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_node_id_tag 1
148+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_v1_tag 1000
149+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_node_id_tag 1
150+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_seed_tag 2
111151
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_node_id_tag 1
112152
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_v1_tag 1000
113153
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_node_id_tag 1
@@ -143,11 +183,33 @@ X(a, POINTER, SINGULAR, BYTES, seed, 2)
143183

144184
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_FIELDLIST(X, a) \
145185
X(a, POINTER, SINGULAR, STRING, node_id, 1) \
146-
X(a, STATIC, ONEOF, MESSAGE, (versioned_node,v1,v1), 1000)
186+
X(a, STATIC, ONEOF, MSG_W_CB, (versioned_node,v1,v1), 1000)
147187
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_CALLBACK NULL
148188
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_DEFAULT NULL
149189
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_versioned_node_v1_MSGTYPE com_daml_ledger_api_v2_interactive_transaction_v1_Node
150190

191+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_FIELDLIST(X, a) \
192+
X(a, POINTER, SINGULAR, STRING, version, 1) \
193+
X(a, POINTER, REPEATED, STRING, roots, 2) \
194+
X(a, STATIC, SINGULAR, INT32, nodes_count, 3) \
195+
X(a, POINTER, REPEATED, MESSAGE, node_seeds, 4)
196+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_CALLBACK NULL
197+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_DEFAULT NULL
198+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_node_seeds_MSGTYPE com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed
199+
200+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_FIELDLIST(X, a) \
201+
X(a, STATIC, SINGULAR, INT32, node_id, 1) \
202+
X(a, POINTER, SINGULAR, BYTES, seed, 2)
203+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_CALLBACK NULL
204+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_DEFAULT NULL
205+
206+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_FIELDLIST(X, a) \
207+
X(a, POINTER, SINGULAR, STRING, node_id, 1) \
208+
X(a, STATIC, ONEOF, MSG_W_CB, (versioned_node,v1,v1), 1000)
209+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_CALLBACK NULL
210+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_DEFAULT NULL
211+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_versioned_node_v1_MSGTYPE com_daml_ledger_api_v2_interactive_transaction_v1_cb_NodeDisplay
212+
151213
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_FIELDLIST(X, a) \
152214
X(a, STATIC, OPTIONAL, MESSAGE, submitter_info, 2) \
153215
X(a, POINTER, SINGULAR, STRING, synchronizer_id, 3) \
@@ -185,6 +247,9 @@ X(a, STATIC, SINGULAR, UINT64, created_at, 1000)
185247
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_msg;
186248
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_msg;
187249
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_msg;
250+
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_msg;
251+
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_msg;
252+
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_msg;
188253
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceMetadata_msg;
189254
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_msg;
190255
extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceMetadata_GlobalKeyMappingEntry_msg;
@@ -194,6 +259,9 @@ extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceMetadata_Inpu
194259
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_msg
195260
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_msg
196261
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_msg
262+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_msg
263+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_msg
264+
#define com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_fields &com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_msg
197265
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_fields &com_daml_ledger_api_v2_interactive_DeviceMetadata_msg
198266
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_fields &com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_msg
199267
#define com_daml_ledger_api_v2_interactive_DeviceMetadata_GlobalKeyMappingEntry_fields &com_daml_ledger_api_v2_interactive_DeviceMetadata_GlobalKeyMappingEntry_msg
@@ -203,6 +271,9 @@ extern const pb_msgdesc_t com_daml_ledger_api_v2_interactive_DeviceMetadata_Inpu
203271
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_size depends on runtime parameters */
204272
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_NodeSeed_size depends on runtime parameters */
205273
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransaction_Node_size depends on runtime parameters */
274+
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_size depends on runtime parameters */
275+
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_NodeSeed_size depends on runtime parameters */
276+
/* com_daml_ledger_api_v2_interactive_DeviceDamlTransactionDisplay_Node_size depends on runtime parameters */
206277
/* com_daml_ledger_api_v2_interactive_DeviceMetadata_size depends on runtime parameters */
207278
/* com_daml_ledger_api_v2_interactive_DeviceMetadata_SubmitterInfo_size depends on runtime parameters */
208279
#if defined(com_daml_ledger_api_v2_interactive_GlobalKey_size) && defined(com_daml_ledger_api_v2_Value_size)

proto/com/daml/ledger/api/v2/interactive/device_pb2.py

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)