Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/stargate/src/stargateclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ export class StargateClient {
return results.txs.map((tx): IndexedTx => {
const txMsgData = TxMsgData.decode(tx.result.data ?? new Uint8Array());
return {
...tx,
height: tx.height,
txIndex: tx.index,
hash: toHex(tx.hash).toUpperCase(),
Expand Down
7 changes: 6 additions & 1 deletion packages/tendermint-rpc/src/rpcclients/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ export async function http(
headers: Record<string, string> | undefined,
request?: any,
): Promise<any> {
const timeout = Number(
//@ts-ignore
process.env.HTTP_TIMEOUT || 30000,
);
if (typeof fetch === "function" && !isExperimental(fetch)) {
const settings = {
method: method,
signal: timeout,
body: request ? JSON.stringify(request) : undefined,
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -55,7 +60,7 @@ export async function http(
.then((res: any) => res.json());
} else {
return axios
.request({ url: url, method: method, data: request, headers: headers })
.request({ url: url, method: method, data: request, headers: headers, timeout })
.then((res) => res.data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ interface RpcTxResponse {

function decodeTxResponse(data: RpcTxResponse): responses.TxResponse {
return {
...data,
tx: fromBase64(assertNotEmpty(data.tx)),
result: decodeTxData(assertObject(data.tx_result)),
height: apiToSmallInt(assertNotEmpty(data.height)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ interface RpcTxResponse {

function decodeTxResponse(data: RpcTxResponse): responses.TxResponse {
return {
...data,
tx: fromBase64(assertNotEmpty(data.tx)),
result: decodeTxData(assertObject(data.tx_result)),
height: apiToSmallInt(assertNotEmpty(data.height)),
Expand Down