Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update protocol parameters fixture #2095

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions bindings/nodejs/tests/client/infoMethods.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ describe.skip('Client info methods', () => {
});
});

// TODO: enable after ProtocolParameters fixture is updated https://github.com/iotaledger/iota-sdk/issues/2040
// describe('Offline client info methods', () => {
// it('provided protocol parameters', async () => {
// const protocolParameters = protocolParametersFixture.params;
// const client = await Client.create({
// protocolParameters
// });
// const networkInfo = await client.getNetworkInfo();

// expect(networkInfo.protocolParameters).toStrictEqual(protocolParameters);
// });
// })
describe('Offline client info methods', () => {
it('provided protocol parameters', async () => {
const protocolParameters = protocolParametersFixture.params;
const client = await Client.create({
protocolParameters
});
const networkInfo = await client.getNetworkInfo();

expect(networkInfo.protocolParameters).toStrictEqual(protocolParameters);
});
})
14 changes: 7 additions & 7 deletions bindings/python/tests/test_protocol_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# SPDX-License-Identifier: Apache-2.0

import json
# from iota_sdk import ProtocolParameters, Utils
from iota_sdk import ProtocolParameters, Utils


protocol_params_json = {}
with open('../../sdk/tests/types/fixtures/protocol_parameters.json', "r", encoding="utf-8") as json_file:
protocol_params_json = json.load(json_file)


# def test_protocol_parameters():
# protocol_params_dict = protocol_params_json['params']
# protocol_params = ProtocolParameters.from_dict(protocol_params_dict)
# assert protocol_params.to_dict() == protocol_params_dict
def test_protocol_parameters():
protocol_params_dict = protocol_params_json['params']
protocol_params = ProtocolParameters.from_dict(protocol_params_dict)
assert protocol_params.to_dict() == protocol_params_dict

# expected_hash = protocol_params_json['hash']
# assert Utils.protocol_parameters_hash(protocol_params) == expected_hash
expected_hash = protocol_params_json['hash']
assert Utils.protocol_parameters_hash(protocol_params) == expected_hash
Loading
Loading