Skip to content

Commit

Permalink
project-serum#172 use bs58 lib
Browse files Browse the repository at this point in the history
  • Loading branch information
gotjoshua committed Sep 30, 2021
1 parent a628aad commit 92e9c5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/serum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@project-serum/anchor": "^0.11.1",
"@solana/spl-token": "^0.1.6",
"@solana/web3.js": "^1.21.0",
"basex-encoder": "^0.0.10",
"bn.js": "^5.1.2",
"bs58": "^4.0.1",
"buffer-layout": "^1.2.0"
},
"browserslist": [
Expand Down
8 changes: 2 additions & 6 deletions packages/serum/src/instructions.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { encodeInstruction, decodeInstruction } from './instructions';
import BN from 'bn.js';
import { encoder } from "basex-encoder";

const base58 = encoder(
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
);
import base58 from 'bs58';

describe('instruction', () => {
it('encodes initialize market', () => {
Expand Down Expand Up @@ -39,7 +35,7 @@ describe('instruction', () => {
it('decodes new order from rawbytes', () => {
const newOrderExpectedJSON = '{"newOrderV3":{"side":"buy","limitPrice":"011d28","maxBaseQuantity":"0122","maxQuoteQuantity":"7e2edb40","selfTradeBehavior":"decrementTake","orderType":"limit","clientId":"00","limit":65535}}'
const newOrderInstData58 = '189VEfQCdeLeDg3Y6qq3iVwwij5GobKfSvh42MPYfkCpGVM4TkjdwRK9FdLswwBvABt5k'
const newOrderInstDataBytes = base58.decodeToBuffer(newOrderInstData58)
const newOrderInstDataBytes = base58.decode(newOrderInstData58)
const orderObj = decodeInstruction(newOrderInstDataBytes);
expect(JSON.stringify(orderObj)).toEqual(newOrderExpectedJSON);
});
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2515,11 +2515,6 @@ base@^0.11.1:
mixin-deep "^1.2.0"
pascalcase "^0.1.1"

basex-encoder@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/basex-encoder/-/basex-encoder-0.0.10.tgz#3c89e54a49650133a6920cf4a57506032cd86ab4"
integrity sha512-7C/hMsE+cWNTxy+N1heJ5e540eIHIUpF5jTRz9sdSRvCYDDvaSNZ1/tDUqm9fwDxhAZu6jkOexxlEvyoTzaRMg==

bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
Expand Down

0 comments on commit 92e9c5f

Please sign in to comment.