Skip to content

Commit

Permalink
fix: remove unnecessary extra condition
Browse files Browse the repository at this point in the history
  • Loading branch information
zoruka committed Aug 6, 2024
1 parent 2083dec commit 22dfcb3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions advanced/wallets/react-wallet-v2/src/lib/SolanaLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,10 @@ export default class SolanaLib {
isWritable: key.isWritable
}))
const programId = new PublicKey(instruction.programId)
const data = (() => {
if (typeof instruction.data === 'undefined') {
return undefined
}

if (typeof instruction.data === 'string') {
return Buffer.from(bs58.decode(instruction.data).buffer)
}

return instruction.data
})()
const data =
typeof instruction.data === 'string'
? Buffer.from(bs58.decode(instruction.data).buffer)
: instruction.data

return new TransactionInstruction({
keys,
Expand Down

0 comments on commit 22dfcb3

Please sign in to comment.