Implement the constructor that takes a decoded TransactionResult XDR, navigates into the operation results, finds the InvokeHostFunctionResult, extracts the ScError type and code, and maps them to the correct HostError variant. This is the entry point the CLI's prism decode command calls.
Implementation Guidelines
- Navigate:
TransactionResult → results → OperationResult → InvokeHostFunctionResult::Err → extract ScErrorType + ScErrorCode
- Return
PrismError::NotSorobanTransaction or PrismError::TransactionSucceeded for invalid inputs
Expectations
- What done looks like: Given any failed Soroban TX result, returns the correct
HostError variant. Given a success or non-Soroban TX, returns a descriptive error.
Implement the constructor that takes a decoded
TransactionResultXDR, navigates into the operation results, finds theInvokeHostFunctionResult, extracts theScErrortype and code, and maps them to the correctHostErrorvariant. This is the entry point the CLI'sprism decodecommand calls.Implementation Guidelines
TransactionResult→results→OperationResult→InvokeHostFunctionResult::Err→ extractScErrorType+ScErrorCodePrismError::NotSorobanTransactionorPrismError::TransactionSucceededfor invalid inputsExpectations
HostErrorvariant. Given a success or non-Soroban TX, returns a descriptive error.