Skip to content

Commit

Permalink
Merge pull request #146 from tonlabs/0.25.4-rc
Browse files Browse the repository at this point in the history
Ability to use `crypto` module before `setup`.
  • Loading branch information
elasticLove1 authored Aug 3, 2020
2 parents f0e0de8 + b934fcc commit 441a9da
Show file tree
Hide file tree
Showing 11 changed files with 380 additions and 271 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Release Notes
All notable changes to this project will be documented in this file.

## 0.25.4 - July 31, 2020
### Fixed
- Ability to use `crypto` module before `setup`.

## 0.25.3 - July 29, 2020
### Fixed
- Fix test.
Expand Down
6 changes: 6 additions & 0 deletions __tests__/_/init-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ async function init() {
await readGiverKeys();
}

function newClient(): TONClient {
return new TONClient();
}

async function createClient(config: { accessKey?: string }): Promise<TONClient> {
return TONClient.create({
...tests.config,
Expand Down Expand Up @@ -107,6 +111,7 @@ async function done() {

export const tests: {
config: TONConfigData,
newClient(): TONClient,
createClient(config: { accessKey?: string }): Promise<TONClient>,
client: TONClient,
init(): Promise<void>,
Expand All @@ -130,6 +135,7 @@ export const tests: {
tracer: createJaegerTracer(''),
accessKey: 'bypass',
},
newClient,
createClient,
client: new TONClient(),
init,
Expand Down
5 changes: 5 additions & 0 deletions __tests__/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ beforeAll(tests.init);
afterAll(tests.done);
const TONMnemonicWordCounts = [12, 15, 18, 21, 24];
test('crypto', async () => {
const clientWithoutSetup = tests.newClient();
const result0 = await clientWithoutSetup.crypto.factorize('17ED48941A08F981');
expect(result0.a).toEqual("494C553B");
expect(result0.b).toEqual("53911073");

const crypto: TONCryptoModule = tests.client.crypto;

// Math
Expand Down
Loading

0 comments on commit 441a9da

Please sign in to comment.