fix amount format (how did this ever work before?)
This commit is contained in:
parent
4dfe451b8a
commit
9ad8c69782
@ -403,6 +403,7 @@ export async function getPendingOperations(
|
|||||||
): Promise<PendingOperationsResponse> {
|
): Promise<PendingOperationsResponse> {
|
||||||
const resp: PendingOperationsResponse = {
|
const resp: PendingOperationsResponse = {
|
||||||
nextRetryDelay: { d_ms: Number.MAX_SAFE_INTEGER },
|
nextRetryDelay: { d_ms: Number.MAX_SAFE_INTEGER },
|
||||||
|
onlyDue: onlyDue,
|
||||||
pendingOperations: [],
|
pendingOperations: [],
|
||||||
};
|
};
|
||||||
const now = getTimestampNow();
|
const now = getTimestampNow();
|
||||||
|
@ -236,11 +236,18 @@ async function refreshMelt(
|
|||||||
denom_pub_hash: coin.denomPubHash,
|
denom_pub_hash: coin.denomPubHash,
|
||||||
denom_sig: coin.denomSig,
|
denom_sig: coin.denomSig,
|
||||||
rc: refreshSession.hash,
|
rc: refreshSession.hash,
|
||||||
value_with_fee: refreshSession.amountRefreshInput,
|
value_with_fee: Amounts.toString(refreshSession.amountRefreshInput),
|
||||||
};
|
};
|
||||||
logger.trace("melt request:", meltReq);
|
logger.trace("melt request:", meltReq);
|
||||||
const resp = await ws.http.postJson(reqUrl.href, meltReq);
|
const resp = await ws.http.postJson(reqUrl.href, meltReq);
|
||||||
if (resp.status !== 200) {
|
if (resp.status !== 200) {
|
||||||
|
console.log(`got status ${resp.status} for refresh/melt`);
|
||||||
|
try {
|
||||||
|
const respJson = await resp.json();
|
||||||
|
console.log(`body of refresh/melt error response:`, JSON.stringify(respJson, undefined, 2));
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`body of refresh/melt error response is not JSON`);
|
||||||
|
}
|
||||||
throw Error(`unexpected status code ${resp.status} for refresh/melt`);
|
throw Error(`unexpected status code ${resp.status} for refresh/melt`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,4 +177,10 @@ export interface PendingOperationInfoCommon {
|
|||||||
export interface PendingOperationsResponse {
|
export interface PendingOperationsResponse {
|
||||||
pendingOperations: PendingOperationInfo[];
|
pendingOperations: PendingOperationInfo[];
|
||||||
nextRetryDelay: Duration;
|
nextRetryDelay: Duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does this response only include pending operations that
|
||||||
|
* are due to be executed right now?
|
||||||
|
*/
|
||||||
|
onlyDue: boolean;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user