-fix ID parsing
This commit is contained in:
parent
0c8e56c324
commit
b36807aa0f
@ -954,7 +954,11 @@ export async function retryTransaction(
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
logger.info(`retrying transaction ${transactionId}`);
|
logger.info(`retrying transaction ${transactionId}`);
|
||||||
|
|
||||||
const [type, ...rest] = transactionId.split(":");
|
const [tmbPrefix, type, ...rest] = transactionId.split(":");
|
||||||
|
|
||||||
|
if (tmbPrefix !== "tmb") {
|
||||||
|
throw Error("invalid tombstone, expected 'tmb' prefix");
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TransactionType.Deposit: {
|
case TransactionType.Deposit: {
|
||||||
@ -996,7 +1000,10 @@ export async function deleteTransaction(
|
|||||||
ws: InternalWalletState,
|
ws: InternalWalletState,
|
||||||
transactionId: string,
|
transactionId: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const [typeStr, ...rest] = transactionId.split(":");
|
const [txnPrefix, typeStr, ...rest] = transactionId.split(":");
|
||||||
|
if (txnPrefix !== "txn") {
|
||||||
|
throw Error("invalid transaction ID, expected 'txn' prefix");
|
||||||
|
}
|
||||||
const type = typeStr as TransactionType;
|
const type = typeStr as TransactionType;
|
||||||
if (
|
if (
|
||||||
type === TransactionType.Withdrawal ||
|
type === TransactionType.Withdrawal ||
|
||||||
|
Loading…
Reference in New Issue
Block a user