-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from XLabs/solana-transfer-test
Solana tests and SDK update
- Loading branch information
Showing
32 changed files
with
1,659 additions
and
1,330 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { SolanaTokenBridgeRelayer } from '@xlabs-xyz/solana-arbitrary-token-transfers'; | ||
import { runOnSolana, ledgerSignAndSend, getConnection, SolanaSigner } from '../helpers/solana.js'; | ||
import { SolanaChainInfo, LoggerFn } from '../helpers/interfaces.js'; | ||
import { runOnSolana, ledgerSignAndSend, getConnection } from '../helpers/solana.js'; | ||
import { SolanaScriptCb } from '../helpers/interfaces.js'; | ||
import { dependencies } from '../helpers/env.js'; | ||
import { PublicKey } from '@solana/web3.js'; | ||
|
||
runOnSolana('unpause-contract', unpauseContract).catch((e) => { | ||
console.error('Error executing script: ', e); | ||
}); | ||
|
||
async function unpauseContract( | ||
chain: SolanaChainInfo, | ||
signer: SolanaSigner, | ||
log: LoggerFn, | ||
): Promise<void> { | ||
const unpauseContract: SolanaScriptCb = async function ( | ||
chain, | ||
signer, | ||
// log, | ||
) { | ||
const signerKey = new PublicKey(await signer.getAddress()); | ||
const connection = getConnection(chain); | ||
const solanaDependencies = dependencies.find((d) => d.chainId === chain.chainId); | ||
if (solanaDependencies === undefined) { | ||
throw new Error(`No dependencies found for chain ${chain.chainId}`); | ||
} | ||
const tbr = await SolanaTokenBridgeRelayer.create({ connection }); | ||
const tbr = await SolanaTokenBridgeRelayer.create(connection); | ||
|
||
const initializeIx = await tbr.setPauseForOutboundTransfers(signerKey, 'Sepolia', false); | ||
|
||
await ledgerSignAndSend(connection, [initializeIx], []); | ||
} | ||
|
||
runOnSolana('unpause-contract', unpauseContract).catch((e) => { | ||
console.error('Error executing script: ', e); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.