Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Dec 1, 2023
1 parent e526c00 commit 4c81dde
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bindings/nodejs/lib/types/utils/bridge/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export interface __IsAddressValidMethod__ {
export interface __ProtocolParametersHashMethod__ {
name: 'protocolParametersHash';
data: {
protocol_parameters: ProtocolParameters;
protocolParameters: ProtocolParameters;
};
}

Expand Down
6 changes: 3 additions & 3 deletions bindings/nodejs/lib/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,16 @@ export class Utils {
/**
* Compute the hash of an instance of ProtocolParameters.
*
* @param protocol_parameters A ProtocolParameters instance.
* @param protocolParameters A ProtocolParameters instance.
* @returns The hash of the protocol parameters as a hex-encoded string.
*/
static protocolParametersHash(
protocol_parameters: ProtocolParameters,
protocolParameters: ProtocolParameters,
): HexEncodedString {
return callUtilsMethod({
name: 'protocolParametersHash',
data: {
protocol_parameters,
protocolParameters,
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/tests/client/examples.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { describe, it } from '@jest/globals';
import { expect, describe, it } from '@jest/globals';
import {
Client,
utf8ToHex,
Expand Down
10 changes: 5 additions & 5 deletions bindings/nodejs/tests/types/protocol_parameters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { describe, it } from '@jest/globals';
import { expect } from '@jest/globals';
import { ProtocolParameters } from '../../lib/types/models/info/node-info-protocol';
import { Utils } from '../../lib/utils/utils';
import 'reflect-metadata';

import { expect, describe, it } from '@jest/globals';
import * as protocol_parameters from '../../../../sdk/tests/types/fixtures/protocol_parameters.json';
import { ProtocolParameters } from '../../lib/types/models/info/node-info-protocol';
import { Utils } from '../../';

describe('ProtocolParameters tests', () => {

it('compares ProtocolParameters hash from a fixture', async () => {

const params = protocol_parameters.params as unknown as ProtocolParameters;
const hash = Utils.protocolParametersHash(params);

const expected_hash = protocol_parameters.hash;

expect(hash).toEqual(expected_hash);
Expand Down

0 comments on commit 4c81dde

Please sign in to comment.