diff --git a/__tests__/__fixtures__/http-fixtures.js b/__tests__/__fixtures__/http-fixtures.js index 172a490e..c3b39984 100644 --- a/__tests__/__fixtures__/http-fixtures.js +++ b/__tests__/__fixtures__/http-fixtures.js @@ -1072,7 +1072,7 @@ export default { nc_pubkey: '033f5d238afaa9e2218d05dd7fa50eb6f9e55431e6359e04b861cd991ae24dc655' }] }, - '/nano_contract/blueprint': { + '/nano_contract/blueprint/info': { id: '3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595', name: 'Test', public_methods: { diff --git a/__tests__/integration/docker-compose.yml b/__tests__/integration/docker-compose.yml index 9b4738a4..f3ca2262 100644 --- a/__tests__/integration/docker-compose.yml +++ b/__tests__/integration/docker-compose.yml @@ -6,7 +6,7 @@ services: fullnode: image: - ${HATHOR_LIB_INTEGRATION_TESTS_FULLNODE_IMAGE:-hathornetwork/hathor-core:experimental-nano-sdk-v1.1} + ${HATHOR_LIB_INTEGRATION_TESTS_FULLNODE_IMAGE:-hathornetwork/hathor-core:experimental-nano-sdk-v1.5-rc4} command: [ "run_node", "--listen", "tcp:40404", diff --git a/__tests__/integration/nano-contracts.test.js b/__tests__/integration/nano-contracts.test.js index e24573f9..17bae607 100644 --- a/__tests__/integration/nano-contracts.test.js +++ b/__tests__/integration/nano-contracts.test.js @@ -77,7 +77,6 @@ describe('nano contract routes', () => { // Bet 100 to address 2 const address2 = await wallet.getAddressAt(2); - const address2Obj = new Address(address2, { network }); const responseBet = await TestUtils.request .post('/wallet/nano-contracts/execute') .send({ @@ -86,7 +85,7 @@ describe('nano contract routes', () => { method: 'bet', data: { args: [ - bufferUtils.bufferToHex(address2Obj.decode()), + address2, '1x0' ], actions: [ @@ -106,7 +105,6 @@ describe('nano contract routes', () => { // Bet 200 to address 3 const address3 = await wallet.getAddressAt(3); - const address3Obj = new Address(address3, { network }); const responseBet2 = await TestUtils.request .post('/wallet/nano-contracts/execute') .send({ @@ -115,7 +113,7 @@ describe('nano contract routes', () => { method: 'bet', data: { args: [ - bufferUtils.bufferToHex(address3Obj.decode()), + address3, '2x0' ], actions: [ @@ -153,7 +151,7 @@ describe('nano contract routes', () => { 'total', 'final_result', 'oracle_script', - 'date_last_offer', + 'date_last_bet', `address_details.a'${address2}'`, `withdrawals.a'${address2}'`, `address_details.a'${address3}'`, @@ -166,7 +164,7 @@ describe('nano contract routes', () => { const outputScriptBuffer1 = outputScriptObj1.createScript(); expect(ncState.fields.token_uid.value).toBe(HATHOR_TOKEN_ID); - expect(ncState.fields.date_last_offer.value).toBe(dateLastBet); + expect(ncState.fields.date_last_bet.value).toBe(dateLastBet); expect(ncState.fields.oracle_script.value).toBe(bufferUtils.bufferToHex(outputScriptBuffer1)); expect(ncState.fields.final_result.value).toBeNull(); expect(ncState.fields.total.value).toBe(300); @@ -230,7 +228,7 @@ describe('nano contract routes', () => { 'total', 'final_result', 'oracle_script', - 'date_last_offer', + 'date_last_bet', `address_details.a'${address2}'`, `withdrawals.a'${address2}'`, `address_details.a'${address3}'`, @@ -239,7 +237,7 @@ describe('nano contract routes', () => { .set({ 'x-wallet-id': wallet.walletId }); const ncState2 = responseState2.body.state; expect(ncState2.fields.token_uid.value).toBe(HATHOR_TOKEN_ID); - expect(ncState2.fields.date_last_offer.value).toBe(dateLastBet); + expect(ncState2.fields.date_last_bet.value).toBe(dateLastBet); expect(ncState2.fields.oracle_script.value).toBe(bufferUtils.bufferToHex(outputScriptBuffer1)); expect(ncState2.fields.final_result.value).toBe('1x0'); expect(ncState2.fields.total.value).toBe(300); diff --git a/__tests__/test-utils.js b/__tests__/test-utils.js index 0a590440..a5c3d9a4 100644 --- a/__tests__/test-utils.js +++ b/__tests__/test-utils.js @@ -220,7 +220,7 @@ class TestUtils { httpMock.onGet('http://fake.txmining:8084/health').reply(200, httpFixtures['http://fake.txmining:8084/health']); httpMock.onGet('/nano_contract/state').reply(200, httpFixtures['/nano_contract/state']); httpMock.onGet('/nano_contract/history').reply(200, httpFixtures['/nano_contract/history']); - httpMock.onGet('/nano_contract/blueprint').reply(200, httpFixtures['/nano_contract/blueprint']); + httpMock.onGet('/nano_contract/blueprint/info').reply(200, httpFixtures['/nano_contract/blueprint/info']); // Fireblocks mock httpMock.onGet(/http:\/\/fake-fireblocks-url\/v1\/transactions\/external_tx_id\/*/).reply(fireblocksFixtures.transaction_status); diff --git a/package-lock.json b/package-lock.json index a2cc9a47..2a171af4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@dinamonetworks/hsm-dinamo": "4.9.1", "@hathor/healthcheck-lib": "0.1.0", - "@hathor/wallet-lib": "1.9.0", + "@hathor/wallet-lib": "1.10.0", "axios": "1.7.2", "express": "4.18.2", "express-validator": "6.10.0", @@ -2168,9 +2168,9 @@ "integrity": "sha512-Oi223+iKye5cmPyMIqp64E/ZP+in0JndN/s9uEigmXxt6wRhwciCPbzSY4S2oicy1uNqhv7lLdyUc3O/P3sCzQ==" }, "node_modules/@hathor/wallet-lib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@hathor/wallet-lib/-/wallet-lib-1.9.0.tgz", - "integrity": "sha512-8m6sr/PObnRoCsmalV2AqKO+tMPyzI/Lw/eJ0KgtaZSn7drBeFlDRhYyEilxpFqq9BCzvx18i8tXAudFoW2OUQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@hathor/wallet-lib/-/wallet-lib-1.10.0.tgz", + "integrity": "sha512-oxQoxnwZNDrgjnvblx0ipVOxMNeM8W2PJkQpyzZJyl1QpRyhqHqqyYD0iSn1bhQEq8C1IRoSrvjsd3Af5eHdWQ==", "dependencies": { "abstract-level": "1.0.4", "axios": "1.7.2", diff --git a/package.json b/package.json index 6575a36f..3d9b416b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dependencies": { "@dinamonetworks/hsm-dinamo": "4.9.1", "@hathor/healthcheck-lib": "0.1.0", - "@hathor/wallet-lib": "1.9.0", + "@hathor/wallet-lib": "1.10.0", "axios": "1.7.2", "express": "4.18.2", "express-validator": "6.10.0",