Function safelyExtendCompilationData
- safely
Extend Compilation Data<ProgramState, CompilationContext>(transactionGenerationError, trustedCompilationData, untrustedResolutions): false | CompilationData<CompilationContext> Type Parameters
ProgramState
CompilationContext = CompilationContextBCH
Parameters
transactionGenerationError: TransactionGenerationError<ProgramState>
trustedCompilationData: CompilationData<CompilationContext>
untrustedResolutions: {
[providedByEntityId: string]: ReturnType<typeof extractResolvedVariables>;
}[providedByEntityId: string]: ReturnType<typeof extractResolvedVariables>
Returns false | CompilationData<CompilationContext>
Remarks
To determine which identifiers are required by a given compilation, the compilation is first attempted with only trusted variables: variables owned or previously verified (like
WalletData) by the compiling entity. If this compilation produces aTransactionGenerationError, the error can be provided tosafelyExtendCompilationData, along with the trusted compilation data and a mapping of untrusted resolutions (where the result ofextractResolvedVariablesis assigned to the entity ID of the entity from which they were received).The first compilation must use only trusted compilation data
Generated using TypeDoc

TODO: fundamentally unsound, migrate to PST format
Safely extend a compilation data with resolutions provided by other entities (via
extractResolvedVariables).It is security-critical that compilation data only be extended with expected identifiers from the proper owning entity of each variable. See
CompilationData.bytecodefor details.Returns
falseif any errors are fatal (the error either cannot be resolved by providing a variable, or the entity ownership of the required variable was not provided in the compilation data).