-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extension": ["ts"], | ||
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"], | ||
"timeout": 100000 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
createAccountAndSwapAtomic, | ||
createTokenSwap, | ||
swap, | ||
depositAllTokenTypes, | ||
withdrawAllTokenTypes, | ||
depositSingleTokenTypeExactAmountIn, | ||
withdrawSingleTokenTypeExactAmountOut, | ||
} from './token-swap-test'; | ||
import {CurveType} from '../src'; | ||
|
||
describe('spl-token-swap instructions', () => { | ||
it('executes properly', async () => { | ||
// These test cases are designed to run sequentially and in the following order | ||
console.log('Run test: createTokenSwap (constant price)'); | ||
const constantPrice = new Uint8Array(8); | ||
constantPrice[0] = 1; | ||
await createTokenSwap(CurveType.ConstantPrice, constantPrice); | ||
console.log( | ||
'Run test: createTokenSwap (constant product, used further in tests)', | ||
); | ||
await createTokenSwap(CurveType.ConstantProduct); | ||
console.log('Run test: deposit all token types'); | ||
await depositAllTokenTypes(); | ||
console.log('Run test: withdraw all token types'); | ||
await withdrawAllTokenTypes(); | ||
console.log('Run test: swap'); | ||
await swap(); | ||
console.log('Run test: create account, approve, swap all at once'); | ||
await createAccountAndSwapAtomic(); | ||
console.log('Run test: deposit one exact amount in'); | ||
await depositSingleTokenTypeExactAmountIn(); | ||
console.log('Run test: withrdaw one exact amount out'); | ||
await withdrawSingleTokenTypeExactAmountOut(); | ||
console.log('Success\n'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.