File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -390,13 +390,18 @@ const runBot = async () => {
390390 } ) ;
391391 await userMap . subscribe ( ) ;
392392
393- const swiftMaker = new SwiftMaker ( driftClient , userMap , {
394- rpcEndpoint : endpoint ,
395- commit : '' ,
396- driftEnv : config . global . driftEnv ! ,
397- driftPid : driftPublicKey . toBase58 ( ) ,
398- walletAuthority : wallet . publicKey . toBase58 ( ) ,
399- } ) ;
393+ const swiftMaker = new SwiftMaker (
394+ driftClient ,
395+ userMap ,
396+ {
397+ rpcEndpoint : endpoint ,
398+ commit : '' ,
399+ driftEnv : config . global . driftEnv ! ,
400+ driftPid : driftPublicKey . toBase58 ( ) ,
401+ walletAuthority : wallet . publicKey . toBase58 ( ) ,
402+ } ,
403+ config . global . testLiveness
404+ ) ;
400405 bots . push ( swiftMaker ) ;
401406 }
402407
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ export class SwiftMaker {
2424 constructor (
2525 private driftClient : DriftClient ,
2626 private userMap : UserMap ,
27- runtimeSpec : RuntimeSpec
27+ runtimeSpec : RuntimeSpec ,
28+ private dryRun ?: boolean
2829 ) {
2930 if ( runtimeSpec . driftEnv != 'devnet' ) {
3031 throw new Error ( 'SwiftMaker only works on devnet' ) ;
@@ -187,8 +188,13 @@ export class SwiftMaker {
187188 ) ;
188189 if ( resp . value . err ) {
189190 console . log ( resp . value . logs ) ;
191+ return ;
190192 }
191193
194+ if ( this . dryRun ) {
195+ console . log ( 'Dry run, not sending transaction' ) ;
196+ return ;
197+ }
192198 this . driftClient . txSender
193199 . sendVersionedTransaction ( tx )
194200 . then ( ( response ) => {
You can’t perform that action at this time.
0 commit comments