Skip to content

simulateByTxBody seems broken. ABCI errors are swallowed #183

@k730

Description

@k730
  1. In CosmJS I can do:

const gas = await client.simulate(address, [msg], memo);

In interchainjs I must hand-craft TxBody and SignerInfo[] for:

await signer.simulateByTxBody(txBody, signerInfos);

This is significantly more involved, and after many attempts I haven’t been able to make simulation succeed. It seems broken

  1. In interchainjs, the ABCI query helper returns only result.value, silently dropping errors when result.code != 0:
// interchainjs
async request(service, method, data) {
  const path = `/${service}/${method}`;
  const result = await this.queryAbci({ path, data });
  return result.value;  // <-- when result.code != 0, error log is lost
}

This swallows log, making it impossible to diagnose why simulation failed.

Please expose a simple simulate(address, messages, opts) API (or similar).

In the request path, when code != 0, propagate the ABCI error.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions