web3.js: Introduce support for log messages inside ConfirmedTransactionMeta. (#12629)

* feat: add logMessages to ConfirmedTranasactionMeta

* feat: add flow type and additional superstruct validators
This commit is contained in:
Josh
2020-10-05 10:24:38 -07:00
committed by GitHub
parent 457247e5a5
commit aaf3790d8c
3 changed files with 5 additions and 0 deletions

View File

@ -374,12 +374,14 @@ const SimulatedTransactionResponseValidator = jsonRpcResultAndContext(
* @property {number} fee The fee charged for processing the transaction
* @property {Array<number>} preBalances The balances of the transaction accounts before processing
* @property {Array<number>} postBalances The balances of the transaction accounts after processing
* @property {Array<string>} logMessages An array of program log messages emitted during a transaction
* @property {object|null} err The error result of transaction processing
*/
type ConfirmedTransactionMeta = {
fee: number,
preBalances: Array<number>,
postBalances: Array<number>,
logMessages?: Array<string>,
err: TransactionError | null,
};
@ -1107,6 +1109,7 @@ const ConfirmedTransactionMetaResult = struct.union([
fee: 'number',
preBalances: struct.array(['number']),
postBalances: struct.array(['number']),
logMessages: struct.union([struct.array(['string']), 'undefined']),
}),
]);