@ocap/types 1.30.2 → 1.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/interfaces/pipeline.ts +27 -3
- package/package.json +1 -1
package/interfaces/pipeline.ts
CHANGED
|
@@ -53,7 +53,16 @@ export interface IPipelineLogger {
|
|
|
53
53
|
error: (message: string, ...args: unknown[]) => void;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Decoded transaction — canonical camelCase shape (Phase 4 decision q11).
|
|
58
|
+
*
|
|
59
|
+
* Repeated fields use the `xxx` name (`signatures`, `tags`, `slashers`). The
|
|
60
|
+
* protobuf-wire `xxxList` alias is an `@ocap/proto/runtime` implementation
|
|
61
|
+
* detail and is not part of this interface. Pipe code still accessing
|
|
62
|
+
* `tx.signaturesList` at runtime (protobuf-decoded txs) falls through the
|
|
63
|
+
* index signature as `unknown`; prefer `getListField(tx, 'signatures')` to
|
|
64
|
+
* read either shape safely.
|
|
65
|
+
*/
|
|
57
66
|
export interface IDecodedTransaction {
|
|
58
67
|
from: string;
|
|
59
68
|
delegator?: string;
|
|
@@ -63,8 +72,6 @@ export interface IDecodedTransaction {
|
|
|
63
72
|
pk: Uint8Array;
|
|
64
73
|
signature?: Uint8Array | string;
|
|
65
74
|
signatures?: IMultiSigData[];
|
|
66
|
-
/** Used during signature verification to hold processed signatures */
|
|
67
|
-
signaturesList?: Array<Omit<IMultiSigData, 'signature'>>;
|
|
68
75
|
itx: IAny;
|
|
69
76
|
/** Index signature for dynamic field access during verification */
|
|
70
77
|
[key: string]: unknown;
|
|
@@ -167,6 +174,17 @@ export interface IInput {
|
|
|
167
174
|
export interface IBaseContext<TItx = unknown> {
|
|
168
175
|
/** Base64 encoded transaction */
|
|
169
176
|
txBase64: string;
|
|
177
|
+
/**
|
|
178
|
+
* Wire encoding detected by `DecodeTx` from the first three bytes of the
|
|
179
|
+
* decoded payload. Downstream pipes (verify-signature, verify-multisig,
|
|
180
|
+
* and tx-protocols' `toItxAddress` call sites) must select the matching
|
|
181
|
+
* serializer. Literal union (not `string`) to catch typos at compile time.
|
|
182
|
+
*
|
|
183
|
+
* Populated by DecodeTx on Phase 1+; optional on `IBaseContext` so the
|
|
184
|
+
* pipeline can still type-check callers that build a bare base context
|
|
185
|
+
* (e.g. test harnesses that exercise DecodeTx first).
|
|
186
|
+
*/
|
|
187
|
+
txEncoding?: 'cbor' | 'protobuf';
|
|
170
188
|
/** State database instance */
|
|
171
189
|
statedb: IStateDB;
|
|
172
190
|
/** Chain configuration */
|
|
@@ -230,6 +248,12 @@ export interface ITxOnlyContext extends IBaseContext {
|
|
|
230
248
|
txSize: number;
|
|
231
249
|
/** Whether to charge base gas */
|
|
232
250
|
txBaseGas: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Wire encoding of the transaction. Always populated by `DecodeTx` before
|
|
253
|
+
* any downstream pipe runs, hence required here and inherited by the
|
|
254
|
+
* decoded / gas / ready / executed phases via the extends chain.
|
|
255
|
+
*/
|
|
256
|
+
txEncoding: 'cbor' | 'protobuf';
|
|
233
257
|
}
|
|
234
258
|
|
|
235
259
|
// =============================================================================
|