feat: update getSignatureStatus

This commit is contained in:
Justin Starry
2020-03-23 23:01:12 +08:00
committed by Michael Vines
parent ac8660b2e9
commit 1c31e527e2
7 changed files with 152 additions and 26 deletions

View File

@@ -39,7 +39,7 @@ export async function sendAndConfirmRawTransaction(
}
}
if (status && 'Ok' in status) {
if (status && status.status && 'Ok' in status.status) {
return signature;
}

View File

@@ -65,7 +65,7 @@ async function _sendAndConfirmTransaction(
await sleep((500 * DEFAULT_TICKS_PER_SLOT) / NUM_TICKS_PER_SECOND);
}
if (status && 'Ok' in status) {
if (status && 'Ok' in status.status) {
break;
}
if (--sendRetries <= 0) {
@@ -77,7 +77,7 @@ async function _sendAndConfirmTransaction(
);
}
if (status && status.Err && !('AccountInUse' in status.Err)) {
if (status && status.status.Err && !('AccountInUse' in status.status.Err)) {
throw new Error(
`Transaction ${signature} failed (${JSON.stringify(status)})`,
);