Skip to content

Commit 0aedeb1

Browse files
fix: fix freeze timestamp for node add command (#327)
Signed-off-by: Jeffrey Tang <[email protected]>
1 parent b3d2f16 commit 0aedeb1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/commands/node.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,10 @@ export class NodeCommand extends BaseCommand {
14551455
)
14561456

14571457
const futureDate = new Date()
1458-
futureDate.setDate(futureDate.getDate() + (1 / 24 / 60)) // 1 minute in the future
1458+
this.logger.debug(`Current time: ${futureDate}`)
1459+
1460+
futureDate.setTime(futureDate.getTime() + 20000) // 20 seconds in the future
1461+
this.logger.debug(`Freeze time: ${futureDate}`)
14591462

14601463
const freezeUpgradeTx = await new FreezeTransaction()
14611464
.setFreezeType(FreezeType.FreezeUpgrade)
@@ -1465,7 +1468,10 @@ export class NodeCommand extends BaseCommand {
14651468
.freezeWith(client)
14661469
.execute(client)
14671470

1468-
this.logger.debug(`Upgrade frozen with transaction id: ${freezeUpgradeTx.transactionId.toString()}`)
1471+
const freezeUpgradeReceipt = await freezeUpgradeTx.getReceipt(client)
1472+
1473+
this.logger.debug(`Upgrade frozen with transaction id: ${freezeUpgradeTx.transactionId.toString()}`,
1474+
freezeUpgradeReceipt.status.toString())
14691475
} catch (e) {
14701476
this.logger.error(`Error in freeze upgrade: ${e.message}`, e)
14711477
throw new FullstackTestingError(`Error in freeze upgrade: ${e.message}`, e)

test/unit/core/helpers.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
import { describe, expect, it } from '@jest/globals'
1818
import * as helpers from '../../../src/core/helpers.mjs'
19+
import { HEDERA_PLATFORM_VERSION } from '../../../version.mjs'
1920

2021
describe('Helpers', () => {
2122
it.each([
@@ -65,7 +66,8 @@ describe('Helpers', () => {
6566
{ input: 'v0.45.1', output: 'hashgraph/full-stack-testing/ubi8-init-java17' },
6667
{ input: 'v0.46.0', output: 'hashgraph/full-stack-testing/ubi8-init-java21' },
6768
{ input: 'v0.47.1', output: 'hashgraph/full-stack-testing/ubi8-init-java21' },
68-
{ input: 'v0.47.1-alpha.0', output: 'hashgraph/full-stack-testing/ubi8-init-java21' }
69+
{ input: 'v0.47.1-alpha.0', output: 'hashgraph/full-stack-testing/ubi8-init-java21' },
70+
{ input: HEDERA_PLATFORM_VERSION, output: 'hashgraph/full-stack-testing/ubi8-init-java21' }
6971
])('should be able to determine root-image based on Hedera platform version', (t) => {
7072
expect(helpers.getRootImageRepository(t.input)).toStrictEqual(t.output)
7173
})

0 commit comments

Comments
 (0)