Skip to content

Commit

Permalink
Replace else with return
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueCarry committed Feb 2, 2024
1 parent e79f7fb commit 942238a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
60 changes: 30 additions & 30 deletions send_multigpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ async function sendMinedBoc(
giverAddress: string,
boc: Cell
) {

if (args['--api'] === 'tonapi') {
const tonapiClient = await getTonapiClient()

Expand Down Expand Up @@ -357,37 +356,38 @@ async function sendMinedBoc(

}
}
} else {
const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)
return
}

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}
const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}

for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
}
}
Expand Down
60 changes: 30 additions & 30 deletions send_universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ async function sendMinedBoc(
giverAddress: string,
boc: Cell
) {

if (args['--api'] === 'tonapi') {
const tonapiClient = await getTonapiClient()

Expand Down Expand Up @@ -315,37 +314,38 @@ async function sendMinedBoc(

}
}
} else {
const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)
return
}

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}
const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}

for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
}
}
Expand Down

0 comments on commit 942238a

Please sign in to comment.