use new Provider interface (#30)
This commit is contained in:
parent
3da36aaae7
commit
2ac6045cf3
|
@ -13,7 +13,7 @@ const TAKER_FEE = 0.0022;
|
|||
|
||||
describe("swap", () => {
|
||||
// Configure the client to use the local cluster.
|
||||
anchor.setProvider(anchor.Provider.env());
|
||||
anchor.setProvider(anchor.AnchorProvider.env());
|
||||
|
||||
// Swap program client.
|
||||
const program = anchor.workspace.Swap;
|
||||
|
@ -212,7 +212,7 @@ describe("swap", () => {
|
|||
);
|
||||
|
||||
// Send it.
|
||||
await program.provider.send(tx, [openOrders]);
|
||||
await program.provider.sendAndConfirm(tx, [openOrders]);
|
||||
|
||||
// Balance after the transaction.
|
||||
const afterAccount = await program.provider.connection.getAccountInfo(
|
||||
|
|
|
@ -196,7 +196,7 @@ async function fundAccount({ provider, mints }) {
|
|||
};
|
||||
|
||||
// Transfer lamports to market maker.
|
||||
await provider.send(
|
||||
await provider.sendAndConfirm(
|
||||
(() => {
|
||||
const tx = new Transaction();
|
||||
tx.add(
|
||||
|
@ -226,7 +226,7 @@ async function fundAccount({ provider, mints }) {
|
|||
MARKET_MAKER.publicKey
|
||||
);
|
||||
|
||||
await provider.send(
|
||||
await provider.sendAndConfirm(
|
||||
(() => {
|
||||
const tx = new Transaction();
|
||||
tx.add(
|
||||
|
@ -293,7 +293,7 @@ async function setupMarket({
|
|||
feeDiscountPubkey: null,
|
||||
selfTradeBehavior: "abortTransaction",
|
||||
});
|
||||
await provider.send(transaction, signers.concat(marketMaker.account));
|
||||
await provider.sendAndConfirm(transaction, signers.concat(marketMaker.account));
|
||||
}
|
||||
|
||||
for (let k = 0; k < bids.length; k += 1) {
|
||||
|
@ -314,7 +314,7 @@ async function setupMarket({
|
|||
feeDiscountPubkey: null,
|
||||
selfTradeBehavior: "abortTransaction",
|
||||
});
|
||||
await provider.send(transaction, signers.concat(marketMaker.account));
|
||||
await provider.sendAndConfirm(transaction, signers.concat(marketMaker.account));
|
||||
}
|
||||
|
||||
return MARKET_A_USDC;
|
||||
|
|
Loading…
Reference in New Issue