diff --git a/package.json b/package.json index 2307e6d..a5072be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stellar-plus", - "version": "0.8.1", + "version": "0.8.2", "description": "beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/stellar-plus/core/contract-engine/index.ts b/src/stellar-plus/core/contract-engine/index.ts index 3bed6d3..df8373a 100644 --- a/src/stellar-plus/core/contract-engine/index.ts +++ b/src/stellar-plus/core/contract-engine/index.ts @@ -199,7 +199,7 @@ export class ContractEngine { * ``` */ public async readFromContract(args: SorobanSimulateArgs): Promise { - return await this.runTransactionPipeline(args, true) + return (await this.runTransactionPipeline(args, true)).output?.value } /** diff --git a/src/stellar-plus/core/contract-engine/index.unit.test.ts b/src/stellar-plus/core/contract-engine/index.unit.test.ts index c8ff462..c5d6d5a 100644 --- a/src/stellar-plus/core/contract-engine/index.unit.test.ts +++ b/src/stellar-plus/core/contract-engine/index.unit.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { Asset, Contract, SorobanRpc, xdr } from '@stellar/stellar-sdk' import { methods as tokenMethods, spec as tokenSpec } from 'stellar-plus/asset/soroban-token/constants' @@ -619,7 +620,7 @@ describe('ContractEngine', () => { it('should read from a contract', async () => { MOCKED_SOROBAN_TRANSACTION_PIPELINE.mockImplementation(() => { return { - execute: jest.fn().mockResolvedValue(true), + execute: jest.fn().mockResolvedValue({ output: { value: true } }), } })