Skip to content

Commit

Permalink
tests: update lock file, ts: adjust translate address so it doesnt cr…
Browse files Browse the repository at this point in the history
…eate new pubkey if Pubkey object is passed in
  • Loading branch information
paul-schaaf committed Dec 14, 2021
1 parent 7cdf88a commit 310a2ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/yarn.lock
Expand Up @@ -50,17 +50,17 @@
snake-case "^3.0.4"
toml "^3.0.0"

"@project-serum/anchor@^0.18.2":
version "0.18.2"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.18.2.tgz#0f13b5c2046446b7c24cf28763eec90febb28485"
integrity sha512-uyjiN/3Ipp+4hrZRm/hG18HzGLZyvP790LXrCsGO3IWxSl28YRhiGEpKnZycfMW94R7nxdUoE3wY67V+ZHSQBQ==
"@project-serum/anchor@^0.19.0":
version "0.19.0"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.19.0.tgz#79f1fbe7c3134860ccbfe458a0e09daf79644885"
integrity sha512-cs0LBmJOrL9eJ8MRNqitnzbpCT5QEzVdJmiIjfNV5YaGn1K9vISR7DtISj3Bdl3KBdLqii4CTw1mpHdi8iXUCg==
dependencies:
"@project-serum/borsh" "^0.2.2"
"@solana/web3.js" "^1.17.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.0"
buffer-layout "^1.2.2"
camelcase "^5.3.1"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
Expand Down Expand Up @@ -334,7 +334,7 @@ buffer-from@^1.0.0, buffer-from@^1.1.0:
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==

buffer-layout@^1.2.0:
buffer-layout@^1.2.0, buffer-layout@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5"
integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==
Expand Down
4 changes: 1 addition & 3 deletions ts/src/program/common.ts
Expand Up @@ -55,9 +55,7 @@ export function validateAccounts(

// Translates an address to a Pubkey.
export function translateAddress(address: Address): PublicKey {
return (address as any)._bn !== undefined
? (address as PublicKey)
: new PublicKey(address);
return address instanceof PublicKey ? address : new PublicKey(address);
}

/**
Expand Down

0 comments on commit 310a2ac

Please sign in to comment.