crosslightning-solana
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -480,6 +480,14 @@ "use strict"; | ||
const accountAddr = this.BtcRelayFork(i, this.provider.publicKey); | ||
const forkState = yield this.program.account.forkState.fetch(accountAddr); | ||
let forkState; | ||
try { | ||
forkState = yield this.program.account.forkState.fetch(accountAddr); | ||
} | ||
catch (e) { | ||
if (e.message.startsWith("Account does not exist or has no data")) | ||
return null; | ||
throw e; | ||
} | ||
if (forkState != null) { | ||
const ix = yield this.program.methods | ||
.closeForkAccount(i) | ||
.closeForkAccount(new anchor_1.BN(i)) | ||
.accounts({ | ||
@@ -486,0 +494,0 @@ signer: this.provider.publicKey, |
{ | ||
"name": "crosslightning-solana", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Solana specific base implementation", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -579,7 +579,14 @@ import {AnchorProvider, BN, BorshCoder, EventParser, Program} from "@coral-xyz/anchor"; | ||
const accountAddr = this.BtcRelayFork(i, this.provider.publicKey); | ||
const forkState: any = await this.program.account.forkState.fetch(accountAddr); | ||
let forkState: any; | ||
try { | ||
forkState = await this.program.account.forkState.fetch(accountAddr); | ||
} catch (e) { | ||
if(e.message.startsWith("Account does not exist or has no data")) return null; | ||
throw e; | ||
} | ||
if(forkState!=null) { | ||
const ix = await this.program.methods | ||
.closeForkAccount( | ||
i | ||
new BN(i) | ||
) | ||
@@ -586,0 +593,0 @@ .accounts({ |
394496
9422