diff --git a/packages/hathor-rpc-handler/__tests__/rpcMethods/sendNanoContractTx.test.ts b/packages/hathor-rpc-handler/__tests__/rpcMethods/sendNanoContractTx.test.ts index d9ac7e7..33cf571 100644 --- a/packages/hathor-rpc-handler/__tests__/rpcMethods/sendNanoContractTx.test.ts +++ b/packages/hathor-rpc-handler/__tests__/rpcMethods/sendNanoContractTx.test.ts @@ -103,6 +103,7 @@ describe('sendNanoContractTx', () => { it('should throw SendNanoContractTxFailure if the transaction fails', async () => { const pinCode = '1234'; const ncData = { + method: 'initialize', blueprintId: rpcRequest.params.blueprint_id, ncId: rpcRequest.params.nc_id, args: rpcRequest.params.args, diff --git a/packages/hathor-rpc-handler/src/rpcMethods/sendNanoContractTx.ts b/packages/hathor-rpc-handler/src/rpcMethods/sendNanoContractTx.ts index 184235a..1b59f68 100644 --- a/packages/hathor-rpc-handler/src/rpcMethods/sendNanoContractTx.ts +++ b/packages/hathor-rpc-handler/src/rpcMethods/sendNanoContractTx.ts @@ -68,6 +68,7 @@ export async function sendNanoContractTx( blueprintId, ncId: nc_id, actions, + method, args, pushTx: push_tx, }, @@ -119,6 +120,10 @@ export async function sendNanoContractTx( response, } as RpcResponse; } catch (err) { - throw new SendNanoContractTxFailure(); + if (err instanceof Error) { + throw new SendNanoContractTxFailure(err.message); + } else { + throw new SendNanoContractTxFailure('An unknown error occurred'); + } } } diff --git a/packages/hathor-rpc-handler/src/types/prompt.ts b/packages/hathor-rpc-handler/src/types/prompt.ts index d22ad6f..5b318ed 100644 --- a/packages/hathor-rpc-handler/src/types/prompt.ts +++ b/packages/hathor-rpc-handler/src/types/prompt.ts @@ -115,6 +115,7 @@ export interface NanoContractParams { blueprintId: string; ncId: string | null; actions: NanoContractAction[], + method: string; args: unknown[]; pushTx: boolean; }