diff --git a/CHANGELOG.md b/CHANGELOG.md index 1932dcfeb7..ed77fa5095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -458,7 +458,7 @@ Client Library | v0.7.20-alpha.6 | [nem2-sdk-openapi-typescript-node-client](ht - Fixed http repository `error handling` issues. - Fixed bugs in `Alias` interface. - Fixed `MosaicId significant byte` not detected properly in TransactionPayload. -- Fixed only `MIJIN_TEST` network type allowed in NetworkTypeHttp. +- Fixed only `PRIVATE_TEST` network type allowed in NetworkTypeHttp. - Applied latest OpenAPI doc (`v0.7.19`). - Changed `SignedTransaction` class constructor to public. - Changed `MosaicRestrictionKey` format to be Hexadecimal. diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index 10f7674927..57ab766b51 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -38,7 +38,6 @@ import { toArray, take } from 'rxjs/operators'; import { deepEqual } from 'assert'; import { Order } from '../../src/infrastructure/infrastructure'; import { AccountOrderBy } from '../../src/infrastructure/searchCriteria/AccountOrderBy'; -import { Duration } from 'js-joda'; describe('AccountHttp', () => { const helper = new IntegrationTestHelper(); @@ -57,7 +56,7 @@ describe('AccountHttp', () => { let generationHash: string; let networkType: NetworkType; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/BlockHttp.spec.ts b/e2e/infrastructure/BlockHttp.spec.ts index 1ebadeefe5..c1e2a7c4f2 100644 --- a/e2e/infrastructure/BlockHttp.spec.ts +++ b/e2e/infrastructure/BlockHttp.spec.ts @@ -31,7 +31,6 @@ import { take } from 'rxjs/operators'; import { TransactionStatement } from '../../src/model/model'; import { ReceiptPaginationStreamer } from '../../src/infrastructure/paginationStreamer/ReceiptPaginationStreamer'; import { Order } from '../../src/infrastructure/infrastructure'; -import { Duration } from 'js-joda'; describe('BlockHttp', () => { const helper = new IntegrationTestHelper(); @@ -44,7 +43,7 @@ describe('BlockHttp', () => { let networkType: NetworkType; let transactionHash; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/HashLockHttp.spec.ts b/e2e/infrastructure/HashLockHttp.spec.ts index 40a1456a73..3abf983cde 100644 --- a/e2e/infrastructure/HashLockHttp.spec.ts +++ b/e2e/infrastructure/HashLockHttp.spec.ts @@ -30,11 +30,10 @@ import { deepEqual } from 'assert'; import { Order, HashLockPaginationStreamer } from '../../src/infrastructure/infrastructure'; import { Mosaic } from '../../src/model/mosaic/Mosaic'; import { LockFundsTransaction } from '../../src/model/transaction/LockFundsTransaction'; -import { ChronoUnit } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { SignedTransaction } from '../../src/model/transaction/SignedTransaction'; import { UnresolvedMosaicId } from '../../src/model/mosaic/UnresolvedMosaicId'; import { HashLockRepository } from '../../src/infrastructure/HashLockRepository'; -import { Duration } from 'js-joda'; describe('HashLockHttp', () => { const helper = new IntegrationTestHelper(); @@ -49,7 +48,7 @@ describe('HashLockHttp', () => { let generationHash: string; let networkType: NetworkType; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/IntegrationTestHelper.ts b/e2e/infrastructure/IntegrationTestHelper.ts index 3bfd3dc31f..46ea5a6831 100644 --- a/e2e/infrastructure/IntegrationTestHelper.ts +++ b/e2e/infrastructure/IntegrationTestHelper.ts @@ -29,7 +29,6 @@ import { SignedTransaction } from '../../src/model/transaction/SignedTransaction import { Transaction } from '../../src/model/transaction/Transaction'; import { UInt64 } from '../../src/model/UInt64'; import { TransactionService } from '../../src/service/TransactionService'; -import { Duration } from 'js-joda'; export class IntegrationTestHelper { public apiUrl: string; @@ -53,7 +52,7 @@ export class IntegrationTestHelper { public service = new BootstrapService(); public config: StartParams; public startEachTime = true; - public epochAdjustment: Duration; + public epochAdjustment: number; private async startBootstrapServer(): Promise<{ accounts: string[]; apiUrl: string }> { this.config = { diff --git a/e2e/infrastructure/Listener.spec.ts b/e2e/infrastructure/Listener.spec.ts index 8dcea3873c..228901e457 100644 --- a/e2e/infrastructure/Listener.spec.ts +++ b/e2e/infrastructure/Listener.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { assert, expect } from 'chai'; -import { ChronoUnit, Duration } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { filter, mergeMap } from 'rxjs/operators'; import { TransactionRepository } from '../../src/infrastructure/TransactionRepository'; import { Account } from '../../src/model/account/Account'; @@ -47,7 +47,7 @@ describe('Listener', () => { let networkType: NetworkType; let transactionRepository: TransactionRepository; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/MetadataHttp.spec.ts b/e2e/infrastructure/MetadataHttp.spec.ts index 0bcc1d4984..832d196301 100644 --- a/e2e/infrastructure/MetadataHttp.spec.ts +++ b/e2e/infrastructure/MetadataHttp.spec.ts @@ -36,7 +36,6 @@ import { MetadataType } from '../../src/model/model'; import { Order, MetadataPaginationStreamer } from '../../src/infrastructure/infrastructure'; import { deepEqual } from 'assert'; import { take, toArray } from 'rxjs/operators'; -import { Duration } from 'js-joda'; describe('MetadataHttp', () => { const helper = new IntegrationTestHelper(); @@ -48,7 +47,7 @@ describe('MetadataHttp', () => { let networkType: NetworkType; let metadataRepository: MetadataRepository; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/MosaicHttp.spec.ts b/e2e/infrastructure/MosaicHttp.spec.ts index 7cae77425d..4a45f5e959 100644 --- a/e2e/infrastructure/MosaicHttp.spec.ts +++ b/e2e/infrastructure/MosaicHttp.spec.ts @@ -33,7 +33,6 @@ import { MosaicPaginationStreamer } from '../../src/infrastructure/paginationStr import { toArray, take } from 'rxjs/operators'; import { deepEqual } from 'assert'; import { TransactionGroup } from '../../src/infrastructure/TransactionGroup'; -import { Duration } from 'js-joda'; describe('MosaicHttp', () => { let mosaicId: MosaicId; @@ -45,7 +44,7 @@ describe('MosaicHttp', () => { const helper = new IntegrationTestHelper(); let networkType: NetworkType; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/MultisigAccounts.spec.ts b/e2e/infrastructure/MultisigAccounts.spec.ts index a04227f644..2bd1446bf8 100644 --- a/e2e/infrastructure/MultisigAccounts.spec.ts +++ b/e2e/infrastructure/MultisigAccounts.spec.ts @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Duration } from 'js-joda'; import { Account } from '../../src/model/account/Account'; import { NetworkType } from '../../src/model/network/NetworkType'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; @@ -30,7 +29,7 @@ describe('MultisigAccounts', () => { let generationHash: string; let networkType: NetworkType; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/NamespaceHttp.spec.ts b/e2e/infrastructure/NamespaceHttp.spec.ts index d922bb5fa5..863d3318b3 100644 --- a/e2e/infrastructure/NamespaceHttp.spec.ts +++ b/e2e/infrastructure/NamespaceHttp.spec.ts @@ -28,7 +28,6 @@ import { IntegrationTestHelper } from './IntegrationTestHelper'; import { NamespacePaginationStreamer } from '../../src/infrastructure/paginationStreamer/NamespacePaginationStreamer'; import { take, toArray } from 'rxjs/operators'; import { Order } from '../../src/infrastructure/infrastructure'; -import { Duration } from 'js-joda'; describe('NamespaceHttp', () => { let defaultNamespaceId: NamespaceId; @@ -38,7 +37,7 @@ describe('NamespaceHttp', () => { let generationHash: string; const helper = new IntegrationTestHelper(); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/PersistentHarvesting.spec.ts b/e2e/infrastructure/PersistentHarvesting.spec.ts index fc02e9abec..543cb784b5 100644 --- a/e2e/infrastructure/PersistentHarvesting.spec.ts +++ b/e2e/infrastructure/PersistentHarvesting.spec.ts @@ -33,7 +33,7 @@ describe('PersistentHarvesting', () => { const vrfKeyPair = Account.createFromPrivateKey( '82798EA9A2D2D202AFCCC82C40A287780BCA3C7F7A2FD5B754832804C6BE1BAA', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); before(() => { @@ -113,7 +113,7 @@ describe('PersistentHarvesting', () => { remoteAccount.privateKey, vrfKeyPair.privateKey, 'cfd84eca83508bbee954668e4aecca736caefa615367da76afe6985d695381db', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, helper.maxFee, ); diff --git a/e2e/infrastructure/RestrictionHttp.spec.ts b/e2e/infrastructure/RestrictionHttp.spec.ts index f0ce229df6..e94bb9a76f 100644 --- a/e2e/infrastructure/RestrictionHttp.spec.ts +++ b/e2e/infrastructure/RestrictionHttp.spec.ts @@ -36,7 +36,6 @@ import { UInt64 } from '../../src/model/UInt64'; import { IntegrationTestHelper } from './IntegrationTestHelper'; import { AddressRestrictionFlag } from '../../src/model/restriction/AddressRestrictionFlag'; import { MosaicAddressRestriction } from '../../src/model/restriction/MosaicAddressRestriction'; -import { Duration } from 'js-joda'; describe('RestrictionHttp', () => { const helper = new IntegrationTestHelper(); @@ -49,7 +48,7 @@ describe('RestrictionHttp', () => { let mosaicId: MosaicId; let referenceMosaicId: MosaicId; let restrictionAccountRepository: RestrictionAccountRepository; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index 584fb819c7..c81d889cfa 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { expect } from 'chai'; -import { ChronoUnit } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { sha3_256 } from 'js-sha3'; import { Crypto } from '../../src/core/crypto'; import { Convert, Convert as convert } from '../../src/core/format'; diff --git a/e2e/infrastructure/UnresolvedMapping.spec.ts b/e2e/infrastructure/UnresolvedMapping.spec.ts index 1348a82cae..faa5237a47 100644 --- a/e2e/infrastructure/UnresolvedMapping.spec.ts +++ b/e2e/infrastructure/UnresolvedMapping.spec.ts @@ -14,7 +14,6 @@ * limitations under the License. */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../src/core/format'; import { Account } from '../../src/model/account/Account'; import { PlainMessage } from '../../src/model/message/PlainMessage'; @@ -49,7 +48,7 @@ describe('Unresolved Mapping', () => { let mosaicId: MosaicId; let namespaceIdAddress: NamespaceId; let namespaceIdMosaic: NamespaceId; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { return helper.start({ openListener: true }).then(() => { diff --git a/e2e/service/MetadataTransactionService.spec.ts b/e2e/service/MetadataTransactionService.spec.ts index 9391a395b0..844bd0714b 100644 --- a/e2e/service/MetadataTransactionService.spec.ts +++ b/e2e/service/MetadataTransactionService.spec.ts @@ -1,5 +1,4 @@ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../src/core/format'; import { MetadataRepository } from '../../src/infrastructure/MetadataRepository'; import { Account } from '../../src/model/account/Account'; @@ -20,7 +19,7 @@ import { MetadataTransactionService } from '../../src/service/MetadataTransactio import { IntegrationTestHelper } from '../infrastructure/IntegrationTestHelper'; describe('MetadataTransactionService', () => { - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; const deadline = Deadline.create(epochAdjustment); const key = UInt64.fromUint(Math.round(Math.random() * 10)); const newValue = 'new test value'; diff --git a/e2e/service/MosaicRestrictionTransactionService.spec.ts b/e2e/service/MosaicRestrictionTransactionService.spec.ts index a4d6b733d7..fbaa6f0ec7 100644 --- a/e2e/service/MosaicRestrictionTransactionService.spec.ts +++ b/e2e/service/MosaicRestrictionTransactionService.spec.ts @@ -1,5 +1,4 @@ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { KeyGenerator } from '../../src/core/format/KeyGenerator'; import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository'; import { RestrictionMosaicRepository } from '../../src/infrastructure/RestrictionMosaicRepository'; @@ -25,7 +24,7 @@ import { MosaicRestrictionTransactionService } from '../../src/service/MosaicRes import { IntegrationTestHelper } from '../infrastructure/IntegrationTestHelper'; describe('MosaicRestrictionTransactionService', () => { - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; const deadline = Deadline.create(epochAdjustment); const key = KeyGenerator.generateUInt64Key('TestKey'); let account: Account; diff --git a/e2e/service/TransactionService_AggregateBonded.spec.ts b/e2e/service/TransactionService_AggregateBonded.spec.ts index 60477f96d5..1de1720d2a 100644 --- a/e2e/service/TransactionService_AggregateBonded.spec.ts +++ b/e2e/service/TransactionService_AggregateBonded.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { ChronoUnit } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository'; import { Account } from '../../src/model/account/Account'; import { Address } from '../../src/model/account/Address'; diff --git a/package.json b/package.json index d2a46893e4..089d9cf783 100644 --- a/package.json +++ b/package.json @@ -110,10 +110,6 @@ "tweetnacl": "^1.0.3", "ws": "^7.3.1" }, - "peerDependencies": { - "utf8": "^2.1.2", - "rxjs": "^6.5.3" - }, "nyc": { "exclude-after-remap": false, "exclude": [ diff --git a/src/core/utils/DtoMapping.ts b/src/core/utils/DtoMapping.ts index ea3247617a..50462119d5 100644 --- a/src/core/utils/DtoMapping.ts +++ b/src/core/utils/DtoMapping.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Duration } from 'js-joda'; +import { Duration } from '@js-joda/core'; import { Address } from '../../model/account/Address'; import { MosaicId } from '../../model/mosaic/MosaicId'; import { AccountRestriction } from '../../model/restriction/AccountRestriction'; diff --git a/src/infrastructure/RepositoryFactory.ts b/src/infrastructure/RepositoryFactory.ts index d106522066..05156a9600 100644 --- a/src/infrastructure/RepositoryFactory.ts +++ b/src/infrastructure/RepositoryFactory.ts @@ -33,7 +33,6 @@ import { TransactionRepository } from './TransactionRepository'; import { TransactionStatusRepository } from './TransactionStatusRepository'; import { HashLockRepository } from './HashLockRepository'; import { SecretLockRepository } from './SecretLockRepository'; -import { Duration } from 'js-joda'; /** * A repository factory allows clients to create repositories to access NEM Server without knowing @@ -139,7 +138,7 @@ export interface RepositoryFactory { createListener(): IListener; /** - * @returns nemesis block epoch + * @returns nemesis block epoch adjustment in seconds */ - getEpochAdjustment(): Observable; + getEpochAdjustment(): Observable; } diff --git a/src/infrastructure/RepositoryFactoryHttp.ts b/src/infrastructure/RepositoryFactoryHttp.ts index 979b928455..fe27e85104 100644 --- a/src/infrastructure/RepositoryFactoryHttp.ts +++ b/src/infrastructure/RepositoryFactoryHttp.ts @@ -53,7 +53,6 @@ import { HashLockRepository } from './HashLockRepository'; import { SecretLockRepository } from './SecretLockRepository'; import { SecretLockHttp } from './SecretLockHttp'; import { HashLockHttp } from './HashLockHttp'; -import { Duration } from 'js-joda'; import { DtoMapping } from '../core/utils/DtoMapping'; /** * Receipt http repository. @@ -66,7 +65,7 @@ export class RepositoryFactoryHttp implements RepositoryFactory { private readonly websocketUrl: string; private readonly websocketInjected?: any; private readonly fetchApi?: any; - private readonly epochAdjustment: Observable; + private readonly epochAdjustment: Observable; /** * Constructor @@ -79,12 +78,12 @@ export class RepositoryFactoryHttp implements RepositoryFactory { this.fetchApi = configs?.fetchApi; this.networkType = configs?.networkType ? observableOf(configs.networkType) : networkRepo.getNetworkType().pipe(shareReplay(1)); this.epochAdjustment = configs?.epochAdjustment - ? observableOf(Duration.ofSeconds(configs.epochAdjustment)) + ? observableOf(configs.epochAdjustment) : networkRepo .getNetworkProperties() .pipe( map((property) => { - return DtoMapping.parseServerDuration(property.network.epochAdjustment ?? '-'); + return DtoMapping.parseServerDuration(property.network.epochAdjustment ?? '-').seconds(); }), ) .pipe(shareReplay(1)); @@ -174,7 +173,7 @@ export class RepositoryFactoryHttp implements RepositoryFactory { return new Listener(this.websocketUrl, this.createNamespaceRepository(), this.websocketInjected); } - getEpochAdjustment(): Observable { + getEpochAdjustment(): Observable { return this.epochAdjustment; } } diff --git a/src/model/account/Address.ts b/src/model/account/Address.ts index a219d4ca61..b90f8cc929 100644 --- a/src/model/account/Address.ts +++ b/src/model/account/Address.ts @@ -52,6 +52,10 @@ export class Address { networkType = NetworkType.TEST_NET; } else if (addressTrimAndUpperCase.charAt(0) === 'N') { networkType = NetworkType.MAIN_NET; + } else if (addressTrimAndUpperCase.charAt(0) === 'P') { + networkType = NetworkType.PRIVATE; + } else if (addressTrimAndUpperCase.charAt(0) === 'Q') { + networkType = NetworkType.PRIVATE_TEST; } else { throw new Error('Address Network unsupported'); } @@ -69,7 +73,7 @@ export class Address { /** * Determines the validity of an raw address string. - * @param {string} rawAddress The raw address string. Expected format SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ + * @param {string} rawAddress The raw address string. Expected format QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ * @returns {boolean} true if the raw address string is valid, false otherwise. */ public static isValidRawAddress = (rawAddress: string): boolean => { diff --git a/src/model/network/NetworkType.ts b/src/model/network/NetworkType.ts index df8255cf4e..e84393456a 100644 --- a/src/model/network/NetworkType.ts +++ b/src/model/network/NetworkType.ts @@ -38,4 +38,14 @@ export enum NetworkType { * @type {number} */ MIJIN_TEST = 0x90, + /** + * Private net network + * @type {number} + */ + PRIVATE = 0x78, + /** + * Private test net network + * @type {number} + */ + PRIVATE_TEST = 0x80, } diff --git a/src/model/transaction/Deadline.ts b/src/model/transaction/Deadline.ts index 05433f672c..576f253958 100644 --- a/src/model/transaction/Deadline.ts +++ b/src/model/transaction/Deadline.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ChronoUnit, Duration, Instant, LocalDateTime, ZoneId } from 'js-joda'; +import { ChronoUnit, Duration, Instant, LocalDateTime, ZoneId } from '@js-joda/core'; import { UInt64 } from '../UInt64'; /** @@ -29,19 +29,19 @@ export class Deadline { /** * Create deadline model. Default to 2 chrono hours in advance. - * @param {Duration} epochAdjustment the network's epoch adjustment (seconds). Defined in the network/properties. e.g. Duration.ofSeconds(1573430400); + * @param {number} epochAdjustment the network's epoch adjustment (seconds). Defined in the network/properties. e.g. 1573430400; * @param {number} deadline the deadline unit value. * @param {ChronoUnit} chronoUnit the crhono unit. e.g ChronoUnit.HOURS * @returns {Deadline} */ - public static create(epochAdjustment: Duration, deadline = 2, chronoUnit: ChronoUnit = ChronoUnit.HOURS): Deadline { + public static create(epochAdjustment: number, deadline = 2, chronoUnit: ChronoUnit = ChronoUnit.HOURS): Deadline { const now = Instant.now(); const deadlineDateTime = now.plus(deadline, chronoUnit); if (deadline <= 0) { throw new Error('deadline should be greater than 0'); } - return new Deadline(deadlineDateTime.minusMillis(epochAdjustment.toMillis()).toEpochMilli()); + return new Deadline(deadlineDateTime.minusMillis(Duration.ofSeconds(epochAdjustment).toMillis()).toEpochMilli()); } /** @@ -87,20 +87,26 @@ export class Deadline { /** * Returns deadline as local date time. - * @param epochAdjustment the network's epoch adjustment. Defined in the network/properties. + * @param epochAdjustment the network's epoch adjustment (seconds). Defined in the network/properties. * @returns {LocalDateTime} */ - public toLocalDateTime(epochAdjustment: Duration): LocalDateTime { - return LocalDateTime.ofInstant(Instant.ofEpochMilli(this.adjustedValue).plusMillis(epochAdjustment.toMillis()), ZoneId.SYSTEM); + public toLocalDateTime(epochAdjustment: number): LocalDateTime { + return LocalDateTime.ofInstant( + Instant.ofEpochMilli(this.adjustedValue).plusMillis(Duration.ofSeconds(epochAdjustment).toMillis()), + ZoneId.SYSTEM, + ); } /** * Returns deadline as local date time. - * @param epochAdjustment the network's epoch adjustment. Defined in the network/properties. + * @param epochAdjustment the network's epoch adjustment (seconds). Defined in the network/properties. * @param zoneId the Zone Id. * @returns {LocalDateTime} */ - public toLocalDateTimeGivenTimeZone(epochAdjustment: Duration, zoneId: ZoneId): LocalDateTime { - return LocalDateTime.ofInstant(Instant.ofEpochMilli(this.adjustedValue).plusMillis(epochAdjustment.toMillis()), zoneId); + public toLocalDateTimeGivenTimeZone(epochAdjustment: number, zoneId: ZoneId): LocalDateTime { + return LocalDateTime.ofInstant( + Instant.ofEpochMilli(this.adjustedValue).plusMillis(Duration.ofSeconds(epochAdjustment).toMillis()), + zoneId, + ); } } diff --git a/test/conf/conf.spec.ts b/test/conf/conf.spec.ts index fed52157ec..99d8622c6f 100644 --- a/test/conf/conf.spec.ts +++ b/test/conf/conf.spec.ts @@ -19,27 +19,27 @@ import { NetworkType } from '../../src/model/network/NetworkType'; export const TestingAccount = Account.createFromPrivateKey( '26b64cb10f005e5988a36744ca19e20d835ccc7c105aaa5f3b212da593180930', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); export const MultisigAccount = Account.createFromPrivateKey( '5edebfdbeb32e9146d05ffd232c8af2cf9f396caf9954289daa0362d097fff3b', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); export const CosignatoryAccount = Account.createFromPrivateKey( '2a2b1f5d366a5dd5dc56c3c757cf4fe6c66e2787087692cf329d7a49a594658b', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); export const Cosignatory2Account = Account.createFromPrivateKey( 'b8afae6f4ad13a1b8aad047b488e0738a437c7389d4ff30c359ac068910c1d59', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); export const Cosignatory3Account = Account.createFromPrivateKey( '111602be4d36f92dd60ca6a3c68478988578f26f6a02f8c72089839515ab603e', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); export const NIS2_URL = 'http://localhost:3000'; diff --git a/test/core/format/IdGenerator.spec.ts b/test/core/format/IdGenerator.spec.ts index 35cdd05eb1..4a5c1a4c3c 100644 --- a/test/core/format/IdGenerator.spec.ts +++ b/test/core/format/IdGenerator.spec.ts @@ -40,100 +40,106 @@ const mosaicTestVector = [ mosaicNonce: 2039925808, address_Public: 'NATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34SQ33Y', address_PublicTest: 'TATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA37JGO5Q', - address_Mijin: 'MATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34YACRA', - address_MijinTest: 'SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ', + address_Private: 'PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI', + address_PrivateTest: 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', mosaicId_Public: '044C577DBDD6DC71', mosaicId_PublicTest: '1796754FB181EF1E', - mosaicId_Mijin: '7DCEDD54DAEDF7B7', - mosaicId_MijinTest: '5BCD295FC8801FE6', + mosaicId_Private: '2DE5561540AAA72C', + mosaicId_PrivateTest: '123F8027103B6A36', }, { mosaicNonce: 1477337076, address_Public: 'NDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2YCZOQQ', address_PublicTest: 'TDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2YBO3KA', - address_Mijin: 'MDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22B27FI', - address_MijinTest: 'SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY', + address_Private: 'PDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2ZMEBFQ', + address_PrivateTest: 'QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY', mosaicId_Public: '7E45A001465DEEA0', mosaicId_PublicTest: '5E55573E3EBBB596', - mosaicId_Mijin: '0D47486978FA4316', - mosaicId_MijinTest: '55595BF89461E7C1', + mosaicId_Private: '2F6D0DA76516DA99', + mosaicId_PrivateTest: '3FAA7C57FDE45D34', }, { mosaicNonce: 1921674920, address_Public: 'NCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRH6SYIQ', address_PublicTest: 'TCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRE3VIBQ', - address_Mijin: 'MCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFDHL7I', - address_MijinTest: 'SCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFENHXQ', + address_Private: 'PCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREWK33Q', + address_PrivateTest: 'QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ', mosaicId_Public: '28E680397FDD9336', mosaicId_PublicTest: '2F05C98474E9B263', - mosaicId_Mijin: '51B440266AE7F5B4', - mosaicId_MijinTest: '5693742C8290F33E', + mosaicId_Private: '686E0DC244F5093D', + mosaicId_PrivateTest: '687F166E062368CC', }, { - mosaicNonce: 737150288, - address_Public: 'NDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWFDDCHA', - address_PublicTest: 'TDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWEPHRSI', - address_Mijin: 'MDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWFN3NKY', - address_MijinTest: 'SDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWH6N46A', - mosaicId_Public: '75FAE31C9E1CEE38', - mosaicId_PublicTest: '35C831D2A6D9702B', - mosaicId_Mijin: '0476D83DF29A0426', - mosaicId_MijinTest: '4F5597E18C0182BC', + mosaicNonce: 812613930, + publicKey: '2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F', + address_Public: 'NATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34SQ33Y', + address_PublicTest: 'TATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA37JGO5Q', + address_Private: 'PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI', + address_PrivateTest: 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', + mosaicId_Public: '296994F01121AFC9', + mosaicId_PublicTest: '570FB3ED9379624C', + mosaicId_Private: '09557FCB9DAB83DC', + mosaicId_PrivateTest: '64B6C017D5535A6F', }, { - mosaicNonce: 4118830514, - address_Public: 'NDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QAZ4BMQ', - address_PublicTest: 'TDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QCY5ZUA', - address_Mijin: 'MDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QCLCVEA', - address_MijinTest: 'SDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QDVZG2I', - mosaicId_Public: '656748D5F82E87A1', - mosaicId_PublicTest: '1CB636C5A32F0293', - mosaicId_Mijin: '35C2901E25DCF921', - mosaicId_MijinTest: '18FF3D8F9FA932D4', + mosaicNonce: 1456792364, + publicKey: '4875FD2E32875D1BC6567745F1509F0F890A1BF8EE59FA74452FA4183A270E03', + address_Public: 'NDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2YCZOQQ', + address_PublicTest: 'TDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2YBO3KA', + address_Private: 'PDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2ZMEBFQ', + address_PrivateTest: 'QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY', + mosaicId_Public: '14AA6D651D9081B4', + mosaicId_PublicTest: '3A334999B5C56073', + mosaicId_Private: '6D6DEB080F52932A', + mosaicId_PrivateTest: '01AD1589A9461E6F', }, { - mosaicNonce: 2640226657, - address_Public: 'NAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4SCMOAI', - address_PublicTest: 'TAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4RTFBQY', - address_Mijin: 'MAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4TEKNHA', - address_MijinTest: 'SAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4RYAIEA', - mosaicId_Public: '3840F6C79934A159', - mosaicId_PublicTest: '5B0FFAA57C41D62E', - mosaicId_Mijin: '11BA1D842237D52B', - mosaicId_MijinTest: '0585182BF5BC7B57', + mosaicNonce: 2843362027, + publicKey: '9F780097FB6A1F287ED2736A597B8EA7F08D20F1ECDB9935DE6694ECF1C58900', + address_Public: 'NCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRH6SYIQ', + address_PublicTest: 'TCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRE3VIBQ', + address_Private: 'PCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREWK33Q', + address_PrivateTest: 'QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ', + mosaicId_Public: '4A0C3A1CA50F2CFC', + mosaicId_PublicTest: '23CE1EAEBE30195A', + mosaicId_Private: '4CC83B59753ED5FD', + mosaicId_PrivateTest: '39C7DB9631F5FE3F', }, { - mosaicNonce: 1996615061, - address_Public: 'NBEOZ72O73OYXFDLID5KGBMP67MROHONPQHVKAI', - address_PublicTest: 'TBEOZ72O73OYXFDLID5KGBMP67MROHONPR72UPQ', - address_Mijin: 'MBEOZ72O73OYXFDLID5KGBMP67MROHONPTHVSXQ', - address_MijinTest: 'SBEOZ72O73OYXFDLID5KGBMP67MROHONPTACBLI', - mosaicId_Public: '5AA0FF3892EF3345', - mosaicId_PublicTest: '79BD9AF30668FBDF', - mosaicId_Mijin: '0F8D3270B8ADDF77', - mosaicId_MijinTest: '092E4A9D08A9C1C5', + mosaicNonce: 1686841592, + publicKey: '0815926E003CDD5AF0113C0E067262307A42CD1E697F53B683F7E5F9F57D72C9', + address_Public: 'NDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWFDDCHA', + address_PublicTest: 'TDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWEPHRSI', + address_Private: 'PDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWELJG3Y', + address_PrivateTest: 'QDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWESE7PY', + mosaicId_Public: '75A9C882F9A89606', + mosaicId_PublicTest: '748A1BD01A40DCF8', + mosaicId_Private: '2397BBB964A3ACCB', + mosaicId_PrivateTest: '1E93C145FA44F966', }, { - mosaicNonce: 205824978, - address_Public: 'NAMJCSC2BEW52LVAULFRRJJTSRHLI7ABRG2X5RI', - address_PublicTest: 'TAMJCSC2BEW52LVAULFRRJJTSRHLI7ABRHFJZ5I', - address_Mijin: 'MAMJCSC2BEW52LVAULFRRJJTSRHLI7ABRG7GL5A', - address_MijinTest: 'SAMJCSC2BEW52LVAULFRRJJTSRHLI7ABRGLZY6A', - mosaicId_Public: '3AB75AF98A5E0365', - mosaicId_PublicTest: '3494FFAE1F6B2B4D', - mosaicId_Mijin: '3DF5D3B47E956692', - mosaicId_MijinTest: '4AA757991E36C79C', + mosaicNonce: 4206379750, + publicKey: '3683B3E45E76870CFE076E47C2B34CE8E3EAEC26C8AA7C1ED752E3E840AF8A27', + address_Public: 'NDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QAZ4BMQ', + address_PublicTest: 'TDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QCY5ZUA', + address_Private: 'PDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QAAJTUI', + address_PrivateTest: 'QDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QDQKH7Y', + mosaicId_Public: '3E949FBC6D09833D', + mosaicId_PublicTest: '40B85E3227EE56A0', + mosaicId_Private: '5A0D55D5D2F104F9', + mosaicId_PrivateTest: '59C829B71AB2A92F', }, { - mosaicNonce: 3310277026, - address_Public: 'NCOVTFVVDZGNURZFU4IJLJR37X5TXNWMTSEHR6I', - address_PublicTest: 'TCOVTFVVDZGNURZFU4IJLJR37X5TXNWMTTXN3DI', - address_Mijin: 'MCOVTFVVDZGNURZFU4IJLJR37X5TXNWMTTARXZQ', - address_MijinTest: 'SCOVTFVVDZGNURZFU4IJLJR37X5TXNWMTSJ6YWY', - mosaicId_Public: '213E6E2EC43285C4', - mosaicId_PublicTest: '659C0D4A03D119D2', - mosaicId_Mijin: '756AC167798FA3DF', - mosaicId_MijinTest: '164D3F56862E9520', + mosaicNonce: 2539328334, + publicKey: '4F593111964B37A9CAC59D2A70BC959AE9269589B75FBD640145EB0038960540', + address_Public: 'NAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4SCMOAI', + address_PublicTest: 'TAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4RTFBQY', + address_Private: 'PAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4QVXSZQ', + address_PrivateTest: 'QAA6RO4ZAPEDGTCVADE3G4C7SWAE3DBQ4SFZ2DY', + mosaicId_Public: '1B5FFAEBF3C9602A', + mosaicId_PublicTest: '503EBA0288209C64', + mosaicId_Private: '41CF06028C230DF4', + mosaicId_PrivateTest: '11DD950C45CA34AE', }, ]; @@ -193,8 +199,8 @@ describe('id generator', () => { mosaicTestVector.map((row) => { const addressPublic = Address.createFromRawAddress(row.address_Public); const addressTest = Address.createFromRawAddress(row.address_PublicTest); - const addressMijin = Address.createFromRawAddress(row.address_Mijin); - const addressMijinTest = Address.createFromRawAddress(row.address_MijinTest); + const addressPrivate = Address.createFromRawAddress(row.address_Private); + const addressPrivateTest = Address.createFromRawAddress(row.address_PrivateTest); // Assert: expect( @@ -206,13 +212,13 @@ describe('id generator', () => { 'PublicTest', ).to.deep.equal(row.mosaicId_PublicTest); expect( - MosaicId.createFromNonce(MosaicNonce.createFromNumber(row.mosaicNonce), addressMijin).toHex(), - 'Mijin', - ).to.deep.equal(row.mosaicId_Mijin); + MosaicId.createFromNonce(MosaicNonce.createFromNumber(row.mosaicNonce), addressPrivate).toHex(), + 'Private', + ).to.deep.equal(row.mosaicId_Private); expect( - MosaicId.createFromNonce(MosaicNonce.createFromNumber(row.mosaicNonce), addressMijinTest).toHex(), - 'MijinTest', - ).to.deep.equal(row.mosaicId_MijinTest); + MosaicId.createFromNonce(MosaicNonce.createFromNumber(row.mosaicNonce), addressPrivateTest).toHex(), + 'PrivateTest', + ).to.deep.equal(row.mosaicId_PrivateTest); }); }); }); diff --git a/test/core/format/RawAddress.spec.ts b/test/core/format/RawAddress.spec.ts index a7d98455af..3b567e4e8f 100644 --- a/test/core/format/RawAddress.spec.ts +++ b/test/core/format/RawAddress.spec.ts @@ -94,28 +94,28 @@ describe('address', () => { describe('publicKeyToAddress', () => { it('can create address from public key for well known network', () => { // Arrange: - const expectedHex = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const expectedHex = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const publicKey = convert.hexToUint8('2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F'); // Act: - const decoded = address.publicKeyToAddress(publicKey, NetworkType.MIJIN); + const decoded = address.publicKeyToAddress(publicKey, NetworkType.PRIVATE); // Assert: - expect(decoded[0]).to.equal(NetworkType.MIJIN); + expect(decoded[0]).to.equal(NetworkType.PRIVATE); expect(address.isValidAddress(decoded)).to.equal(true); expect(convert.uint8ToHex(decoded)).to.equal(expectedHex); }); it('can create address from public key for custom network', () => { // Arrange: - const expectedHex = '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B2'; + const expectedHex = '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A'; const publicKey = convert.hexToUint8('2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F'); // Act: - const decoded = address.publicKeyToAddress(publicKey, NetworkType.MIJIN_TEST); + const decoded = address.publicKeyToAddress(publicKey, NetworkType.PRIVATE_TEST); // Assert: - expect(decoded[0]).to.equal(NetworkType.MIJIN_TEST); + expect(decoded[0]).to.equal(NetworkType.PRIVATE_TEST); expect(address.isValidAddress(decoded)).to.equal(true); expect(convert.uint8ToHex(decoded)).to.equal(expectedHex); }); @@ -125,8 +125,8 @@ describe('address', () => { const publicKey = convert.hexToUint8('2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F'); // Act: - const decoded1 = address.publicKeyToAddress(publicKey, NetworkType.MIJIN_TEST); - const decoded2 = address.publicKeyToAddress(publicKey, NetworkType.MIJIN_TEST); + const decoded1 = address.publicKeyToAddress(publicKey, NetworkType.PRIVATE_TEST); + const decoded2 = address.publicKeyToAddress(publicKey, NetworkType.PRIVATE_TEST); // Assert: expect(address.isValidAddress(decoded1)).to.equal(true); @@ -139,8 +139,8 @@ describe('address', () => { const publicKey2 = convert.hexToUint8('4875FD2E32875D1BC6567745F1509F0F890A1BF8EE59FA74452FA4183A270E03'); // Act: - const decoded1 = address.publicKeyToAddress(publicKey1, NetworkType.MIJIN_TEST); - const decoded2 = address.publicKeyToAddress(publicKey2, NetworkType.MIJIN_TEST); + const decoded1 = address.publicKeyToAddress(publicKey1, NetworkType.PRIVATE_TEST); + const decoded2 = address.publicKeyToAddress(publicKey2, NetworkType.PRIVATE_TEST); // Assert: expect(address.isValidAddress(decoded1)).to.equal(true); @@ -153,7 +153,7 @@ describe('address', () => { const publicKey = convert.hexToUint8('4875FD2E32875D1BC6567745F1509F0F890A1BF8EE59FA74452FA4183A270E03'); // Act: - const decoded1 = address.publicKeyToAddress(publicKey, NetworkType.MIJIN_TEST); + const decoded1 = address.publicKeyToAddress(publicKey, NetworkType.PRIVATE_TEST); const decoded2 = address.publicKeyToAddress(publicKey, NetworkType.TEST_NET); // Assert: @@ -166,7 +166,7 @@ describe('address', () => { describe('isValidAddress', () => { it('returns true for valid address', () => { // Arrange: - const validHex = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const validHex = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const decoded = convert.hexToUint8(validHex); // Assert: @@ -175,7 +175,7 @@ describe('address', () => { it('returns false for address with invalid checksum', () => { // Arrange: - const validHex = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const validHex = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const decoded = convert.hexToUint8(validHex); decoded[Address_Decoded_Size - 1] ^= 0xff; // ruin checksum @@ -185,7 +185,7 @@ describe('address', () => { it('returns false for address with invalid hash', () => { // Arrange: - const validHex = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const validHex = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const decoded = convert.hexToUint8(validHex); decoded[5] ^= 0xff; // ruin ripemd160 hash @@ -285,7 +285,7 @@ describe('address', () => { /** * @see https://raw.githubusercontent.com/nemtech/test-vectors/master/1.test-address.json */ - describe('Catapult test vector [MIJIN] - PublicKey to Address', () => { + describe('Catapult test vector [PRIVATE] - PublicKey to Address', () => { it('can create Address from Catapult public Key', () => { // Arrange: const Public_Keys = [ @@ -297,11 +297,11 @@ describe('address', () => { ]; const Addresses = [ - 'MATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34YACRA', - 'MDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22B27FI', - 'MCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFDHL7I', - 'MDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWFN3NKY', - 'MDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QCLCVEA', + 'PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI', + 'PDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2ZMEBFQ', + 'PCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREWK33Q', + 'PDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWELJG3Y', + 'PDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QAAJTUI', ]; // Sanity: @@ -313,7 +313,7 @@ describe('address', () => { const expectedAddress = Addresses[i]; // Act: - const result = address.addressToString(address.publicKeyToAddress(convert.hexToUint8(publicKeyHex), NetworkType.MIJIN)); + const result = address.addressToString(address.publicKeyToAddress(convert.hexToUint8(publicKeyHex), NetworkType.PRIVATE)); // Assert: const message = ` from ${publicKeyHex}`; @@ -325,7 +325,7 @@ describe('address', () => { /** * @see https://raw.githubusercontent.com/nemtech/test-vectors/master/1.test-address.json */ - describe('Catapult test vector [MIJIN_TEST] - PublicKey to Address', () => { + describe('Catapult test vector [PRIVATE_TEST] - PublicKey to Address', () => { it('can create Address from Catapult public Key', () => { // Arrange: const Public_Keys = [ @@ -337,11 +337,11 @@ describe('address', () => { ]; const Addresses = [ - 'SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ', - 'SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY', - 'SCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFENHXQ', - 'SDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWH6N46A', - 'SDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QDVZG2I', + 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', + 'QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY', + 'QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ', + 'QDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWESE7PY', + 'QDI5I7Z3BRBAAHTZHGONGOXX742CW4W5QDQKH7Y', ]; // Sanity: @@ -354,7 +354,7 @@ describe('address', () => { // Act: const result = address.addressToString( - address.publicKeyToAddress(convert.hexToUint8(publicKeyHex), NetworkType.MIJIN_TEST), + address.publicKeyToAddress(convert.hexToUint8(publicKeyHex), NetworkType.PRIVATE_TEST), ); // Assert: diff --git a/test/core/utils/DtoMapping.spec.ts b/test/core/utils/DtoMapping.spec.ts index 1000742b67..57589d364a 100644 --- a/test/core/utils/DtoMapping.spec.ts +++ b/test/core/utils/DtoMapping.spec.ts @@ -28,7 +28,7 @@ import { DtoMapping } from '../../../src/core/utils/DtoMapping'; describe('DtoMapping', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const mosaicId = new MosaicId('11F4B1B3AC033DB5'); diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index 8a61b47541..f8b33b0edf 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -69,24 +69,23 @@ import { NodeKeyLinkTransaction } from '../../../src/model/transaction/NodeKeyLi import { AddressRestrictionFlag } from '../../../src/model/restriction/AddressRestrictionFlag'; import { OperationRestrictionFlag } from '../../../src/model/restriction/OperationRestrictionFlag'; import { MosaicRestrictionFlag } from '../../../src/model/restriction/MosaicRestrictionFlag'; -import { Duration } from 'js-joda'; describe('TransactionMapping - createFromPayload', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); it('should create AccountRestrictionAddressTransaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); @@ -94,7 +93,7 @@ describe('TransactionMapping - createFromPayload', () => { const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AccountAddressRestrictionTransaction; expect(transaction.restrictionFlags).to.be.equal(AddressRestrictionFlag.AllowIncomingAddress); - expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.restrictionDeletions.length).to.be.equal(0); }); @@ -105,7 +104,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicRestrictionTransaction.signWith(account, generationHash); @@ -123,7 +122,7 @@ describe('TransactionMapping - createFromPayload', () => { OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); @@ -136,13 +135,13 @@ describe('TransactionMapping - createFromPayload', () => { it('should create AddressAliasTransaction', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = addressAliasTransaction.signWith(account, generationHash); @@ -152,7 +151,7 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.aliasAction).to.be.equal(AliasAction.Link); expect(transaction.namespaceId.id.lower).to.be.equal(33347626); expect(transaction.namespaceId.id.higher).to.be.equal(3779697293); - expect(transaction.address.plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(transaction.address.plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); }); it('should create MosaicAliasTransaction', () => { @@ -163,7 +162,7 @@ describe('TransactionMapping - createFromPayload', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicAliasTransaction.signWith(account, generationHash); @@ -184,7 +183,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); @@ -207,7 +206,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); @@ -228,7 +227,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); @@ -249,7 +248,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); @@ -270,7 +269,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); @@ -290,7 +289,7 @@ describe('TransactionMapping - createFromPayload', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicSupplyChangeTransaction.signWith(account, generationHash); @@ -307,10 +306,10 @@ describe('TransactionMapping - createFromPayload', () => { it('should create TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -319,12 +318,12 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.message.payload).to.be.equal('test-message'); expect(transaction.mosaics.length).to.be.equal(1); - expect(transaction.recipientToString()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(transaction.recipientToString()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); }); it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFENHXQ'); + const recipientAddress = Address.createFromRawAddress('QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -332,7 +331,7 @@ describe('TransactionMapping - createFromPayload', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = secretLockTransaction.signWith(account, generationHash); @@ -354,7 +353,7 @@ describe('TransactionMapping - createFromPayload', () => { sha3_256.create().update(Convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = secretProofTransaction.signWith(account, generationHash); @@ -371,9 +370,9 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), 2, 1, - [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST)], + [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST)], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = modifyMultisigAccountTransaction.signWith(account, generationHash); @@ -384,7 +383,7 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.minRemovalDelta).to.be.equal(1); expect( transaction.addressAdditions[0].equals( - Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST), ), ).to.be.true; expect(transaction.addressDeletions.length).to.be.equal(0); @@ -393,29 +392,29 @@ describe('TransactionMapping - createFromPayload', () => { it('should create AggregatedTransaction - Complete', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const accountLinkTransaction = AccountKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const vrfKeyLinkTransaction = VrfKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const nodeKeyLinkTransaction = NodeKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const votingKeyLinkTransaction = VotingKeyLinkTransaction.create( Deadline.create(epochAdjustment), @@ -423,13 +422,13 @@ describe('TransactionMapping - createFromPayload', () => { 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicGlobalRestrictionTransaction = MosaicGlobalRestrictionTransaction.create( Deadline.create(epochAdjustment), @@ -439,7 +438,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicRestrictionType.NONE, UInt64.fromUint(0), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicAddressRestrictionTransaction = MosaicAddressRestrictionTransaction.create( Deadline.create(epochAdjustment), @@ -447,7 +446,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), ); const accountMetadataTransaction = AccountMetadataTransaction.create( @@ -456,7 +455,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicMetadataTransaction = MosaicMetadataTransaction.create( Deadline.create(epochAdjustment), @@ -465,7 +464,7 @@ describe('TransactionMapping - createFromPayload', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( Deadline.create(epochAdjustment), @@ -474,7 +473,7 @@ describe('TransactionMapping - createFromPayload', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicAliasTransaction = MosaicAliasTransaction.create( @@ -482,7 +481,7 @@ describe('TransactionMapping - createFromPayload', () => { AliasAction.Link, new NamespaceId([2262289484, 3405110546]), new MosaicId([2262289484, 3405110546]), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const secretProofTransaction = SecretProofTransaction.create( @@ -491,7 +490,7 @@ describe('TransactionMapping - createFromPayload', () => { sha3_256.create().update(Convert.hexToUint8('B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7')).hex(), account.address, 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( @@ -511,7 +510,7 @@ describe('TransactionMapping - createFromPayload', () => { mosaicAliasTransaction.toAggregate(account.publicAccount), secretProofTransaction.toAggregate(account.publicAccount), ], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -527,16 +526,16 @@ describe('TransactionMapping - createFromPayload', () => { it('should create AggregatedTransaction - Bonded', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -549,14 +548,14 @@ describe('TransactionMapping - createFromPayload', () => { }); it('should create LockFundTransaction', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedLockFundTransaction = lockTransaction.signWith(account, generationHash); @@ -573,7 +572,7 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = accountLinkTransaction.signWith(account, generationHash); @@ -588,7 +587,7 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = vrfKeyLinkTransaction.signWith(account, generationHash); @@ -603,7 +602,7 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = nodeKeyLinkTransaction.signWith(account, generationHash); @@ -621,7 +620,7 @@ describe('TransactionMapping - createFromPayload', () => { 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = votingKeyLinkTransaction.signWith(account, generationHash); @@ -638,7 +637,7 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); @@ -654,7 +653,7 @@ describe('TransactionMapping - createFromPayload', () => { Deadline.create(epochAdjustment), 'root-test-namespace', 'parent-test-namespace', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); @@ -674,7 +673,7 @@ describe('TransactionMapping - createFromPayload', () => { MosaicRestrictionType.NONE, UInt64.fromUint(0), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = mosaicGlobalRestrictionTransaction.signWith(account, generationHash); @@ -698,7 +697,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), ); @@ -721,7 +720,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), ); @@ -745,7 +744,7 @@ describe('TransactionMapping - createFromPayload', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = accountMetadataTransaction.signWith(account, generationHash); @@ -766,7 +765,7 @@ describe('TransactionMapping - createFromPayload', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = mosaicMetadataTransaction.signWith(account, generationHash); @@ -789,7 +788,7 @@ describe('TransactionMapping - createFromPayload', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = namespaceMetadataTransaction.signWith(account, generationHash); @@ -807,10 +806,10 @@ describe('TransactionMapping - createFromPayload', () => { it('should throw error with invalid type', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -825,7 +824,7 @@ describe('TransactionMapping - createFromPayload', () => { describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -833,15 +832,15 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create TransferTransaction - Address', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; - expect((transaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.message.payload).to.be.equal('test-message'); }); @@ -851,7 +850,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => new NamespaceId([33347626, 3779697293]), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; @@ -864,15 +863,15 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create TransferTransaction - Encrypted Message', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], new EncryptedMessage('12324556'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; - expect((transaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.message.type).to.be.equal(MessageType.EncryptedMessage); }); @@ -881,7 +880,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(accountLinkTransaction.toJSON()) as AccountKeyLinkTransaction; @@ -895,7 +894,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(vrfKeyLinkTransaction.toJSON()) as VrfKeyLinkTransaction; @@ -909,7 +908,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(nodeKeyLinkTransaction.toJSON()) as NodeKeyLinkTransaction; @@ -926,7 +925,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(votingKeyLinkTransaction.toJSON()) as VotingKeyLinkTransaction; @@ -937,20 +936,20 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.linkAction).to.be.equal(LinkAction.Link); }); it('should create AccountRestrictionAddressTransaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO( addressRestrictionTransaction.toJSON(), ) as AccountAddressRestrictionTransaction; - expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.restrictionFlags).to.be.equal(AddressRestrictionFlag.AllowIncomingAddress); expect(transaction.restrictionDeletions.length).to.be.equal(0); }); @@ -962,7 +961,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(mosaicRestrictionTransaction.toJSON()) as AccountMosaicRestrictionTransaction; @@ -979,7 +978,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO( @@ -993,13 +992,13 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create AddressAliasTransaction', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(addressAliasTransaction.toJSON()) as AddressAliasTransaction; @@ -1016,7 +1015,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(mosaicAliasTransaction.toJSON()) as MosaicAliasTransaction; @@ -1032,7 +1031,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => MosaicFlags.create(false, false, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(mosaicDefinitionTransaction.toJSON()) as MosaicDefinitionTransaction; @@ -1051,7 +1050,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(mosaicSupplyChangeTransaction.toJSON()) as MosaicSupplyChangeTransaction; @@ -1062,7 +1061,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFENHXQ'); + const recipientAddress = Address.createFromRawAddress('QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -1070,7 +1069,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(secretLockTransaction.toJSON()) as SecretLockTransaction; @@ -1089,7 +1088,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(secretLockTransaction.toJSON()) as SecretLockTransaction; @@ -1101,7 +1100,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create SecretLockTransaction - resolved Mosaic', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTRFENHXQ'); + const recipientAddress = Address.createFromRawAddress('QCOXVZMAZJTT4I3F7EAZYGNGR77D6WPTREIM2RQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), new Mosaic(new MosaicId([1, 1]), UInt64.fromUint(10)), @@ -1109,7 +1108,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(secretLockTransaction.toJSON()) as SecretLockTransaction; @@ -1127,7 +1126,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => sha3_256.create().update(Convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(secretProofTransaction.toJSON()) as SecretProofTransaction; @@ -1148,7 +1147,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(secretProofTransaction.toJSON()) as SecretProofTransaction; @@ -1165,9 +1164,9 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), 2, 1, - [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST)], + [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST)], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO( @@ -1182,16 +1181,16 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create AggregatedTransaction - Complete', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -1204,16 +1203,16 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create AggregatedTransaction - Bonded', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -1224,14 +1223,14 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => }); it('should create LockFundTransaction', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(lockTransaction.toJSON()) as LockFundsTransaction; @@ -1245,7 +1244,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as NamespaceRegistrationTransaction; @@ -1258,7 +1257,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => Deadline.create(epochAdjustment), 'root-test-namespace', 'parent-test-namespace', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as NamespaceRegistrationTransaction; @@ -1274,7 +1273,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => MosaicRestrictionType.NONE, UInt64.fromUint(0), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO( @@ -1298,7 +1297,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), ); @@ -1321,7 +1320,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => UInt64.fromUint(1000), 1, 'Test Value', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(accountMetadataTransaction.toJSON()) as AccountMetadataTransaction; @@ -1341,7 +1340,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => new MosaicId([2262289484, 3405110546]), 1, 'Test Value', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(mosaicMetadataTransaction.toJSON()) as MosaicMetadataTransaction; @@ -1362,7 +1361,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => new NamespaceId([2262289484, 3405110546]), 1, 'Test Value', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transaction = TransactionMapping.createFromDTO(namespaceMetadataTransaction.toJSON()) as NamespaceMetadataTransaction; diff --git a/test/core/utils/TransactionMappingWithSignatures.spec.ts b/test/core/utils/TransactionMappingWithSignatures.spec.ts index 1bd8cd4ee7..0d09b01008 100644 --- a/test/core/utils/TransactionMappingWithSignatures.spec.ts +++ b/test/core/utils/TransactionMappingWithSignatures.spec.ts @@ -66,7 +66,6 @@ import { NodeKeyLinkTransaction } from '../../../src/model/transaction/NodeKeyLi import { AddressRestrictionFlag } from '../../../src/model/restriction/AddressRestrictionFlag'; import { MosaicRestrictionFlag } from '../../../src/model/restriction/MosaicRestrictionFlag'; import { OperationRestrictionFlag } from '../../../src/model/restriction/OperationRestrictionFlag'; -import { Duration } from 'js-joda'; describe('TransactionMapping - createFromPayload with optional sigature and signer', () => { let account: Account; @@ -74,19 +73,19 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign const testSignature = '4CBA582B4C898FD6D218499251FE8EE1214D3715545023123F70D25389D577A96E74C1FCD07FF8F0D678A4DA5CAD8CCB173DDD9F7975A6985ADCD7AD625B170F'; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); it('should create AccountRestrictionAddressTransaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -96,7 +95,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign let transaction = TransactionMapping.createFromPayload(signedTransaction) as AccountAddressRestrictionTransaction; expect(transaction.restrictionFlags).to.be.equal(AddressRestrictionFlag.AllowIncomingAddress); - expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transaction.restrictionAdditions[0] as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.restrictionDeletions.length).to.be.equal(0); expect(transaction.signature).to.be.equal(testSignature); expect(transaction.signer?.publicKey).to.be.equal(account.publicKey); @@ -116,7 +115,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -146,7 +145,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -172,13 +171,13 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should create AddressAliasTransaction', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -191,7 +190,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign expect(transaction.aliasAction).to.be.equal(AliasAction.Link); expect(transaction.namespaceId.id.lower).to.be.equal(33347626); expect(transaction.namespaceId.id.higher).to.be.equal(3779697293); - expect(transaction.address.plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(transaction.address.plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.signature).to.be.equal(testSignature); expect(transaction.signer?.publicKey).to.be.equal(account.publicKey); @@ -211,7 +210,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -244,7 +243,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign MosaicFlags.create(false, false, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -279,7 +278,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -311,7 +310,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -340,10 +339,10 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should create TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -355,7 +354,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign expect(transaction.message.payload).to.be.equal('test-message'); expect(transaction.mosaics.length).to.be.equal(1); - expect(transaction.recipientToString()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(transaction.recipientToString()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); expect(transaction.signature).to.be.equal(testSignature); expect(transaction.signer?.publicKey).to.be.equal(account.publicKey); @@ -369,7 +368,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -377,7 +376,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(Convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -411,7 +410,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign sha3_256.create().update(Convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -440,9 +439,9 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), 2, 1, - [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST)], + [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST)], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -456,7 +455,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign expect(transaction.minRemovalDelta).to.be.equal(1); expect( transaction.addressAdditions[0].equals( - Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST), ), ).to.be.true; expect(transaction.addressDeletions.length).to.be.equal(0); @@ -474,29 +473,29 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should create AggregatedTransaction - Complete', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const accountLinkTransaction = AccountKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const vrfKeyLinkTransaction = VrfKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const nodeKeyLinkTransaction = NodeKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const votingKeyLinkTransaction = VotingKeyLinkTransaction.create( Deadline.create(epochAdjustment), @@ -504,13 +503,13 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicGlobalRestrictionTransaction = MosaicGlobalRestrictionTransaction.create( Deadline.create(epochAdjustment), @@ -520,7 +519,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign MosaicRestrictionType.NONE, UInt64.fromUint(0), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicAddressRestrictionTransaction = MosaicAddressRestrictionTransaction.create( Deadline.create(epochAdjustment), @@ -528,7 +527,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), ); const accountMetadataTransaction = AccountMetadataTransaction.create( @@ -537,7 +536,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicMetadataTransaction = MosaicMetadataTransaction.create( Deadline.create(epochAdjustment), @@ -546,7 +545,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( Deadline.create(epochAdjustment), @@ -555,7 +554,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const mosaicAliasTransaction = MosaicAliasTransaction.create( @@ -563,7 +562,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign AliasAction.Link, new NamespaceId([2262289484, 3405110546]), new MosaicId([2262289484, 3405110546]), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const secretProofTransaction = SecretProofTransaction.create( @@ -572,7 +571,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign sha3_256.create().update(Convert.hexToUint8('B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7')).hex(), account.address, 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( @@ -592,7 +591,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign mosaicAliasTransaction.toAggregate(account.publicAccount), secretProofTransaction.toAggregate(account.publicAccount), ], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], undefined, testSignature, @@ -620,16 +619,16 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should create AggregatedTransaction - Bonded', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], undefined, testSignature, @@ -654,14 +653,14 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign }); it('should create LockFundTransaction', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -690,7 +689,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -717,7 +716,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -744,7 +743,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -774,7 +773,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -803,7 +802,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -831,7 +830,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign Deadline.create(epochAdjustment), 'root-test-namespace', 'parent-test-namespace', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -863,7 +862,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign MosaicRestrictionType.NONE, UInt64.fromUint(0), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, undefined, testSignature, @@ -900,7 +899,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), undefined, testSignature, @@ -935,7 +934,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(4444), account.address, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(0), undefined, testSignature, @@ -971,7 +970,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -1004,7 +1003,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -1039,7 +1038,7 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, @@ -1069,10 +1068,10 @@ describe('TransactionMapping - createFromPayload with optional sigature and sign it('should throw error with invalid type', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, testSignature, account.publicAccount, diff --git a/test/core/utils/UnresolvedMapping.spec.ts b/test/core/utils/UnresolvedMapping.spec.ts index dcbf7daea5..7c619873be 100644 --- a/test/core/utils/UnresolvedMapping.spec.ts +++ b/test/core/utils/UnresolvedMapping.spec.ts @@ -29,7 +29,7 @@ describe('UnresolvedMapping', () => { before(() => { mosaicId = new MosaicId('11F4B1B3AC033DB5'); namespacId = NamespaceId.createFromEncoded('9550CA3FC9B41FC5'); - address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); }); describe('toUnresolvedMosaic', () => { @@ -74,16 +74,16 @@ describe('UnresolvedMapping', () => { describe('toUnresolvedAddressBytes', () => { it('can map Address to buffer', () => { - const buffer = UnresolvedMapping.toUnresolvedAddressBytes(address, NetworkType.MIJIN_TEST); + const buffer = UnresolvedMapping.toUnresolvedAddressBytes(address, NetworkType.PRIVATE_TEST); expect(buffer instanceof Uint8Array).to.be.true; expect(Convert.uint8ToHex(buffer)).to.be.equal(Convert.uint8ToHex(RawAddress.stringToAddress(address.plain()))); }); - it('can map hex string to NamespaceId using MIJIN_TEST', () => { - const buffer = UnresolvedMapping.toUnresolvedAddressBytes(namespacId, NetworkType.MIJIN_TEST); + it('can map hex string to NamespaceId using PRIVATE_TEST', () => { + const buffer = UnresolvedMapping.toUnresolvedAddressBytes(namespacId, NetworkType.PRIVATE_TEST); expect(buffer instanceof Uint8Array).to.be.true; - expect(buffer[0]).to.be.equal(NetworkType.MIJIN_TEST | 1); - expect(Convert.uint8ToHex(buffer)).to.be.equal('91C51FB4C93FCA5095000000000000000000000000000000'); + expect(buffer[0]).to.be.equal(NetworkType.PRIVATE_TEST | 1); + expect(Convert.uint8ToHex(buffer)).to.be.equal('81C51FB4C93FCA5095000000000000000000000000000000'); }); it('can map hex string to NamespaceId using MAIN_NET', () => { diff --git a/test/infrastructure/AccountHttp.spec.ts b/test/infrastructure/AccountHttp.spec.ts index 8012d56884..efea6107d2 100644 --- a/test/infrastructure/AccountHttp.spec.ts +++ b/test/infrastructure/AccountHttp.spec.ts @@ -38,7 +38,7 @@ import { Address } from '../../src/model/account/Address'; import { MosaicId } from '../../src/model/mosaic/MosaicId'; describe('AccountHttp', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const mosaic = {} as Mosaic; mosaic.amount = '777'; diff --git a/test/infrastructure/BlockHttp.spec.ts b/test/infrastructure/BlockHttp.spec.ts index db832f1ca0..5284c5d159 100644 --- a/test/infrastructure/BlockHttp.spec.ts +++ b/test/infrastructure/BlockHttp.spec.ts @@ -51,7 +51,7 @@ describe('BlockHttp', () => { blockDTO.timestamp = '7'; blockDTO.beneficiaryAddress = Address.createFromPublicKey( '81E5E7AE49998802DABC816EC10158D3A7879702FF29084C2C992CD1289877A8', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).encoded(); const blockMetaDTO = {} as BlockMetaDTO; diff --git a/test/infrastructure/HashLockHttp.spec.ts b/test/infrastructure/HashLockHttp.spec.ts index 1f2e23ba2b..08a6138453 100644 --- a/test/infrastructure/HashLockHttp.spec.ts +++ b/test/infrastructure/HashLockHttp.spec.ts @@ -24,7 +24,7 @@ import { Address } from '../../src/model/account/Address'; import { HashLockInfo } from '../../src/model/lock/HashLockInfo'; describe('HashLockHttp', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const dto = {} as HashLockInfoDTO; dto.id = '1'; diff --git a/test/infrastructure/Listener.spec.ts b/test/infrastructure/Listener.spec.ts index 2a6e78c47d..80a15d89c4 100644 --- a/test/infrastructure/Listener.spec.ts +++ b/test/infrastructure/Listener.spec.ts @@ -34,17 +34,16 @@ import { TransactionStatusError } from '../../src/model/transaction/TransactionS import { TransferTransaction } from '../../src/model/transaction/TransferTransaction'; import { UInt64 } from '../../src/model/UInt64'; import { FinalizedBlock } from '../../src/model/blockchain/FinalizedBlock'; -import { Duration } from 'js-joda'; describe('Listener', () => { const account = Account.createFromPrivateKey( '26b64cb10f005e5988a36744ca19e20d835ccc7c105aaa5f3b212da593180930', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let namespaceRepoMock: NamespaceRepository; let namespaceRepo: NamespaceRepository; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; beforeEach(() => { namespaceRepoMock = mock(); namespaceRepo = instance(namespaceRepoMock); @@ -66,7 +65,7 @@ describe('Listener', () => { describe('Invalid Channel', () => { it('should throw error if channel is not supported', () => { - const errorEncodedAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const errorEncodedAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const errorAddress = Address.createFromEncoded(errorEncodedAddress); @@ -105,7 +104,7 @@ describe('Listener', () => { describe('onStatusWhenAddressIsTheSame', () => { it('Should forward status', () => { - const errorEncodedAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const errorEncodedAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const errorAddress = Address.createFromEncoded(errorEncodedAddress); @@ -149,7 +148,7 @@ describe('Listener', () => { describe('onConfirmed', () => { it('Should forward status', () => { - const errorEncodedAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + const errorEncodedAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; const errorAddress = Address.createFromEncoded(errorEncodedAddress); @@ -241,7 +240,7 @@ describe('Listener', () => { alias, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransactionDTO = transferTransaction.toJSON(); const hash = 'abc'; @@ -285,7 +284,7 @@ describe('Listener', () => { alias, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransactionDTO = transferTransaction.toJSON(); const hash = 'abc'; @@ -330,7 +329,7 @@ describe('Listener', () => { alias, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransactionDTO = transferTransaction.toJSON(); const hash = 'abc'; @@ -374,7 +373,7 @@ describe('Listener', () => { alias2, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransactionDTO = transferTransaction.toJSON(); const hash = 'abc'; @@ -420,7 +419,7 @@ describe('Listener', () => { alias2, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, undefined, undefined, account.publicAccount, @@ -570,7 +569,7 @@ describe('Listener', () => { '37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868' + 'E932E1A9BEF8A27D48E1FFEE401E933EB801824373E7537E51733E0F', signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - beneficiaryAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + beneficiaryAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', timestamp: '0', type: 32768, version: 1, diff --git a/test/infrastructure/MetadataHttp.spec.ts b/test/infrastructure/MetadataHttp.spec.ts index 1443a795d5..57705695b9 100644 --- a/test/infrastructure/MetadataHttp.spec.ts +++ b/test/infrastructure/MetadataHttp.spec.ts @@ -14,7 +14,6 @@ * limitations under the License. */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { MetadataEntryDTO, MetadataRoutesApi, @@ -43,8 +42,8 @@ import { UInt64 } from '../../src/model/UInt64'; import { MetadataTransactionService } from '../../src/service/MetadataTransactionService'; describe('MetadataHttp', () => { - const epochAdjustment = Duration.ofSeconds(1573430400); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const epochAdjustment = 1573430400; + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const mosaicId = new MosaicId('941299B2B7E1291C'); const namespaceId = new NamespaceId('some.address'); @@ -364,7 +363,7 @@ describe('MetadataHttp', () => { metadataTransactionService .createAccountMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, UInt64.fromHex('85BBEA6CC462B244'), 'test', @@ -397,7 +396,7 @@ describe('MetadataHttp', () => { metadataTransactionService .createMosaicMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, mosaicId, UInt64.fromHex('85BBEA6CC462B244'), @@ -431,7 +430,7 @@ describe('MetadataHttp', () => { metadataTransactionService .createNamespaceMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, namespaceId, UInt64.fromHex('85BBEA6CC462B244'), @@ -464,7 +463,7 @@ describe('MetadataHttp', () => { await metadataTransactionService .createAccountMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, UInt64.fromHex('85BBEA6CC462B244'), 'test', @@ -493,7 +492,7 @@ describe('MetadataHttp', () => { await metadataTransactionService .createMosaicMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, mosaicId, UInt64.fromHex('85BBEA6CC462B244'), @@ -523,7 +522,7 @@ describe('MetadataHttp', () => { await metadataTransactionService .createNamespaceMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, address, namespaceId, UInt64.fromHex('85BBEA6CC462B244'), diff --git a/test/infrastructure/MosaicHttp.spec.ts b/test/infrastructure/MosaicHttp.spec.ts index 026db01607..9de7cde222 100644 --- a/test/infrastructure/MosaicHttp.spec.ts +++ b/test/infrastructure/MosaicHttp.spec.ts @@ -36,7 +36,7 @@ import { NetworkType } from '../../src/model/network/NetworkType'; describe('MosaicHttp', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const mosaicId = new MosaicId('941299B2B7E1291C'); @@ -60,7 +60,7 @@ describe('MosaicHttp', () => { const url = 'http://someHost'; const response: http.IncomingMessage = mock(); const mosaicRoutesApi: MosaicRoutesApi = mock(); - const mosaicRepository: MosaicRepository = DtoMapping.assign(new MosaicHttp(url, NetworkType.MIJIN_TEST), { + const mosaicRepository: MosaicRepository = DtoMapping.assign(new MosaicHttp(url, NetworkType.PRIVATE_TEST), { mosaicRoutesApi: instance(mosaicRoutesApi), }); diff --git a/test/infrastructure/MultisigHttp.spec.ts b/test/infrastructure/MultisigHttp.spec.ts index 9c63f1b170..08d7bf9025 100644 --- a/test/infrastructure/MultisigHttp.spec.ts +++ b/test/infrastructure/MultisigHttp.spec.ts @@ -31,7 +31,7 @@ import { MultisigAccountInfo } from '../../src/model/account/MultisigAccountInfo import { NetworkType } from '../../src/model/network/NetworkType'; describe('MultisigHttp', () => { - const networkType = NetworkType.MIJIN_TEST; + const networkType = NetworkType.PRIVATE_TEST; const account = Account.generateNewAccount(networkType); const address = account.address; const accountInfoDto = {} as MultisigAccountInfoDTO; diff --git a/test/infrastructure/NamespaceHttp.spec.ts b/test/infrastructure/NamespaceHttp.spec.ts index e7914bfca6..1ca3dc909c 100644 --- a/test/infrastructure/NamespaceHttp.spec.ts +++ b/test/infrastructure/NamespaceHttp.spec.ts @@ -43,7 +43,7 @@ import { NetworkType } from '../../src/model/network/NetworkType'; describe('NamespaceHttp', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const mosaicId = new MosaicId('941299B2B7E1291C'); @@ -91,7 +91,7 @@ describe('NamespaceHttp', () => { const url = 'http://someHost'; const response: http.IncomingMessage = mock(); const namespaceRoutesApi: NamespaceRoutesApi = mock(); - const namespaceRepository: NamespaceRepository = DtoMapping.assign(new NamespaceHttp(url, NetworkType.MIJIN_TEST), { + const namespaceRepository: NamespaceRepository = DtoMapping.assign(new NamespaceHttp(url, NetworkType.PRIVATE_TEST), { namespaceRoutesApi: instance(namespaceRoutesApi), }); diff --git a/test/infrastructure/NetworkHttp.spec.ts b/test/infrastructure/NetworkHttp.spec.ts index 5d653281a0..6c917ded76 100644 --- a/test/infrastructure/NetworkHttp.spec.ts +++ b/test/infrastructure/NetworkHttp.spec.ts @@ -87,7 +87,7 @@ describe('NetworkHttp', () => { it('getNetworkType', async () => { const body: NodeInfoDTO = { - networkIdentifier: NetworkType.MIJIN_TEST, + networkIdentifier: NetworkType.PRIVATE_TEST, friendlyName: '', host: '', networkGenerationHashSeed: '', @@ -100,7 +100,7 @@ describe('NetworkHttp', () => { when(nodeRoutesApi.getNodeInfo()).thenReturn(Promise.resolve(body)); const networkType = await networkRepository.getNetworkType().toPromise(); - expect(networkType).to.be.equals(NetworkType.MIJIN_TEST); + expect(networkType).to.be.equals(NetworkType.PRIVATE_TEST); }); it('getNetworkName', async () => { diff --git a/test/infrastructure/Page.spec.ts b/test/infrastructure/Page.spec.ts index dc08df2b5c..6d75eed3bf 100644 --- a/test/infrastructure/Page.spec.ts +++ b/test/infrastructure/Page.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Page } from '../../src/infrastructure/infrastructure'; import { PlainMessage } from '../../src/model/message/PlainMessage'; import { NetworkType } from '../../src/model/network/NetworkType'; @@ -25,7 +24,7 @@ import { TransferTransaction } from '../../src/model/transaction/TransferTransac import { TestingAccount } from '../conf/conf.spec'; describe('Page', () => { - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; it('should create Page', () => { const account = TestingAccount; let page = new Page( diff --git a/test/infrastructure/ReceiptHttp.spec.ts b/test/infrastructure/ReceiptHttp.spec.ts index 51ea92fd87..255fe42c95 100644 --- a/test/infrastructure/ReceiptHttp.spec.ts +++ b/test/infrastructure/ReceiptHttp.spec.ts @@ -42,13 +42,13 @@ import { BalanceChangeReceipt } from '../../src/model/receipt/BalanceChangeRecei describe('ReceiptHttp', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const url = 'http://someHost'; const response: http.IncomingMessage = mock(); const receiptRoutesApi: ReceiptRoutesApi = mock(); - const receiptRepository = DtoMapping.assign(new ReceiptHttp(url, NetworkType.MIJIN_TEST), { + const receiptRepository = DtoMapping.assign(new ReceiptHttp(url, NetworkType.PRIVATE_TEST), { receiptRoutesApi: instance(receiptRoutesApi), }); @@ -100,7 +100,7 @@ describe('ReceiptHttp', () => { const resolutionStatementDto = {} as ResolutionStatementDTO; resolutionStatementDto.height = '1'; resolutionStatementDto.unresolved = Convert.uint8ToHex( - RawAddress.aliasToRecipient(Convert.hexToUint8(new NamespaceId('test').toHex()), NetworkType.MIJIN_TEST), + RawAddress.aliasToRecipient(Convert.hexToUint8(new NamespaceId('test').toHex()), NetworkType.PRIVATE_TEST), ); const resolutionEntry = {} as ResolutionEntryDTO; resolutionEntry.resolved = address.encoded(); diff --git a/test/infrastructure/RepositoryFactory.spec.ts b/test/infrastructure/RepositoryFactory.spec.ts index 65e1274e77..6d08e4eb5f 100644 --- a/test/infrastructure/RepositoryFactory.spec.ts +++ b/test/infrastructure/RepositoryFactory.spec.ts @@ -46,7 +46,7 @@ import { NetworkConfigurationDTO } from 'symbol-openapi-typescript-fetch-client' describe('RepositoryFactory', () => { it('Should create repositories', () => { const repositoryFactory = new RepositoryFactoryHttp('http://localhost:3000', { - networkType: NetworkType.MIJIN_TEST, + networkType: NetworkType.PRIVATE_TEST, generationHash: 'testHash', }); @@ -83,7 +83,7 @@ describe('RepositoryFactory', () => { return instance(repositoryMock); } })('http://localhost:3000', { - networkType: NetworkType.MIJIN_TEST, + networkType: NetworkType.PRIVATE_TEST, }); expect(counter).to.be.equals(0); @@ -105,7 +105,7 @@ describe('RepositoryFactory', () => { it('Should get NetworkType from cache', (done) => { let counter = 0; const repositoryMock: NetworkRepository = mock(); - const expectedNetworkType = NetworkType.MIJIN_TEST; + const expectedNetworkType = NetworkType.PRIVATE_TEST; const observableOfBlockInfo = observableOf(expectedNetworkType).pipe( map((v) => { counter++; @@ -173,10 +173,10 @@ describe('RepositoryFactory', () => { expect(counter).to.be.equals(0); repositoryFactory.getEpochAdjustment().subscribe((epoch) => { expect(counter).to.be.equals(1); - expect(epoch.seconds()).to.be.equals(expectedepochAdjustment); + expect(epoch).to.be.equals(expectedepochAdjustment); repositoryFactory.getEpochAdjustment().subscribe((network) => { expect(counter).to.be.equals(1); - expect(network.seconds()).to.be.equals(expectedepochAdjustment); + expect(network).to.be.equals(expectedepochAdjustment); done(); }); }); @@ -187,7 +187,7 @@ describe('RepositoryFactory', () => { const repositoryMock: NetworkRepository = mock(); - const expectedNetworkType = NetworkType.MIJIN_TEST; + const expectedNetworkType = NetworkType.PRIVATE_TEST; const observableOfBlockInfo = observableOf(expectedNetworkType).pipe( map((v) => { counter++; @@ -258,10 +258,10 @@ describe('RepositoryFactory', () => { expect(counter).to.be.equals(0); repositoryFactory.getEpochAdjustment().subscribe((networkType) => { expect(counter).to.be.equals(0); - expect(networkType.seconds()).to.be.equals(expectedepochAdjustment); + expect(networkType).to.be.equals(expectedepochAdjustment); repositoryFactory.getEpochAdjustment().subscribe((network) => { expect(counter).to.be.equals(0); - expect(network.seconds()).to.be.equals(expectedepochAdjustment); + expect(network).to.be.equals(expectedepochAdjustment); done(); }); }); @@ -282,7 +282,7 @@ describe('RepositoryFactory', () => { return instance(namespaceRepository); } })('http://localhost:3000', { - networkType: NetworkType.MIJIN_TEST, + networkType: NetworkType.PRIVATE_TEST, generationHash: 'testHash', websocketInjected: WebSocketMock, }); @@ -295,7 +295,7 @@ describe('RepositoryFactory', () => { return instance(namespaceRepository); } })('http://localhost:3000', { - networkType: NetworkType.MIJIN_TEST, + networkType: NetworkType.PRIVATE_TEST, generationHash: 'testHash', websocketUrl: 'ws://localhost:3000/ws', websocketInjected: WebSocketMock, @@ -307,7 +307,7 @@ describe('RepositoryFactory', () => { it('Should create listener object using injected ws', () => { const factory = new RepositoryFactoryHttp('url', { - networkType: NetworkType.MIJIN_TEST, + networkType: NetworkType.PRIVATE_TEST, generationHash: 'testHash', }); diff --git a/test/infrastructure/RestrictionAccountHttp.spec.ts b/test/infrastructure/RestrictionAccountHttp.spec.ts index df64a3d217..a460b46009 100644 --- a/test/infrastructure/RestrictionAccountHttp.spec.ts +++ b/test/infrastructure/RestrictionAccountHttp.spec.ts @@ -33,7 +33,7 @@ import { AddressRestrictionFlag } from '../../src/model/restriction/AddressRestr describe('RestrictionAccountHttp', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const url = 'http://someHost'; diff --git a/test/infrastructure/RestrictionMosaicHttp.spec.ts b/test/infrastructure/RestrictionMosaicHttp.spec.ts index 96fef83df1..b06ee578c6 100644 --- a/test/infrastructure/RestrictionMosaicHttp.spec.ts +++ b/test/infrastructure/RestrictionMosaicHttp.spec.ts @@ -40,7 +40,7 @@ import { MosaicAddressRestriction } from '../../src/model/restriction/MosaicAddr describe('RestrictionMosaicHttp', () => { const publicAccount = PublicAccount.createFromPublicKey( '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address = publicAccount.address; const mosaicId = new MosaicId('941299B2B7E1291C'); diff --git a/test/infrastructure/SecretLockHttp.spec.ts b/test/infrastructure/SecretLockHttp.spec.ts index 2e0b1d1a27..cf652decd2 100644 --- a/test/infrastructure/SecretLockHttp.spec.ts +++ b/test/infrastructure/SecretLockHttp.spec.ts @@ -31,7 +31,7 @@ import { Address } from '../../src/model/account/Address'; import { SecretLockInfo } from '../../src/model/lock/SecretLockInfo'; describe('SecretLockHttp', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const dto = {} as SecretLockInfoDTO; dto.id = '1'; diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index a4fa7413b0..efbac2473b 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -54,11 +54,10 @@ import { VotingKeyLinkTransaction } from '../../src/model/transaction/VotingKeyL import { VrfKeyLinkTransaction } from '../../src/model/transaction/VrfKeyLinkTransaction'; import { UInt64 } from '../../src/model/UInt64'; import { TestingAccount } from '../conf/conf.spec'; -import { Duration } from 'js-joda'; describe('SerializeTransactionToJSON', () => { let account: Account; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -68,7 +67,7 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = accountLinkTransaction.toJSON(); @@ -78,13 +77,13 @@ describe('SerializeTransactionToJSON', () => { }); it('should create AccountRestrictionAddressTransaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = addressRestrictionTransaction.toJSON(); @@ -101,7 +100,7 @@ describe('SerializeTransactionToJSON', () => { MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = mosaicRestrictionTransaction.toJSON(); @@ -118,7 +117,7 @@ describe('SerializeTransactionToJSON', () => { OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = operationRestrictionTransaction.toJSON(); @@ -130,13 +129,13 @@ describe('SerializeTransactionToJSON', () => { it('should create AddressAliasTransaction', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = addressAliasTransaction.toJSON(); @@ -153,7 +152,7 @@ describe('SerializeTransactionToJSON', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = mosaicAliasTransaction.toJSON(); @@ -169,7 +168,7 @@ describe('SerializeTransactionToJSON', () => { MosaicFlags.create(true, true, true), 5, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = mosaicDefinitionTransaction.toJSON(); @@ -188,7 +187,7 @@ describe('SerializeTransactionToJSON', () => { MosaicFlags.create(true, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = mosaicDefinitionTransaction.toJSON(); @@ -205,7 +204,7 @@ describe('SerializeTransactionToJSON', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = mosaicSupplyChangeTransaction.toJSON(); @@ -217,10 +216,10 @@ describe('SerializeTransactionToJSON', () => { it('should create TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = transferTransaction.toJSON(); @@ -231,7 +230,7 @@ describe('SerializeTransactionToJSON', () => { it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -239,7 +238,7 @@ describe('SerializeTransactionToJSON', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = secretLockTransaction.toJSON(); @@ -256,7 +255,7 @@ describe('SerializeTransactionToJSON', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = secretProofTransaction.toJSON(); @@ -272,9 +271,9 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), 2, 1, - [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST)], + [Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST)], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = modifyMultisigAccountTransaction.toJSON(); @@ -287,16 +286,16 @@ describe('SerializeTransactionToJSON', () => { it('should create AggregatedTransaction - Complete', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -309,16 +308,16 @@ describe('SerializeTransactionToJSON', () => { it('should create AggregatedTransaction - Bonded', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -330,14 +329,14 @@ describe('SerializeTransactionToJSON', () => { it('should create LockFundTransaction', () => { const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = lockTransaction.toJSON(); @@ -351,7 +350,7 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = registerNamespaceTransaction.toJSON(); @@ -364,7 +363,7 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), 'root-test-namespace', 'parent-test-namespace', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = registerNamespaceTransaction.toJSON(); @@ -377,7 +376,7 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = vrfKeyLinkTransaction.toJSON(); @@ -390,7 +389,7 @@ describe('SerializeTransactionToJSON', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = nodeKeyLinkTransaction.toJSON(); @@ -406,7 +405,7 @@ describe('SerializeTransactionToJSON', () => { 1, 3, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const json = votingKeyLinkTransaction.toJSON(); diff --git a/test/infrastructure/TransactionHttp.spec.ts b/test/infrastructure/TransactionHttp.spec.ts index 309c85e715..e62ecb68c4 100644 --- a/test/infrastructure/TransactionHttp.spec.ts +++ b/test/infrastructure/TransactionHttp.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { BlockDTO, BlockInfoDTO, @@ -59,7 +58,7 @@ describe('TransactionHttp', () => { cosignature.signerPublicKey = 'signerPubKey'; cosignature.signature = 'signature'; cosignature.version = '0'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { transactionRoutesApi = mock(); @@ -72,15 +71,15 @@ describe('TransactionHttp', () => { it('should return an error when a non aggregate transaction bonded is announced via announceAggregateBonded method', () => { const tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('Hi'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggTx = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [tx.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -109,7 +108,7 @@ describe('TransactionHttp', () => { transactionDto.maxFee = '1'; transactionDto.mosaics = []; transactionDto.network = NetworkTypeEnum.NUMBER_104; - transactionDto.recipientAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + transactionDto.recipientAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; transactionDto.type = TransactionType.TRANSFER.valueOf(); transactionDto.version = 1; @@ -176,7 +175,7 @@ describe('TransactionHttp', () => { expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactions.data[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactions.data[0].transactionInfo?.id).to.be.equal('id'); expect(transactions.data[0].transactionInfo?.hash).to.be.equal('hash'); @@ -189,7 +188,7 @@ describe('TransactionHttp', () => { expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactions.data[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactions.data[0].transactionInfo?.id).to.be.equal('id'); expect(transactions.data[0].transactionInfo?.hash).to.be.equal('hash'); @@ -202,7 +201,7 @@ describe('TransactionHttp', () => { expect(transactions.data.length).to.be.equal(1); expect(transactions.data[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactions.data[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactions.data[0].transactionInfo?.id).to.be.equal('id'); expect(transactions.data[0].transactionInfo?.hash).to.be.equal('hash'); @@ -224,7 +223,7 @@ describe('TransactionHttp', () => { transactionDto.maxFee = '1'; transactionDto.mosaics = []; transactionDto.network = NetworkTypeEnum.NUMBER_104; - transactionDto.recipientAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + transactionDto.recipientAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; transactionDto.type = TransactionType.TRANSFER.valueOf(); transactionDto.version = 1; @@ -241,7 +240,7 @@ describe('TransactionHttp', () => { expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transaction.transactionInfo?.id).to.be.equal('id'); expect(transaction.transactionInfo?.hash).to.be.equal('hash'); @@ -250,7 +249,7 @@ describe('TransactionHttp', () => { expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transaction.transactionInfo?.id).to.be.equal('id'); expect(transaction.transactionInfo?.hash).to.be.equal('hash'); @@ -259,7 +258,7 @@ describe('TransactionHttp', () => { expect(transaction.type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transaction as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transaction.transactionInfo?.id).to.be.equal('id'); expect(transaction.transactionInfo?.hash).to.be.equal('hash'); @@ -278,7 +277,7 @@ describe('TransactionHttp', () => { transactionDto.maxFee = '1'; transactionDto.mosaics = []; transactionDto.network = NetworkTypeEnum.NUMBER_104; - transactionDto.recipientAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + transactionDto.recipientAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; transactionDto.type = TransactionType.TRANSFER.valueOf(); transactionDto.version = 1; @@ -309,7 +308,7 @@ describe('TransactionHttp', () => { expect(transactionConfirmed.length).to.be.equal(1); expect(transactionConfirmed[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactionConfirmed[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactionConfirmed[0].transactionInfo?.id).to.be.equal('id'); expect(transactionConfirmed[0].transactionInfo?.hash).to.be.equal('hash'); @@ -317,7 +316,7 @@ describe('TransactionHttp', () => { expect(transactionUnconfirmed.length).to.be.equal(1); expect(transactionUnconfirmed[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactionUnconfirmed[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactionUnconfirmed[0].transactionInfo?.id).to.be.equal('id'); expect(transactionUnconfirmed[0].transactionInfo?.hash).to.be.equal('hash'); @@ -325,7 +324,7 @@ describe('TransactionHttp', () => { expect(transactionPartial.length).to.be.equal(1); expect(transactionPartial[0].type.valueOf()).to.be.equal(TransactionType.TRANSFER.valueOf()); expect(((transactionPartial[0] as TransferTransaction).recipientAddress as Address).plain()).to.be.equal( - Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144').plain(), + Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5').plain(), ); expect(transactionPartial[0].transactionInfo?.id).to.be.equal('id'); expect(transactionPartial[0].transactionInfo?.hash).to.be.equal('hash'); @@ -344,7 +343,7 @@ describe('TransactionHttp', () => { transactionDto.maxFee = '1'; transactionDto.mosaics = []; transactionDto.network = NetworkTypeEnum.NUMBER_104; - transactionDto.recipientAddress = '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'; + transactionDto.recipientAddress = '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'; transactionDto.type = TransactionType.TRANSFER.valueOf(); transactionDto.version = 1; @@ -364,7 +363,7 @@ describe('TransactionHttp', () => { blockDTO.timestamp = '7'; blockDTO.beneficiaryAddress = Address.createFromPublicKey( '81E5E7AE49998802DABC816EC10158D3A7879702FF29084C2C992CD1289877A8', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).encoded(); const blockMetaDTO = {} as BlockMetaDTO; @@ -391,10 +390,10 @@ describe('TransactionHttp', () => { const response = { message: 'done' }; const tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('Hi'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = account.sign(tx, generationHash); @@ -410,16 +409,16 @@ describe('TransactionHttp', () => { const tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('Hi'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggTx = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [tx.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -498,10 +497,10 @@ describe('TransactionHttp', () => { it('announce - Error', async () => { const tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('Hi'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = account.sign(tx, generationHash); @@ -518,16 +517,16 @@ describe('TransactionHttp', () => { const tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('Hi'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggTx = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [tx.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTx = account.sign(aggTx, generationHash); diff --git a/test/infrastructure/TransactionSearchCriteria.spec.ts b/test/infrastructure/TransactionSearchCriteria.spec.ts index 8ccc185ccb..1c6e7015a6 100644 --- a/test/infrastructure/TransactionSearchCriteria.spec.ts +++ b/test/infrastructure/TransactionSearchCriteria.spec.ts @@ -58,7 +58,7 @@ describe('TransactionSearchCriteria', () => { expect(criteria.signerPublicKey).to.be.equal(account.publicKey); deepEqual(criteria.type, [TransactionType.ACCOUNT_ADDRESS_RESTRICTION]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); criteria = { order: Order.Desc, pageNumber: 2, diff --git a/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts b/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts index f0476bbb82..18b0328b00 100644 --- a/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts +++ b/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts @@ -36,7 +36,10 @@ describe('Receipt - CreateStatementFromDTO', () => { let statementDto; before(() => { - account = Account.createFromPrivateKey('D242FB34C2C4DD36E995B9C865F93940065E326661BA5A4A247331D211FE3A3D', NetworkType.MIJIN_TEST); + account = Account.createFromPrivateKey( + 'D242FB34C2C4DD36E995B9C865F93940065E326661BA5A4A247331D211FE3A3D', + NetworkType.PRIVATE_TEST, + ); statementDto = { transactionStatements: [ { diff --git a/test/infrastructure/streamer/HashLockPaginationStreamer.spec.ts b/test/infrastructure/streamer/HashLockPaginationStreamer.spec.ts index 141e85d29f..bb2e339b4c 100644 --- a/test/infrastructure/streamer/HashLockPaginationStreamer.spec.ts +++ b/test/infrastructure/streamer/HashLockPaginationStreamer.spec.ts @@ -21,7 +21,7 @@ import { HashLockRepository } from '../../../src/infrastructure/HashLockReposito import { Address } from '../../../src/model/account/Address'; describe('HashLockPaginationStreamer', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); it('basicMultiPageTest', () => { const hashLockRepositoryMock: HashLockRepository = mock(); diff --git a/test/infrastructure/streamer/SecretLockPaginationStreamer.spec.ts b/test/infrastructure/streamer/SecretLockPaginationStreamer.spec.ts index d5fb806316..81009ce835 100644 --- a/test/infrastructure/streamer/SecretLockPaginationStreamer.spec.ts +++ b/test/infrastructure/streamer/SecretLockPaginationStreamer.spec.ts @@ -21,7 +21,7 @@ import { SecretLockRepository } from '../../../src/infrastructure/SecretLockRepo import { Address } from '../../../src/model/account/Address'; describe('SecretLockPaginationStreamer', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); it('basicMultiPageTest', () => { const SecretLockRepositoryMock: SecretLockRepository = mock(); diff --git a/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts b/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts index 4e775c4f3a..e0673046c7 100644 --- a/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts +++ b/test/infrastructure/transaction/CreateTransactionFromDTO.spec.ts @@ -19,7 +19,7 @@ import { CreateTransactionFromDTO } from '../../../src/infrastructure/transactio import { Address } from '../../../src/model/account/Address'; import { TransferTransaction } from '../../../src/model/transaction/TransferTransaction'; import ValidateTransaction from './ValidateTransaction'; -import { LocalDateTime } from 'js-joda'; +import { LocalDateTime } from '@js-joda/core'; describe('CreateTransactionFromDTO', () => { describe('TransferTransaction', () => { @@ -42,7 +42,7 @@ describe('CreateTransactionFromDTO', () => { type: 16724, maxFee: '0', deadline: '1000', - recipientAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + recipientAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', message: { payload: '746573742D6D657373616765', type: 0, @@ -81,7 +81,7 @@ describe('CreateTransactionFromDTO', () => { type: 16724, maxFee: '0', deadline: '1000', - recipientAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + recipientAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', mosaics: [ { id: '85BBEA6CC462B244', @@ -143,7 +143,7 @@ describe('CreateTransactionFromDTO', () => { id: '85BBEA6CC462B244', }, ], - recipientAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + recipientAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16724, version: 1, @@ -178,7 +178,7 @@ describe('CreateTransactionFromDTO', () => { version: 1, network: 144, type: 16724, - recipientAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + recipientAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', message: { payload: '746573742D6D657373616765', type: 0, @@ -593,7 +593,7 @@ describe('CreateTransactionFromDTO', () => { maxFee: '0', minApprovalDelta: 1, minRemovalDelta: 1, - addressAdditions: ['6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'], + addressAdditions: ['7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'], addressDeletions: [], signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E0' + @@ -648,7 +648,7 @@ describe('CreateTransactionFromDTO', () => { transaction: { minApprovalDelta: 1, minRemovalDelta: 1, - addressAdditions: ['6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'], + addressAdditions: ['7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'], addressDeletions: [], signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16725, diff --git a/test/model/account/Account.spec.ts b/test/model/account/Account.spec.ts index b893c3d8a4..97a127d41d 100644 --- a/test/model/account/Account.spec.ts +++ b/test/model/account/Account.spec.ts @@ -25,18 +25,17 @@ import { AggregateTransaction } from '../../../src/model/transaction/AggregateTr import { CosignatureTransaction } from '../../../src/model/transaction/CosignatureTransaction'; import { CosignatureSignedTransaction } from '../../../src/model/transaction/CosignatureSignedTransaction'; import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; -import { Duration } from 'js-joda'; describe('Account', () => { const accountInformation = { - address: 'SDLGYM2CBZKBDGK3VT6KFMUM6HE7LXL2WEQE5JA', + address: 'QDLGYM2CBZKBDGK3VT6KFMUM6HE7LXL2WGU4AXA', privateKey: '26b64cb10f005e5988a36744ca19e20d835ccc7c105aaa5f3b212da593180930'.toUpperCase(), publicKey: '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6'.toUpperCase(), }; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; it('should be created via private key', () => { - const account = Account.createFromPrivateKey(accountInformation.privateKey, NetworkType.MIJIN_TEST); + const account = Account.createFromPrivateKey(accountInformation.privateKey, NetworkType.PRIVATE_TEST); expect(account.publicKey).to.be.equal(accountInformation.publicKey); expect(account.privateKey).to.be.equal(accountInformation.privateKey); expect(account.address.plain()).to.be.equal(accountInformation.address); @@ -44,12 +43,12 @@ describe('Account', () => { it('should throw exception when the private key is not valid', () => { expect(() => { - Account.createFromPrivateKey('', NetworkType.MIJIN_TEST); + Account.createFromPrivateKey('', NetworkType.PRIVATE_TEST); }).to.throw(); }); it('should generate a new account', () => { - const account = Account.generateNewAccount(NetworkType.MIJIN_TEST); + const account = Account.generateNewAccount(NetworkType.PRIVATE_TEST); expect(account.publicKey).to.not.be.equal(undefined); expect(account.privateKey).to.not.be.equal(undefined); expect(account.address).to.not.be.equal(undefined); @@ -117,7 +116,7 @@ describe('Account', () => { it('utf-8', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData('catapult rocks!'); @@ -127,7 +126,7 @@ describe('Account', () => { it('hexa', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData('0xAA'); @@ -157,7 +156,7 @@ describe('Account', () => { it('hexa without 0x previx', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData('66128B29E8197352A2FEB51B50CF5D02F1D05B20D44B3F7953B98ACD2BCA15D4'); @@ -167,7 +166,7 @@ describe('Account', () => { it('hexa without 0x previx should be the same as with 0x', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData('AA'); @@ -179,7 +178,7 @@ describe('Account', () => { it('hexa without 0x previx should be the same as with 0x', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData('ff60983e0c5d21d2fb83c67598d560f3cf0e28ae667b5616aaa58a059666cd8cf826b026243c92cf'); @@ -198,7 +197,7 @@ describe('Account', () => { it('sign empty', () => { const account = Account.createFromPrivateKey( 'AB860ED1FE7C91C02F79C02225DAC708D7BD13369877C1F59E678CC587658C47', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const publicAccount = account.publicAccount; const signed = account.signData(''); diff --git a/test/model/account/AccountInfo.spec.ts b/test/model/account/AccountInfo.spec.ts index 2a3ad7c101..8d0ad0a990 100644 --- a/test/model/account/AccountInfo.spec.ts +++ b/test/model/account/AccountInfo.spec.ts @@ -32,7 +32,7 @@ describe('AccountInfo', () => { it('should createComplete an AccountInfo object', () => { const accountInfoDTO = { account: { - address: Address.createFromEncoded('6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144'), + address: Address.createFromEncoded('7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5'), addressHeight: new UInt64([1, 0]), importance: new UInt64([405653170, 0]), importanceHeight: new UInt64([6462, 0]), @@ -111,6 +111,6 @@ describe('AccountInfo', () => { deepEqual(accountInfo.publicKeyHeight, accountInfoDTO.account.publicKeyHeight); deepEqual(accountInfo.importance, accountInfoDTO.account.importance); deepEqual(accountInfo.importanceHeight, accountInfoDTO.account.importanceHeight); - deepEqual(accountInfo.publicAccount, PublicAccount.createFromPublicKey(accountInfoDTO.account.publicKey, NetworkType.MIJIN)); + deepEqual(accountInfo.publicAccount, PublicAccount.createFromPublicKey(accountInfoDTO.account.publicKey, NetworkType.PRIVATE)); }); }); diff --git a/test/model/account/Address.spec.ts b/test/model/account/Address.spec.ts index 56f84fb4c1..1dddb99b8d 100644 --- a/test/model/account/Address.spec.ts +++ b/test/model/account/Address.spec.ts @@ -21,21 +21,21 @@ import { NetworkType } from '../../../src/model/network/NetworkType'; describe('Address', () => { const publicKey = '2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F'; - it('createComplete an address given publicKey + NetworkType.MIJIN_TEST', () => { - const address = Address.createFromPublicKey(publicKey, NetworkType.MIJIN_TEST); - expect(address.plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); - expect(address.networkType).to.be.equal(NetworkType.MIJIN_TEST); + it('createComplete an address given publicKey + NetworkType.PRIVATE_TEST', () => { + const address = Address.createFromPublicKey(publicKey, NetworkType.PRIVATE_TEST); + expect(address.plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); + expect(address.networkType).to.be.equal(NetworkType.PRIVATE_TEST); }); it('print the address in pretty format', () => { - const address = Address.createFromPublicKey(publicKey, NetworkType.MIJIN_TEST); - expect(address.pretty()).to.be.equal('SATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA34I2-PMQ'); + const address = Address.createFromPublicKey(publicKey, NetworkType.PRIVATE_TEST); + expect(address.pretty()).to.be.equal('QATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA367I-6OQ'); }); - it('createComplete an address given publicKey + NetworkType.MIJIN', () => { - const address = Address.createFromPublicKey(publicKey, NetworkType.MIJIN); - expect(address.plain()).to.be.equal('MATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34YACRA'); - expect(address.networkType).to.be.equal(NetworkType.MIJIN); + it('createComplete an address given publicKey + NetworkType.PRIVATE', () => { + const address = Address.createFromPublicKey(publicKey, NetworkType.PRIVATE); + expect(address.plain()).to.be.equal('PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI'); + expect(address.networkType).to.be.equal(NetworkType.PRIVATE); }); it('createComplete an address given publicKey + NetworkType.MAIN_NET', () => { @@ -50,14 +50,14 @@ describe('Address', () => { expect(address.networkType).to.be.equal(NetworkType.TEST_NET); }); - it('createComplete an address given SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); - expect(address.networkType).to.be.equal(NetworkType.MIJIN_TEST); + it('createComplete an address given QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', () => { + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); + expect(address.networkType).to.be.equal(NetworkType.PRIVATE_TEST); }); - it('createComplete an address given MATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34YACRA', () => { - const address = Address.createFromRawAddress('MATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34YACRA'); - expect(address.networkType).to.be.equal(NetworkType.MIJIN); + it('createComplete an address given PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI', () => { + const address = Address.createFromRawAddress('PATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA35OETNI'); + expect(address.networkType).to.be.equal(NetworkType.PRIVATE); }); it('createComplete an address given NATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34SQ33Y', () => { @@ -70,10 +70,10 @@ describe('Address', () => { expect(address.networkType).to.be.equal(NetworkType.TEST_NET); }); - it('createComplete an address given SATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA34I2-PMQ', () => { - const address = Address.createFromRawAddress('SATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA34I2-PMQ'); - expect(address.networkType).to.be.equal(NetworkType.MIJIN_TEST); - expect(address.pretty()).to.be.equal('SATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA34I2-PMQ'); + it('createComplete an address given QATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA367I-6OQ', () => { + const address = Address.createFromRawAddress('QATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA367I-6OQ'); + expect(address.networkType).to.be.equal(NetworkType.PRIVATE_TEST); + expect(address.pretty()).to.be.equal('QATNE7-Q5BITM-UTRRN6-IB4I7F-LSDRDW-ZA367I-6OQ'); }); it('should throw Error when the address contain an invalid network identifier', () => { @@ -114,15 +114,15 @@ describe('Address', () => { describe('isValidRawAddress', () => { it('returns true for valid address when generated', () => { // Assert: - expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.MIJIN_TEST).address.plain())).to.equal(true); + expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.PRIVATE_TEST).address.plain())).to.equal(true); expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.MAIN_NET).address.plain())).to.equal(true); - expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.MIJIN).address.plain())).to.equal(true); + expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.PRIVATE).address.plain())).to.equal(true); expect(Address.isValidRawAddress(Account.generateNewAccount(NetworkType.TEST_NET).address.plain())).to.equal(true); }); it('returns true for valid address', () => { // Arrange: - const rawAddress = 'SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'; + const rawAddress = 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'; // Assert: expect(Address.isValidRawAddress(rawAddress)).to.equal(true); @@ -165,7 +165,7 @@ describe('Address', () => { const rawAddress = [ 'NAR3W7B4BCOZSZMFIZRYB3N5YGOUSWIYJCJ6HDA', 'TDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWEPHRSI', - 'MDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWFN3NKY', + 'PDZ4373ASEGJ7S7GQTKF26TIIMC7HK5EWELJG3Y', 'MCOVTFVVDZGNURZFU4IJLJR37X5TXNWMTTARXZQ', ]; @@ -179,9 +179,9 @@ describe('Address', () => { describe('isValidEncodedAddress', () => { it('returns true for valid address when generated', () => { // Assert: - expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.MIJIN_TEST).address.encoded())).to.equal(true); + expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.PRIVATE_TEST).address.encoded())).to.equal(true); expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.MAIN_NET).address.encoded())).to.equal(true); - expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.MIJIN).address.encoded())).to.equal(true); + expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.PRIVATE).address.encoded())).to.equal(true); expect(Address.isValidEncodedAddress(Account.generateNewAccount(NetworkType.TEST_NET).address.encoded())).to.equal(true); }); diff --git a/test/model/account/MultisigAccountGraphInfo.spec.ts b/test/model/account/MultisigAccountGraphInfo.spec.ts index 5733a14aa1..8365b4570b 100644 --- a/test/model/account/MultisigAccountGraphInfo.spec.ts +++ b/test/model/account/MultisigAccountGraphInfo.spec.ts @@ -30,20 +30,20 @@ describe('MultisigAccountGraphInfo', () => { multisig: { accountAddress: Address.createFromPublicKey( 'B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), cosignatoryAddresses: [ Address.createFromPublicKey( 'CF893FFCC47C33E7F68AB1DB56365C156B0736824A0C1E273F9E00B8DF8F01EB', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), Address.createFromPublicKey( '68B3FBB18729C1FDE225C57F8CE080FA828F0067E451A3FD81FA628842B0B763', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), Address.createFromPublicKey( 'DAB1C38C3E1642494FCCB33138B95E81867B5FB59FC4277A1D53761C8B9F6D14', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), ], minApproval: 3, @@ -51,7 +51,7 @@ describe('MultisigAccountGraphInfo', () => { multisigAddresses: [ Address.createFromPublicKey( '1674016C27FE2C2EB5DFA73996FA54A183B38AED0AA64F756A3918BAF08E061B', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), ], }, diff --git a/test/model/account/MultisigAccountInfo.spec.ts b/test/model/account/MultisigAccountInfo.spec.ts index a32cf7b80d..0ba384728c 100644 --- a/test/model/account/MultisigAccountInfo.spec.ts +++ b/test/model/account/MultisigAccountInfo.spec.ts @@ -24,17 +24,17 @@ describe('MultisigAccountInfo', () => { multisig: { accountAddress: Address.createFromPublicKey( 'B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), cosignatoryAddresses: [ - Address.createFromPublicKey('CF893FFCC47C33E7F68AB1DB56365C156B0736824A0C1E273F9E00B8DF8F01EB', NetworkType.MIJIN_TEST), - Address.createFromPublicKey('68B3FBB18729C1FDE225C57F8CE080FA828F0067E451A3FD81FA628842B0B763', NetworkType.MIJIN_TEST), - Address.createFromPublicKey('DAB1C38C3E1642494FCCB33138B95E81867B5FB59FC4277A1D53761C8B9F6D14', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('CF893FFCC47C33E7F68AB1DB56365C156B0736824A0C1E273F9E00B8DF8F01EB', NetworkType.PRIVATE_TEST), + Address.createFromPublicKey('68B3FBB18729C1FDE225C57F8CE080FA828F0067E451A3FD81FA628842B0B763', NetworkType.PRIVATE_TEST), + Address.createFromPublicKey('DAB1C38C3E1642494FCCB33138B95E81867B5FB59FC4277A1D53761C8B9F6D14', NetworkType.PRIVATE_TEST), ], minApproval: 3, minRemoval: 3, multisigAddresses: [ - Address.createFromPublicKey('1674016C27FE2C2EB5DFA73996FA54A183B38AED0AA64F756A3918BAF08E061B', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('1674016C27FE2C2EB5DFA73996FA54A183B38AED0AA64F756A3918BAF08E061B', NetworkType.PRIVATE_TEST), ], }, }; @@ -102,7 +102,10 @@ describe('MultisigAccountInfo', () => { expect( multisigAccountInfo.hasCosigner( - Address.createFromPublicKey('CF893FFCC47C33E7F68AB1DB56365C156B0736824A0C1E273F9E00B8DF8F01EB', NetworkType.MIJIN_TEST), + Address.createFromPublicKey( + 'CF893FFCC47C33E7F68AB1DB56365C156B0736824A0C1E273F9E00B8DF8F01EB', + NetworkType.PRIVATE_TEST, + ), ), ).to.be.equal(true); }); @@ -118,7 +121,10 @@ describe('MultisigAccountInfo', () => { expect( multisigAccountInfo.hasCosigner( - Address.createFromPublicKey('B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', NetworkType.MIJIN_TEST), + Address.createFromPublicKey( + 'B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', + NetworkType.PRIVATE_TEST, + ), ), ).to.be.equal(false); }); @@ -136,7 +142,10 @@ describe('MultisigAccountInfo', () => { expect( multisigAccountInfo.isCosignerOfMultisigAccount( - Address.createFromPublicKey('1674016C27FE2C2EB5DFA73996FA54A183B38AED0AA64F756A3918BAF08E061B', NetworkType.MIJIN_TEST), + Address.createFromPublicKey( + '1674016C27FE2C2EB5DFA73996FA54A183B38AED0AA64F756A3918BAF08E061B', + NetworkType.PRIVATE_TEST, + ), ), ).to.be.equal(true); }); @@ -152,7 +161,10 @@ describe('MultisigAccountInfo', () => { expect( multisigAccountInfo.isCosignerOfMultisigAccount( - Address.createFromPublicKey('B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', NetworkType.MIJIN_TEST), + Address.createFromPublicKey( + 'B694186EE4AB0558CA4AFCFDD43B42114AE71094F5A1FC4A913FE9971CACD21D', + NetworkType.PRIVATE_TEST, + ), ), ).to.be.equal(false); }); diff --git a/test/model/account/PublicAccount.spec.ts b/test/model/account/PublicAccount.spec.ts index 559e1efb2b..5f014ba7de 100644 --- a/test/model/account/PublicAccount.spec.ts +++ b/test/model/account/PublicAccount.spec.ts @@ -23,9 +23,9 @@ describe('PublicAccount', () => { const publicKey = 'b4f12e7c9f6946091e2cb8b6d3a12b50d17ccbbf646386ea27ce2946a7423dcf'; it('should createComplete a public account from public key', () => { - const publicAccount = PublicAccount.createFromPublicKey(publicKey, NetworkType.MIJIN_TEST); + const publicAccount = PublicAccount.createFromPublicKey(publicKey, NetworkType.PRIVATE_TEST); expect(publicAccount.publicKey).to.be.equal(publicKey); - expect(publicAccount.address.plain()).to.be.equal('SARNASAS2BIAB6LMFA3FPMGBPGIJGK6IJETM3ZQ'); + expect(publicAccount.address.plain()).to.be.equal('QARNASAS2BIAB6LMFA3FPMGBPGIJGK6IJGY6QEI'); }); }); @@ -43,7 +43,7 @@ describe('Signature verification', () => { // Arrange: const signerPublicAccount = PublicAccount.createFromPublicKey( '22816F825B4CACEA334723D51297D8582332D8B875A5829908AAE85831ABB508', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const data = 'I am so so so awesome as always'; const signature = 'B01DCA6484026C2ECDF3C822E64DEAAFC15EBCCE337EEE209C28513CB5351CDED8863A8E7B855CD471B55C91FAE611C5486'; // Act & Assert: @@ -56,7 +56,7 @@ describe('Signature verification', () => { // Arrange: const signerPublicAccount = PublicAccount.createFromPublicKey( '22816F825B4CACEA334723D51297D8582332D8B875A5829908AAE85831ABB508', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const data = 'I am so so so awesome as always'; const signature = @@ -70,7 +70,7 @@ describe('Signature verification', () => { // Arrange: const signerPublicAccount = PublicAccount.createFromPublicKey( '12816F825B4CACEA334723D51297D8582332D8B875A5829908AAE85831ABB509', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const data = 'I am so so so awesome as always'; const signature = @@ -82,7 +82,7 @@ describe('Signature verification', () => { // Arrange: const signerPublicAccount = PublicAccount.createFromPublicKey( '22816F825B4CACEA334723D51297D8582332D8B875A5829908AAE85831ABB508', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const data = 'I am awesome as always'; const signature = @@ -94,7 +94,7 @@ describe('Signature verification', () => { // Arrange: const signerPublicAccount = PublicAccount.createFromPublicKey( '22816F825B4CACEA334723D51297D8582332D8B875A5829908AAE85831ABB508', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const data = 'I am so so so awesome as always'; const signature = diff --git a/test/model/blockchain/BlockInfo.spec.ts b/test/model/blockchain/BlockInfo.spec.ts index be9ab1dadc..f2bf61bfd8 100644 --- a/test/model/blockchain/BlockInfo.spec.ts +++ b/test/model/blockchain/BlockInfo.spec.ts @@ -41,7 +41,7 @@ describe('BlockInfo', () => { '37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868' + 'E932E1A9BEF8A27D48E1FFEE401E933EB801824373E7537E51733E0F', signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - beneficiaryAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', + beneficiaryAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', timestamp: new UInt64([0, 0]), type: 32768, version: 1, diff --git a/test/model/blockchain/NewBlock.spec.ts b/test/model/blockchain/NewBlock.spec.ts index 42752bf736..3ea1808c1b 100644 --- a/test/model/blockchain/NewBlock.spec.ts +++ b/test/model/blockchain/NewBlock.spec.ts @@ -42,7 +42,7 @@ describe('NewBlock', () => { signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', beneficiaryAddress: Address.createFromPublicKey( 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).encoded(), timestamp: new UInt64([0, 0]), type: 32768, diff --git a/test/model/lock/HashLockInfo.spec.ts b/test/model/lock/HashLockInfo.spec.ts index 08b4e2ae82..13e033295d 100644 --- a/test/model/lock/HashLockInfo.spec.ts +++ b/test/model/lock/HashLockInfo.spec.ts @@ -30,7 +30,7 @@ describe('HashLockInfo', () => { lockDto.endHeight = '122'; lockDto.hash = 'AAA'; lockDto.mosaicId = new MosaicId([3294802500, 2243684972]).toHex(); - lockDto.ownerAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ').plain(); + lockDto.ownerAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ').plain(); lockDto.status = 1; dto.lock = lockDto; const info = new HashLockInfo( diff --git a/test/model/lock/SecretLockInfo.spec.ts b/test/model/lock/SecretLockInfo.spec.ts index 50306902d8..f5b350690a 100644 --- a/test/model/lock/SecretLockInfo.spec.ts +++ b/test/model/lock/SecretLockInfo.spec.ts @@ -31,8 +31,8 @@ describe('SecretLockInfo', () => { lockDto.compositeHash = 'AAA'; lockDto.secret = 'AAA'; lockDto.mosaicId = new MosaicId([3294802500, 2243684972]).toHex(); - lockDto.ownerAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ').plain(); - lockDto.recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ').plain(); + lockDto.ownerAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ').plain(); + lockDto.recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ').plain(); lockDto.status = 1; lockDto.hashAlgorithm = LockHashAlgorithmEnum.NUMBER_0; dto.lock = lockDto; diff --git a/test/model/message/EncryptedMessage.spec.ts b/test/model/message/EncryptedMessage.spec.ts index d98315ef24..747b2b5788 100644 --- a/test/model/message/EncryptedMessage.spec.ts +++ b/test/model/message/EncryptedMessage.spec.ts @@ -21,7 +21,6 @@ import { NetworkType } from '../../../src/model/network/NetworkType'; import { Deadline } from '../../../src/model/transaction/Deadline'; import { TransferTransaction } from '../../../src/model/transaction/TransferTransaction'; import { NetworkCurrencyLocal } from '../../../src/model/mosaic/NetworkCurrencyLocal'; -import { Duration } from 'js-joda'; describe('EncryptedMessage', () => { let sender: Account; @@ -29,12 +28,12 @@ describe('EncryptedMessage', () => { let sender_nis: Account; let recipient_nis: Account; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { - sender = Account.createFromPrivateKey('2602F4236B199B3DF762B2AAB46FC3B77D8DDB214F0B62538D3827576C46C108', NetworkType.MIJIN_TEST); + sender = Account.createFromPrivateKey('2602F4236B199B3DF762B2AAB46FC3B77D8DDB214F0B62538D3827576C46C108', NetworkType.PRIVATE_TEST); recipient = Account.createFromPrivateKey( 'B72F2950498111BADF276D6D9D5E345F04E0D5C9B8342DA983C3395B4CF18F08', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); sender_nis = Account.createFromPrivateKey('2602F4236B199B3DF762B2AAB46FC3B77D8DDB214F0B62538D3827576C46C108', NetworkType.TEST_NET); @@ -69,7 +68,7 @@ describe('EncryptedMessage', () => { recipient.address, [NetworkCurrencyLocal.createAbsolute(1)], sender.encryptMessage('Testing simple transfer', recipient.publicAccount), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = transferTransaction.signWith(sender, generationHash); const encryptMessage = EncryptedMessage.createFromPayload( diff --git a/test/model/message/PersistentHarvestingDelegationMessage.spec.ts b/test/model/message/PersistentHarvestingDelegationMessage.spec.ts index 25c4c653cd..de95067a18 100644 --- a/test/model/message/PersistentHarvestingDelegationMessage.spec.ts +++ b/test/model/message/PersistentHarvestingDelegationMessage.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Account } from '../../../src/model/account/Account'; import { MessageType } from '../../../src/model/message/MessageType'; import { PersistentHarvestingDelegationMessage } from '../../../src/model/message/PersistentHarvestingDelegationMessage'; @@ -29,12 +28,12 @@ describe('PersistentHarvestingDelegationMessage', () => { let recipient_nis: Account; const signingPrivateKey = 'F0AB1010EFEE19EE5373719881DF5123C13E643C519655F7E97347BFF77175BF'; const vrfPrivateKey = '800F35F1CC66C2B62CE9DD9F31003B9B3E5C7A2F381FB8952A294277A1015D83'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { - sender = Account.createFromPrivateKey('2602F4236B199B3DF762B2AAB46FC3B77D8DDB214F0B62538D3827576C46C108', NetworkType.MIJIN_TEST); + sender = Account.createFromPrivateKey('2602F4236B199B3DF762B2AAB46FC3B77D8DDB214F0B62538D3827576C46C108', NetworkType.PRIVATE_TEST); recipient = Account.createFromPrivateKey( 'B72F2950498111BADF276D6D9D5E345F04E0D5C9B8342DA983C3395B4CF18F08', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); recipient_nis = Account.createFromPrivateKey( 'B72F2950498111BADF276D6D9D5E345F04E0D5C9B8342DA983C3395B4CF18F08', @@ -47,7 +46,7 @@ describe('PersistentHarvestingDelegationMessage', () => { signingPrivateKey, vrfPrivateKey, recipient.publicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(encryptedMessage.payload.length).to.be.equal(264); expect(encryptedMessage.type).to.be.equal(MessageType.PersistentHarvestingDelegationMessage); @@ -75,7 +74,7 @@ describe('PersistentHarvestingDelegationMessage', () => { signingPrivateKey, vrfPrivateKey, recipient.publicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const plainMessage = PersistentHarvestingDelegationMessage.decrypt(encryptedMessage, recipient.privateKey); expect(plainMessage).to.be.equal(signingPrivateKey + vrfPrivateKey); @@ -88,7 +87,7 @@ describe('PersistentHarvestingDelegationMessage', () => { signingPrivateKey, vrfPrivateKey, recipient.publicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = tx.signWith(sender, generationHash); const encryptMessage = PersistentHarvestingDelegationMessage.createFromPayload( diff --git a/test/model/mosaic/MosaicAmountView.spec.ts b/test/model/mosaic/MosaicAmountView.spec.ts index 942a8fa27c..c38f160610 100644 --- a/test/model/mosaic/MosaicAmountView.spec.ts +++ b/test/model/mosaic/MosaicAmountView.spec.ts @@ -32,7 +32,7 @@ describe('MosaicAmountView', () => { new MosaicId([3294802500, 2243684972]), // mosaicId new UInt64([3403414400, 2095475]), // supply new UInt64([1, 0]), // height - Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.PRIVATE_TEST), 1, // revision MosaicFlags.create(true, true, true), 3, @@ -64,7 +64,7 @@ describe('MosaicAmountView', () => { new MosaicId([3294802500, 2243684972]), // mosaicId new UInt64([3403414400, 2095475]), // supply new UInt64([1, 0]), // height - Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.PRIVATE_TEST), 1, // revision MosaicFlags.create(true, true, true), 0, diff --git a/test/model/mosaic/MosaicId.spec.ts b/test/model/mosaic/MosaicId.spec.ts index 37c447796f..f352b07cde 100644 --- a/test/model/mosaic/MosaicId.spec.ts +++ b/test/model/mosaic/MosaicId.spec.ts @@ -35,13 +35,13 @@ describe('MosaicId', () => { }); it('should create id given nonce and owner', () => { - const owner = PublicAccount.createFromPublicKey(publicKey, NetworkType.MIJIN_TEST); + const owner = PublicAccount.createFromPublicKey(publicKey, NetworkType.PRIVATE_TEST); const id = MosaicId.createFromNonce(MosaicNonce.createFromNumber(0), owner.address); - deepEqual(id.id, new Id([3526830425, 1241357627])); + deepEqual(id.id, new Id([2421763194, 2078664323])); }); it('should create id twice the same given nonce and owner', () => { - const owner = PublicAccount.createFromPublicKey(publicKey, NetworkType.MIJIN_TEST); + const owner = PublicAccount.createFromPublicKey(publicKey, NetworkType.PRIVATE_TEST); const id1 = MosaicId.createFromNonce(MosaicNonce.createFromNumber(12), owner.address); const id2 = MosaicId.createFromNonce(MosaicNonce.createFromNumber(12), owner.address); diff --git a/test/model/mosaic/MosaicInfo.spec.ts b/test/model/mosaic/MosaicInfo.spec.ts index 7bbe750b27..3795f00a25 100644 --- a/test/model/mosaic/MosaicInfo.spec.ts +++ b/test/model/mosaic/MosaicInfo.spec.ts @@ -32,7 +32,7 @@ describe('MosaicInfo', () => { startHeight: new UInt64([1, 0]), ownerAddress: Address.createFromPublicKey( 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), revision: 1, flags: 7, diff --git a/test/model/mosaic/MosaicView.spec.ts b/test/model/mosaic/MosaicView.spec.ts index 426fab1b7d..c230b0dbc6 100644 --- a/test/model/mosaic/MosaicView.spec.ts +++ b/test/model/mosaic/MosaicView.spec.ts @@ -32,7 +32,7 @@ describe('MosaicView', () => { new MosaicId([3294802500, 2243684972]), new UInt64([3403414400, 2095475]), // supply new UInt64([1, 0]), // height - Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.PRIVATE_TEST), 1, // revision MosaicFlags.create(true, true, true), 2, diff --git a/test/model/namespace/Alias.spec.ts b/test/model/namespace/Alias.spec.ts index 0fcb439e58..e7a8e0df92 100644 --- a/test/model/namespace/Alias.spec.ts +++ b/test/model/namespace/Alias.spec.ts @@ -29,8 +29,8 @@ describe('Alias', () => { let address2; before(() => { - address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); - address2 = Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'); + address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); + address2 = Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'); mosaicAliasDTO = { type: AliasType.Mosaic, mosaicId: new MosaicId([481110499, 231112638]), diff --git a/test/model/namespace/NamespaceInfo.spec.ts b/test/model/namespace/NamespaceInfo.spec.ts index f9c964538d..1148822444 100644 --- a/test/model/namespace/NamespaceInfo.spec.ts +++ b/test/model/namespace/NamespaceInfo.spec.ts @@ -71,7 +71,7 @@ describe('NamespaceInfo', () => { level0: new NamespaceId([929036875, 2226345261]), ownerAddress: Address.createFromPublicKey( 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).encoded(), parentId: new NamespaceId([0, 0]), startHeight: new UInt64([1, 0]), @@ -93,7 +93,7 @@ describe('NamespaceInfo', () => { parentId: new NamespaceId([3316183705, 3829351378]), ownerAddress: Address.createFromPublicKey( '846B4439154579A5903B1459C9CF69CB8153F6D0110A7A0ED61DE29AE4810BF2', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).encoded(), startHeight: [795, 0], endHeight: [50795, 0], diff --git a/test/model/network/NetworkType.spec.ts b/test/model/network/NetworkType.spec.ts index 24cb724f19..2d4a54c6c3 100644 --- a/test/model/network/NetworkType.spec.ts +++ b/test/model/network/NetworkType.spec.ts @@ -28,6 +28,16 @@ describe('NetworkType', () => { expect(NetworkType.TEST_NET).to.be.equal(152); }); + it('PRIVATE_TEST is 0x80', () => { + expect(NetworkType.PRIVATE_TEST).to.be.equal(0x80); + expect(NetworkType.PRIVATE_TEST).to.be.equal(128); + }); + + it('PRIVATE is 0x78', () => { + expect(NetworkType.PRIVATE).to.be.equal(0x78); + expect(NetworkType.PRIVATE).to.be.equal(120); + }); + it('MIJIN is 0x60', () => { expect(NetworkType.MIJIN).to.be.equal(0x60); expect(NetworkType.MIJIN).to.be.equal(96); diff --git a/test/model/receipt/Receipt.spec.ts b/test/model/receipt/Receipt.spec.ts index f1d4a7d5eb..29155f625f 100644 --- a/test/model/receipt/Receipt.spec.ts +++ b/test/model/receipt/Receipt.spec.ts @@ -49,7 +49,10 @@ describe('Receipt', () => { let statementDTO; before(() => { - account = Account.createFromPrivateKey('D242FB34C2C4DD36E995B9C865F93940065E326661BA5A4A247331D211FE3A3D', NetworkType.MIJIN_TEST); + account = Account.createFromPrivateKey( + 'D242FB34C2C4DD36E995B9C865F93940065E326661BA5A4A247331D211FE3A3D', + NetworkType.PRIVATE_TEST, + ); transactionStatementsDTO = [ { statement: { @@ -358,7 +361,7 @@ describe('Receipt', () => { it('should generate hash for TransactionStatement', () => { const receipt = createTransactionStatement(statementDTO.transactionStatements[0]); const hash = receipt.generateHash(); - expect(hash).to.be.equal('E73E67382162C38AED77D5D5D67F96AA590DC12FF13AE263AA50932896AC4801'); + expect(hash).to.be.equal('872A93FFA08A23EA36F429B6AA5B98AA237F2CBF5FDC975ABA732313D493B74F'); }); it('artifactExpiryReceipt - serialize', () => { diff --git a/test/model/receipt/ResolutionEntry.spec.ts b/test/model/receipt/ResolutionEntry.spec.ts index edde3a73d8..ddab3d68ec 100644 --- a/test/model/receipt/ResolutionEntry.spec.ts +++ b/test/model/receipt/ResolutionEntry.spec.ts @@ -34,7 +34,7 @@ describe('ResolutionEntry', () => { it('Should serialize', () => { const entry = new ResolutionEntry(address, new ReceiptSource(0, 1)); const result = entry.serialize(); - expect(Convert.uint8ToHex(result)).to.be.equal('90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA40000000001000000'); + expect(Convert.uint8ToHex(result)).to.be.equal('80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05C0000000001000000'); }); it('Should serialize - Mosaic', () => { diff --git a/test/model/receipt/Statement.spec.ts b/test/model/receipt/Statement.spec.ts index 7f76eeb4af..881917eb86 100644 --- a/test/model/receipt/Statement.spec.ts +++ b/test/model/receipt/Statement.spec.ts @@ -31,7 +31,7 @@ // let statementDTO; // before(() => { -// account = Account.createFromPrivateKey('81C18245507F9C15B61BDEDAFA2C10D9DC2C4E401E573A10935D45AA2A461FD5', NetworkType.MIJIN_TEST); +// account = Account.createFromPrivateKey('81C18245507F9C15B61BDEDAFA2C10D9DC2C4E401E573A10935D45AA2A461FD5', NetworkType.PRIVATE_TEST); // transactionStatementsDTO = [ // { // statement: { @@ -44,7 +44,7 @@ // { // version: 1, // type: 8515, -// targetAddress: '6026D27E1D0A26CA4E316F901E23E55C8711DB20DF300144', +// targetAddress: '7826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B5', // mosaicId: '504677C3281108DB', // amount: '0', // }, diff --git a/test/model/restriction/AccountRestrictions.spec.ts b/test/model/restriction/AccountRestrictions.spec.ts index 249a1e276c..b6a47a2b1d 100644 --- a/test/model/restriction/AccountRestrictions.spec.ts +++ b/test/model/restriction/AccountRestrictions.spec.ts @@ -32,7 +32,7 @@ describe('AccountRestrictions', () => { values: [ { modificationAction: AccountRestrictionModificationAction.Add, - value: 'SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ', + value: 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', }, ], }, diff --git a/test/model/restriction/AccountRestrictionsInfo.spec.ts b/test/model/restriction/AccountRestrictionsInfo.spec.ts index 6270752a92..0886733667 100644 --- a/test/model/restriction/AccountRestrictionsInfo.spec.ts +++ b/test/model/restriction/AccountRestrictionsInfo.spec.ts @@ -34,7 +34,7 @@ describe('AccountRestrictionsInfo', () => { values: [ { modificationAction: AccountRestrictionModificationAction.Add, - value: 'SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ', + value: 'QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ', }, ], }, diff --git a/test/model/transaction/AccountKeyLinkTransaction.spec.ts b/test/model/transaction/AccountKeyLinkTransaction.spec.ts index da3c7698bd..219660eace 100644 --- a/test/model/transaction/AccountKeyLinkTransaction.spec.ts +++ b/test/model/transaction/AccountKeyLinkTransaction.spec.ts @@ -24,12 +24,11 @@ import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { Address } from '../../../src/model/account/Address'; -import { Duration } from 'js-joda'; describe('AccountKeyLinkTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -39,7 +38,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(accountKeyLinkTransaction.maxFee.higher).to.be.equal(0); @@ -51,7 +50,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -64,7 +63,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(accountKeyLinkTransaction.linkAction).to.be.equal(1); @@ -82,7 +81,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(accountKeyLinkTransaction.linkAction).to.be.equal(0); @@ -101,7 +100,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(accountKeyLinkTransaction.serialize()).length).to.be.equal(accountKeyLinkTransaction.size); expect(accountKeyLinkTransaction.size).to.be.equal(161); @@ -112,7 +111,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(accountKeyLinkTransaction.serialize()).length).to.be.equal(accountKeyLinkTransaction.size); expect(accountKeyLinkTransaction.size).to.be.equal(161); @@ -125,7 +124,7 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(accountKeyLinkTransaction.maxFee.compact()).to.be.equal(322); @@ -138,12 +137,12 @@ describe('AccountKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ')); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ')); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/AccountMetadataTransaction.spec.ts b/test/model/transaction/AccountMetadataTransaction.spec.ts index bcfc8c3cb7..d700c587f0 100644 --- a/test/model/transaction/AccountMetadataTransaction.spec.ts +++ b/test/model/transaction/AccountMetadataTransaction.spec.ts @@ -27,12 +27,11 @@ import { TransactionType } from '../../../src/model/transaction/TransactionType' import { deepEqual } from 'assert'; import { Address } from '../../../src/model/account/Address'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; -import { Duration } from 'js-joda'; describe('AccountMetadataTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -44,7 +43,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(accountMetadataTransaction.maxFee.higher).to.be.equal(0); @@ -58,7 +57,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -73,13 +72,13 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = accountMetadataTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4E80300000000000001000A0000000000000000000000', + '80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05CE80300000000000001000A0000000000000000000000', ); }); @@ -91,7 +90,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(accountMetadataTransaction.serialize()).length).to.be.equal(accountMetadataTransaction.size); @@ -108,7 +107,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(accountMetadataTransaction.serialize()).length).to.be.equal(accountMetadataTransaction.size); @@ -125,7 +124,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(accountMetadataTransaction, { signer: account.publicAccount }); @@ -144,7 +143,7 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const resolved = accountMetadataTransaction.resolveAliases(); @@ -160,13 +159,13 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -182,13 +181,13 @@ describe('AccountMetadataTransaction', () => { UInt64.fromUint(1000), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, [alias]); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [wrongAlias]); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [wrongAlias]); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/AccountRestrictionTransaction.spec.ts b/test/model/transaction/AccountRestrictionTransaction.spec.ts index 738b332fc4..79bddf35ef 100644 --- a/test/model/transaction/AccountRestrictionTransaction.spec.ts +++ b/test/model/transaction/AccountRestrictionTransaction.spec.ts @@ -31,17 +31,16 @@ import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; import { AddressRestrictionFlag } from '../../../src/model/restriction/AddressRestrictionFlag'; import { OperationRestrictionFlag } from '../../../src/model/restriction/OperationRestrictionFlag'; import { MosaicRestrictionFlag } from '../../../src/model/restriction/MosaicRestrictionFlag'; -import { Duration } from 'js-joda'; describe('AccountRestrictionTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); it('should create address restriction filter', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress(AccountRestrictionModificationAction.Add, address); expect(addressRestrictionFilter.modificationAction).to.be.equal(AccountRestrictionModificationAction.Add); expect(addressRestrictionFilter.value).to.be.equal(address.plain()); @@ -67,13 +66,13 @@ describe('AccountRestrictionTransaction', () => { describe('size', () => { it('should return 160 for AccountAddressRestrictionTransaction transaction byte size with 1 modification', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(addressRestrictionTransaction.serialize()).length).to.be.equal(addressRestrictionTransaction.size); @@ -87,7 +86,7 @@ describe('AccountRestrictionTransaction', () => { MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicRestrictionTransaction.size).to.be.equal(144); }); @@ -98,7 +97,7 @@ describe('AccountRestrictionTransaction', () => { MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicRestrictionTransaction.setPayloadSize(10).size).to.be.equal(10); }); @@ -111,19 +110,19 @@ describe('AccountRestrictionTransaction', () => { OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(operationRestrictionTransaction.size).to.be.equal(138); }); it('should default maxFee field be set to 0', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(addressRestrictionTransaction.maxFee.higher).to.be.equal(0); @@ -131,13 +130,13 @@ describe('AccountRestrictionTransaction', () => { }); it('should filled maxFee override transaction maxFee', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -146,19 +145,19 @@ describe('AccountRestrictionTransaction', () => { }); it('should create allow incmoing address restriction transaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowIncomingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '01000100000000009026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B2', + '01000100000000008026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A', ); }); @@ -169,7 +168,7 @@ describe('AccountRestrictionTransaction', () => { MosaicRestrictionFlag.AllowMosaic, [mosaicId], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicRestrictionTransaction.signWith(account, generationHash); @@ -184,7 +183,7 @@ describe('AccountRestrictionTransaction', () => { OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); @@ -193,19 +192,19 @@ describe('AccountRestrictionTransaction', () => { }); it('should create outgoing address restriction transaction', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); let addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowOutgoingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '01400100000000009026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B2', + '01400100000000008026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A', ); addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -213,13 +212,13 @@ describe('AccountRestrictionTransaction', () => { AddressRestrictionFlag.BlockOutgoingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '01C00100000000009026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B2', + '01C00100000000008026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A', ); }); @@ -230,7 +229,7 @@ describe('AccountRestrictionTransaction', () => { OperationRestrictionFlag.AllowOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); @@ -242,7 +241,7 @@ describe('AccountRestrictionTransaction', () => { OperationRestrictionFlag.BlockOutgoingTransactionType, [operation], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); @@ -251,18 +250,18 @@ describe('AccountRestrictionTransaction', () => { }); it('Notify Account', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const tx = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(epochAdjustment), AddressRestrictionFlag.AllowOutgoingAddress, [address], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -273,12 +272,12 @@ describe('AccountRestrictionTransaction', () => { AddressRestrictionFlag.AllowOutgoingAddress, [], [address], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotifyDeletion = txDeletion.shouldNotifyAccount(address, []); expect(canNotifyDeletion).to.be.true; - canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'), []); + canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'), []); expect(canNotifyDeletion).to.be.false; Object.assign(txDeletion, { signer: account.publicAccount }); @@ -293,12 +292,12 @@ describe('AccountRestrictionTransaction', () => { AddressRestrictionFlag.AllowOutgoingAddress, [alias], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, [alias]); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [wrongAlias]); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [wrongAlias]); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -309,12 +308,12 @@ describe('AccountRestrictionTransaction', () => { AddressRestrictionFlag.AllowOutgoingAddress, [], [alias], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotifyDeletion = txDeletion.shouldNotifyAccount(account.address, [alias]); expect(canNotifyDeletion).to.be.true; - canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'), [ + canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'), [ wrongAlias, ]); expect(canNotifyDeletion).to.be.false; diff --git a/test/model/transaction/AddressAliasTransaction.spec.ts b/test/model/transaction/AddressAliasTransaction.spec.ts index 707d70c5d1..4e07af2c02 100644 --- a/test/model/transaction/AddressAliasTransaction.spec.ts +++ b/test/model/transaction/AddressAliasTransaction.spec.ts @@ -26,25 +26,24 @@ import { Deadline } from '../../../src/model/transaction/Deadline'; import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { AliasTransaction } from '../../../src/model/model'; -import { Duration } from 'js-joda'; describe('AddressAliasTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); it('should default maxFee field be set to 0', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(addressAliasTransaction.maxFee.higher).to.be.equal(0); @@ -53,13 +52,13 @@ describe('AddressAliasTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -69,60 +68,60 @@ describe('AddressAliasTransaction', () => { it('should createComplete an AddressAliasTransaction object and sign it', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(addressAliasTransaction.aliasAction).to.be.equal(AliasAction.Link); expect(addressAliasTransaction.namespaceId.id.lower).to.be.equal(33347626); expect(addressAliasTransaction.namespaceId.id.higher).to.be.equal(3779697293); - expect(addressAliasTransaction.address.plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(addressAliasTransaction.address.plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = addressAliasTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '2AD8FC018D9A49E19026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B201', + '2AD8FC018D9A49E18026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A01', ); }); it('should createComplete an AddressAliasTransaction using abstract', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AliasTransaction.createForAddress( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ) as AddressAliasTransaction; expect(addressAliasTransaction.aliasAction).to.be.equal(AliasAction.Link); expect(addressAliasTransaction.namespaceId.id.lower).to.be.equal(33347626); expect(addressAliasTransaction.namespaceId.id.higher).to.be.equal(3779697293); - expect(addressAliasTransaction.address.plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(addressAliasTransaction.address.plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = addressAliasTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '2AD8FC018D9A49E19026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B201', + '2AD8FC018D9A49E18026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A01', ); }); describe('size', () => { it('should return 161 for AggregateTransaction byte size with TransferTransaction with 1 mosaic and message NEM', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(addressAliasTransaction.serialize()).length).to.be.equal(addressAliasTransaction.size); expect(addressAliasTransaction.size).to.be.equal(161); @@ -130,13 +129,13 @@ describe('AddressAliasTransaction', () => { it('should set payload size', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(addressAliasTransaction.serialize()).length).to.be.equal(addressAliasTransaction.size); expect(addressAliasTransaction.size).to.be.equal(161); @@ -146,32 +145,32 @@ describe('AddressAliasTransaction', () => { it('Test set maxFee using multiplier', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const addressAliasTransaction = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(addressAliasTransaction.maxFee.compact()).to.be.equal(322); }); it('Notify Account', () => { const namespaceId = new NamespaceId([33347626, 3779697293]); - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const tx = AddressAliasTransaction.create( Deadline.create(epochAdjustment), AliasAction.Link, namespaceId, address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(address); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY')); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY')); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/AggregateTransaction.spec.ts b/test/model/transaction/AggregateTransaction.spec.ts index 829ac08dc1..38ef3da8dd 100644 --- a/test/model/transaction/AggregateTransaction.spec.ts +++ b/test/model/transaction/AggregateTransaction.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { ChronoUnit, Duration } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { Convert } from '../../../src/core/format'; import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; import { CreateTransactionFromDTO } from '../../../src/infrastructure/transaction/CreateTransactionFromDTO'; @@ -58,7 +58,7 @@ describe('AggregateTransaction', () => { const unresolvedAddress = new NamespaceId('address'); const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -82,16 +82,16 @@ describe('AggregateTransaction', () => { it('should default maxFee field be set to 0', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -102,16 +102,16 @@ describe('AggregateTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], new UInt64([1, 0]), ); @@ -123,23 +123,23 @@ describe('AggregateTransaction', () => { it('should createComplete an AggregateTransaction object with TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = aggregateTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(0, 8)).to.be.equal('08010000'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '019054419026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0000000000000000746573742D6D657373616765000000', + '018054418026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0000000000000000746573742D6D657373616765000000', ); }); @@ -148,13 +148,13 @@ describe('AggregateTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [registerNamespaceTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -163,7 +163,7 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(320, 352)).to.be.equal('58000000000000005500000000000000'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '01904E41E803000000000000CFCBE72D994BE69B0013726F6F742D746573742D6E616D657370616365000000', + '01804E41E803000000000000CFCBE72D994BE69B0013726F6F742D746573742D6E616D657370616365000000', ); }); @@ -175,13 +175,13 @@ describe('AggregateTransaction', () => { MosaicFlags.create(true, true, true), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [mosaicDefinitionTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -190,7 +190,7 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(0, 8)).to.be.equal('F0000000'); expect(signedTransaction.payload.substring(320, 352)).to.be.equal('48000000000000004600000000000000'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '01904D410100000000000000E803000000000000E6DE84B807030000', + '01804D410100000000000000E803000000000000E6DE84B807030000', ); }); @@ -201,13 +201,13 @@ describe('AggregateTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [mosaicSupplyChangeTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -216,7 +216,7 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(0, 8)).to.be.equal('F0000000'); expect(signedTransaction.payload.substring(320, 352)).to.be.equal('48000000000000004100000000000000'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '01904D424CCCD78612DDF5CA0A000000000000000100000000000000', + '01804D424CCCD78612DDF5CA0A000000000000000100000000000000', ); }); @@ -226,16 +226,16 @@ describe('AggregateTransaction', () => { 2, 1, [ - Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), - Address.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.PRIVATE_TEST), + Address.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.PRIVATE_TEST), ], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [modifyMultisigAccountTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -244,22 +244,22 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(0, 8)).to.be.equal('10010000'); expect(signedTransaction.payload.substring(320, 352)).to.be.equal('68000000000000006800000000000000'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '019055410102020000000000909FC4844A5206CFA44603EFA1FFC76FE9B0564D967FFE0D906B4CB49ECF224FC4F0F4FCA2F6034305B3A47B0BB90303', + '018055410102020000000000809FC4844A5206CFA44603EFA1FFC76FE9B0564D96735562806B4CB49ECF224FC4F0F4FCA2F6034305B3A47B0BB0D2C9', ); }); it('should createComplete an AggregateTransaction object with different cosignatories', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(MultisigAccount.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = CosignatoryAccount.signTransactionWithCosignatories( @@ -271,7 +271,7 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(0, 8)).to.be.equal('70010000'); expect(signedTransaction.payload.substring(320, 352)).to.be.equal('60000000000000005D00000000000000'); expect(signedTransaction.payload.substring(424, 424 + 162)).to.be.equal( - '019054419026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0000000000000000746573742D6D657373616' + + '018054418026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0000000000000000746573742D6D657373616' + '7650000000000000000000000F9D6329A1A927F5D8918D3D313524CF179DE126AF8', ); }); @@ -279,16 +279,16 @@ describe('AggregateTransaction', () => { it('should createBonded an AggregateTransaction object with TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment, 2, ChronoUnit.MINUTES), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -298,7 +298,7 @@ describe('AggregateTransaction', () => { expect(signedTransaction.payload.substring(320, 352)).to.be.equal('60000000000000005D00000000000000'); expect(signedTransaction.payload.substring(220, 224)).to.be.equal('4142'); expect(signedTransaction.payload.substring(424, signedTransaction.payload.length)).to.be.equal( - '019054419026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0000000000000000746573742D6D657373616765000000', + '018054418026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0000000000000000746573742D6D657373616765000000', ); }); @@ -348,13 +348,13 @@ describe('AggregateTransaction', () => { signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16725, version: 1, - network: 144, + network: 128, }, }, ], type: 16705, version: 1, - network: 144, + network: 128, }, }; @@ -363,7 +363,7 @@ describe('AggregateTransaction', () => { aggregateTransaction.signedByAccount( PublicAccount.createFromPublicKey( 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), ), ).to.be.equal(true); @@ -371,7 +371,7 @@ describe('AggregateTransaction', () => { aggregateTransaction.signedByAccount( PublicAccount.createFromPublicKey( '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), ), ).to.be.equal(true); @@ -379,7 +379,7 @@ describe('AggregateTransaction', () => { aggregateTransaction.signedByAccount( PublicAccount.createFromPublicKey( 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), ), ).to.be.equal(false); @@ -392,13 +392,18 @@ describe('AggregateTransaction', () => { }); it("should have type 0x4141 when it's complete", () => { - const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createComplete( + Deadline.create(epochAdjustment), + [], + NetworkType.PRIVATE_TEST, + [], + ); expect(aggregateTransaction.type).to.be.equal(0x4141); }); it("should have type 0x4241 when it's bonded", () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST); expect(aggregateTransaction.type).to.be.equal(0x4241); }); @@ -406,16 +411,16 @@ describe('AggregateTransaction', () => { it('should throw exception when adding an aggregated transaction as inner transaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -423,7 +428,7 @@ describe('AggregateTransaction', () => { AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [aggregateTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); }).to.throw(Error, 'Inner transaction cannot be an aggregated transaction.'); @@ -442,21 +447,21 @@ describe('AggregateTransaction', () => { accountBob.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const BtoATx = TransferTransaction.create( Deadline.create(epochAdjustment), accountAlice.address, [], PlainMessage.create('b to a'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const CtoATx = TransferTransaction.create( Deadline.create(epochAdjustment), accountAlice.address, [], PlainMessage.create('c to a'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); // 01. Alice creates the aggregated tx and sign it, Then payload send to Bob & Carol @@ -467,7 +472,7 @@ describe('AggregateTransaction', () => { BtoATx.toAggregate(accountBob.publicAccount), CtoATx.toAggregate(accountCarol.publicAccount), ], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -512,19 +517,19 @@ describe('AggregateTransaction', () => { account.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTx2 = TransferTransaction.create( Deadline.create(epochAdjustment), account.address, [], PlainMessage.create('b to a'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTx1.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -543,12 +548,12 @@ describe('AggregateTransaction', () => { account.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTx1.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -559,7 +564,7 @@ describe('AggregateTransaction', () => { const signedTransaction = aggregateTransaction.signWith(account, generationHash); const cosignature = new AggregateTransactionCosignature( signedTransaction.payload, - PublicAccount.createFromPublicKey(signedTransaction.signerPublicKey, NetworkType.MIJIN_TEST), + PublicAccount.createFromPublicKey(signedTransaction.signerPublicKey, NetworkType.PRIVATE_TEST), ); aggregateTransaction = aggregateTransaction.addCosignatures([cosignature]); @@ -572,15 +577,15 @@ describe('AggregateTransaction', () => { it('should return 268 for AggregateTransaction byte size with TransferTransaction with 1 mosaic and message NEM', () => { const transaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); expect(Convert.hexToUint8(aggregateTransaction.serialize()).length).to.be.equal(aggregateTransaction.size); @@ -589,15 +594,15 @@ describe('AggregateTransaction', () => { it('should set payload size', () => { const transaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); expect(aggregateTransaction.size).to.be.equal(272); @@ -612,13 +617,13 @@ describe('AggregateTransaction', () => { unresolvedAddress, [new Mosaic(unresolvedMosaicId, UInt64.fromUint(1))], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ).setMaxFeeForAggregate(2, 10); expect(aggregateTransaction.maxFee.compact()).to.be.equal(560 + 960 * 2); @@ -633,14 +638,14 @@ describe('AggregateTransaction', () => { unresolvedAddress, [new Mosaic(unresolvedMosaicId, UInt64.fromUint(1))], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(() => { AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ).setMaxFee(2); }).to.throw(); @@ -648,7 +653,7 @@ describe('AggregateTransaction', () => { it('Test resolveAlias can resolve', () => { const transferTransaction = new TransferTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -661,7 +666,7 @@ describe('AggregateTransaction', () => { ); const aggregateTransaction = new AggregateTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, TransactionType.AGGREGATE_COMPLETE, 1, Deadline.createFromDTO('1'), @@ -688,18 +693,18 @@ describe('AggregateTransaction', () => { account.address, [new Mosaic(unresolvedMosaicId, UInt64.fromUint(1))], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const tx = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); let canNotify = tx.shouldNotifyAccount(account.address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -712,20 +717,20 @@ describe('AggregateTransaction', () => { unresolvedAddress, [new Mosaic(unresolvedMosaicId, UInt64.fromUint(1))], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const tx = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); - let canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [ + let canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [ unresolvedAddress, ]); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/CosignatureTransaction.spec.ts b/test/model/transaction/CosignatureTransaction.spec.ts index aabaaf5bf4..50870ae466 100644 --- a/test/model/transaction/CosignatureTransaction.spec.ts +++ b/test/model/transaction/CosignatureTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { CreateTransactionFromDTO } from '../../../src/infrastructure/transaction/CreateTransactionFromDTO'; import { Account } from '../../../src/model/account/Account'; import { PlainMessage } from '../../../src/model/message/PlainMessage'; @@ -29,7 +28,7 @@ import { TestingAccount } from '../../conf/conf.spec'; describe('CosignatureTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -112,7 +111,7 @@ describe('CosignatureTransaction', () => { account.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).serialize(); const signedTx = CosignatureTransaction.signTransactionPayload(account, txPayload, generationHash); @@ -128,13 +127,13 @@ describe('CosignatureTransaction', () => { account.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregate = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [tx.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const txHash = '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6'; @@ -155,13 +154,13 @@ describe('CosignatureTransaction', () => { account.address, [], PlainMessage.create('a to b'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregate = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [tx.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const cosignTx = new CosignatureTransaction(aggregate); diff --git a/test/model/transaction/Deadline.spec.ts b/test/model/transaction/Deadline.spec.ts index bcb8c0d14c..0111f61f78 100644 --- a/test/model/transaction/Deadline.spec.ts +++ b/test/model/transaction/Deadline.spec.ts @@ -15,12 +15,11 @@ */ import { expect } from 'chai'; -import { ChronoUnit, Instant, LocalDateTime, ZoneId } from 'js-joda'; +import { ChronoUnit, Instant, LocalDateTime, ZoneId } from '@js-joda/core'; import { Deadline } from '../../../src/model/transaction/Deadline'; -import { Duration } from 'js-joda'; describe('Deadline', () => { - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; it('should createComplete timestamp today', () => { const deadline = Deadline.create(epochAdjustment); diff --git a/test/model/transaction/HashLockTransaction.spec.ts b/test/model/transaction/HashLockTransaction.spec.ts index b361138e11..c9db58f82d 100644 --- a/test/model/transaction/HashLockTransaction.spec.ts +++ b/test/model/transaction/HashLockTransaction.spec.ts @@ -14,7 +14,6 @@ * limitations under the License. */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { NetworkCurrencyLocal } from '../../../src/model/mosaic/NetworkCurrencyLocal'; import { NetworkType } from '../../../src/model/network/NetworkType'; @@ -27,16 +26,16 @@ import { TestingAccount } from '../../conf/conf.spec'; describe('HashLockTransaction', () => { const account = TestingAccount; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; it('creation with an aggregate bonded tx', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const transaction = HashLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transaction.mosaic.id).to.be.equal(NetworkCurrencyLocal.NAMESPACE_ID); expect(transaction.mosaic.amount.compact()).to.be.equal(10000000); @@ -45,7 +44,12 @@ describe('HashLockTransaction', () => { }); it('should throw exception if it is not a aggregate bonded tx', () => { - const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createComplete( + Deadline.create(epochAdjustment), + [], + NetworkType.PRIVATE_TEST, + [], + ); const signedTransaction = account.sign(aggregateTransaction, generationHash); expect(() => { HashLockTransaction.create( @@ -53,20 +57,20 @@ describe('HashLockTransaction', () => { NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); it('Notify Account', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const tx = HashLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/LockFundsTransaction.spec.ts b/test/model/transaction/LockFundsTransaction.spec.ts index d36ea5104f..7859b97c83 100644 --- a/test/model/transaction/LockFundsTransaction.spec.ts +++ b/test/model/transaction/LockFundsTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { deepEqual } from 'assert'; import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { Mosaic } from '../../../src/model/mosaic/Mosaic'; @@ -41,7 +40,7 @@ describe('LockFundsTransaction', () => { let statement: Statement; const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -56,14 +55,14 @@ describe('LockFundsTransaction', () => { }); it('should default maxFee field be set to 0', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockFundsTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(lockFundsTransaction.maxFee.higher).to.be.equal(0); @@ -72,14 +71,14 @@ describe('LockFundsTransaction', () => { }); it('should filled maxFee override transaction maxFee', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockFundsTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -88,14 +87,14 @@ describe('LockFundsTransaction', () => { }); it('creation with an aggregate bonded tx', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const transaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); deepEqual(transaction.mosaic.id.id, NetworkCurrencyLocal.NAMESPACE_ID.id); expect(transaction.mosaic.amount.compact()).to.be.equal(10000000); @@ -103,7 +102,12 @@ describe('LockFundsTransaction', () => { }); it('should throw exception if it is not a aggregate bonded tx', () => { - const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createComplete( + Deadline.create(epochAdjustment), + [], + NetworkType.PRIVATE_TEST, + [], + ); const signedTransaction = account.sign(aggregateTransaction, generationHash); expect(() => { LockFundsTransaction.create( @@ -111,25 +115,25 @@ describe('LockFundsTransaction', () => { NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); it('should create and sign LockFundsTransaction', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockFundsTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = lockFundsTransaction.signWith(account, generationHash); expect(signedTx.payload.substring(144, signedTransaction.payload.length - 104)).to.be.equal( - '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6000000000190484100000000', + '9801508C58666C746F471538E43002B85B1CD542F9874B2861183919BA8787B6000000000180484100000000', ); }); @@ -138,7 +142,7 @@ describe('LockFundsTransaction', () => { const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = account.sign(aggregateTransaction, generationHash); @@ -147,7 +151,7 @@ describe('LockFundsTransaction', () => { NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(lockFundsTransaction.size).to.be.equal(184); }); @@ -156,7 +160,7 @@ describe('LockFundsTransaction', () => { const aggregateTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = account.sign(aggregateTransaction, generationHash); @@ -165,7 +169,7 @@ describe('LockFundsTransaction', () => { NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(lockFundsTransaction.size).to.be.equal(184); expect(lockFundsTransaction.setPayloadSize(10).size).to.be.equal(10); @@ -173,14 +177,14 @@ describe('LockFundsTransaction', () => { }); it('Test set maxFee using multiplier', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const lockFundsTransaction = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(lockFundsTransaction.maxFee.compact()).to.be.equal(368); @@ -189,10 +193,10 @@ describe('LockFundsTransaction', () => { }); it('Test resolveAlias can resolve', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const transaction = new LockFundsTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -211,14 +215,14 @@ describe('LockFundsTransaction', () => { }); it('Notify Account', () => { - const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.MIJIN_TEST, []); + const aggregateTransaction = AggregateTransaction.createBonded(Deadline.create(epochAdjustment), [], NetworkType.PRIVATE_TEST, []); const signedTransaction = account.sign(aggregateTransaction, generationHash); const tx = LockFundsTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createRelative(10), UInt64.fromUint(10), signedTransaction, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/MosaicAddressRestrictionTransaction.spec.ts b/test/model/transaction/MosaicAddressRestrictionTransaction.spec.ts index c4ce9023ba..5fccd08d9c 100644 --- a/test/model/transaction/MosaicAddressRestrictionTransaction.spec.ts +++ b/test/model/transaction/MosaicAddressRestrictionTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { Address } from '../../../src/model/account/Address'; @@ -40,7 +39,7 @@ describe('MosaicAddressRestrictionTransaction', () => { const unresolvedAddress = new NamespaceId('address'); const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -66,7 +65,7 @@ describe('MosaicAddressRestrictionTransaction', () => { UInt64.fromUint(1), account.address, UInt64.fromUint(8), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(9), ); expect(mosaicAddressRestrictionTransaction.mosaicId.toHex()).to.be.equal(mosaicId.toHex()); @@ -78,7 +77,7 @@ describe('MosaicAddressRestrictionTransaction', () => { const signedTransaction = mosaicAddressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '010000000000000001000000000000000900000000000000080000000000000090D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4', + '010000000000000001000000000000000900000000000000080000000000000080D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05C', ); }); @@ -90,7 +89,7 @@ describe('MosaicAddressRestrictionTransaction', () => { UInt64.fromUint(1), account.address, UInt64.fromUint(8), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(9), ); expect(mosaicAddressRestrictionTransaction.mosaicId.toHex()).to.be.equal(namespacId.toHex()); @@ -102,7 +101,7 @@ describe('MosaicAddressRestrictionTransaction', () => { const signedTransaction = mosaicAddressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - 'C51FB4C93FCA509501000000000000000900000000000000080000000000000090D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4', + 'C51FB4C93FCA509501000000000000000900000000000000080000000000000080D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05C', ); }); @@ -115,7 +114,7 @@ describe('MosaicAddressRestrictionTransaction', () => { UInt64.fromUint(1), namespacId, UInt64.fromUint(8), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(9), ); expect(mosaicAddressRestrictionTransaction.mosaicId.toHex()).to.be.equal(mosaicId.toHex()); @@ -127,7 +126,7 @@ describe('MosaicAddressRestrictionTransaction', () => { const signedTransaction = mosaicAddressRestrictionTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '010000000000000001000000000000000900000000000000080000000000000091C51FB4C93FCA5095000000000000000000000000000000', + '010000000000000001000000000000000900000000000000080000000000000081C51FB4C93FCA5095000000000000000000000000000000', ); }); @@ -138,7 +137,7 @@ describe('MosaicAddressRestrictionTransaction', () => { UInt64.fromUint(1), new NamespaceId('nem.owner'), UInt64.fromUint(8), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(9), ); @@ -159,7 +158,7 @@ describe('MosaicAddressRestrictionTransaction', () => { UInt64.fromUint(1), new NamespaceId('nem.owner'), UInt64.fromUint(8), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, UInt64.fromUint(9), ).setMaxFee(2); expect(transaction.maxFee.compact()).to.be.equal(368); @@ -170,7 +169,7 @@ describe('MosaicAddressRestrictionTransaction', () => { it('Test resolveAlias can resolve', () => { const transaction = new MosaicAddressRestrictionTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), diff --git a/test/model/transaction/MosaicAliasTransaction.spec.ts b/test/model/transaction/MosaicAliasTransaction.spec.ts index 787b8c9aeb..705255f732 100644 --- a/test/model/transaction/MosaicAliasTransaction.spec.ts +++ b/test/model/transaction/MosaicAliasTransaction.spec.ts @@ -29,12 +29,11 @@ import { deepEqual } from 'assert'; import { EmbeddedTransactionBuilder } from 'catbuffer-typescript/dist/EmbeddedTransactionBuilder'; import { TransactionType } from '../../../src/model/transaction/TransactionType'; import { AliasTransaction } from '../../../src/model/transaction/AliasTransaction'; -import { Duration } from 'js-joda'; describe('MosaicAliasTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -47,7 +46,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicAliasTransaction.maxFee.higher).to.be.equal(0); @@ -62,7 +61,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -78,7 +77,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicAliasTransaction.aliasAction).to.be.equal(AliasAction.Link); @@ -102,7 +101,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ) as MosaicAliasTransaction; expect(mosaicAliasTransaction.aliasAction).to.be.equal(AliasAction.Link); @@ -127,7 +126,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicAliasTransaction.size).to.be.equal(145); expect(Convert.hexToUint8(mosaicAliasTransaction.serialize()).length).to.be.equal(mosaicAliasTransaction.size); @@ -140,7 +139,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicAliasTransaction.size).to.be.equal(145); expect(Convert.hexToUint8(mosaicAliasTransaction.serialize()).length).to.be.equal(mosaicAliasTransaction.size); @@ -156,7 +155,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(mosaicAliasTransaction.maxFee.compact()).to.be.equal(290); @@ -172,7 +171,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const resolved = mosaicAliasTransaction.resolveAliases(); deepEqual(mosaicAliasTransaction, resolved); @@ -186,7 +185,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(mosaicAliasTransaction, { signer: account.publicAccount }); @@ -206,7 +205,7 @@ describe('MosaicAliasTransaction', () => { AliasAction.Link, namespaceId, mosaicId, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/MosaicDefinitionTransaction.spec.ts b/test/model/transaction/MosaicDefinitionTransaction.spec.ts index 1b1e6ecef3..6fc6b73550 100644 --- a/test/model/transaction/MosaicDefinitionTransaction.spec.ts +++ b/test/model/transaction/MosaicDefinitionTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { MosaicFlags } from '../../../src/model/mosaic/MosaicFlags'; @@ -30,7 +29,7 @@ import { TestingAccount } from '../../conf/conf.spec'; describe('MosaicDefinitionTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -43,7 +42,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(true, true, true), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.maxFee.higher).to.be.equal(0); @@ -58,7 +57,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(true, true, true), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -74,7 +73,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(true, true, true), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.duration!.lower).to.be.equal(1000); @@ -99,7 +98,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.duration!.lower).to.be.equal(1000); @@ -125,7 +124,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(true, true, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.size).to.be.equal(150); expect(Convert.hexToUint8(mosaicDefinitionTransaction.serialize()).length).to.be.equal(mosaicDefinitionTransaction.size); @@ -138,7 +137,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(true, true, false), 3, UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.size).to.be.equal(150); expect(Convert.hexToUint8(mosaicDefinitionTransaction.serialize()).length).to.be.equal(mosaicDefinitionTransaction.size); @@ -154,7 +153,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicDefinitionTransaction.divisibility).to.be.equal(3); @@ -177,7 +176,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(mosaicDefinitionTransaction.maxFee.compact()).to.be.equal(300); @@ -193,7 +192,7 @@ describe('MosaicDefinitionTransaction', () => { MosaicFlags.create(false, false, false), 3, UInt64.fromUint(0), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/MosaicGlobalRestrictionTransaction.spec.ts b/test/model/transaction/MosaicGlobalRestrictionTransaction.spec.ts index fd468036cb..6caf2cc2de 100644 --- a/test/model/transaction/MosaicGlobalRestrictionTransaction.spec.ts +++ b/test/model/transaction/MosaicGlobalRestrictionTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { MosaicId } from '../../../src/model/mosaic/MosaicId'; @@ -39,7 +38,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { let statement: Statement; const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -64,7 +63,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { MosaicRestrictionType.EQ, UInt64.fromUint(8), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, referenceMosaicId, ); @@ -94,7 +93,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { MosaicRestrictionType.EQ, UInt64.fromUint(8), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, referenceMosaicId, ); @@ -128,7 +127,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { MosaicRestrictionType.EQ, UInt64.fromUint(8), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, namespacId, ); @@ -158,7 +157,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { MosaicRestrictionType.EQ, UInt64.fromUint(8), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, referenceMosaicId, ).setMaxFee(2); expect(mosaicGlobalRestrictionTransaction.maxFee.compact()).to.be.equal(340); @@ -169,7 +168,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { it('Test resolveAlias can resolve', () => { const mosaicGlobalRestrictionTransaction = new MosaicGlobalRestrictionTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -204,7 +203,7 @@ describe('MosaicGlobalRestrictionTransaction', () => { MosaicRestrictionType.EQ, UInt64.fromUint(8), MosaicRestrictionType.GE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, referenceMosaicId, ); diff --git a/test/model/transaction/MosaicMetadataTransaction.spec.ts b/test/model/transaction/MosaicMetadataTransaction.spec.ts index f9ef79a171..d5b8212355 100644 --- a/test/model/transaction/MosaicMetadataTransaction.spec.ts +++ b/test/model/transaction/MosaicMetadataTransaction.spec.ts @@ -33,7 +33,6 @@ import { TestingAccount } from '../../conf/conf.spec'; import { EmbeddedTransactionBuilder } from 'catbuffer-typescript'; import { Address } from '../../../src/model/account/Address'; import { TransactionType } from '../../../src/model/transaction/TransactionType'; -import { Duration } from 'js-joda'; describe('MosaicMetadataTransaction', () => { let account: Account; @@ -41,7 +40,7 @@ describe('MosaicMetadataTransaction', () => { let statement: Statement; const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -63,7 +62,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicMetadataTransaction.maxFee.higher).to.be.equal(0); @@ -78,7 +77,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -94,13 +93,13 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicMetadataTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4E8030000000000004CCCD78612DDF5CA01000A0000000000000000000000', + '80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05CE8030000000000004CCCD78612DDF5CA01000A0000000000000000000000', ); }); @@ -113,13 +112,13 @@ describe('MosaicMetadataTransaction', () => { namespacId, 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = mosaicMetadataTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4E803000000000000C51FB4C93FCA509501000A0000000000000000000000', + '80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05CE803000000000000C51FB4C93FCA509501000A0000000000000000000000', ); }); @@ -132,7 +131,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicMetadataTransaction.size).to.be.equal(182); expect(Convert.hexToUint8(mosaicMetadataTransaction.serialize()).length).to.be.equal(mosaicMetadataTransaction.size); @@ -146,7 +145,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicMetadataTransaction.size).to.be.equal(182); expect(Convert.hexToUint8(mosaicMetadataTransaction.serialize()).length).to.be.equal(mosaicMetadataTransaction.size); @@ -162,7 +161,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(mosaicMetadataTransaction.maxFee.compact()).to.be.equal(364); @@ -172,7 +171,7 @@ describe('MosaicMetadataTransaction', () => { it('Test resolveAlias can resolve', () => { const mosaicMetadataTransaction = new MosaicMetadataTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -200,7 +199,7 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(mosaicMetadataTransaction, { signer: account.publicAccount }); @@ -220,12 +219,12 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -242,12 +241,12 @@ describe('MosaicMetadataTransaction', () => { new MosaicId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, [alias]); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [wrongAlias]); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [wrongAlias]); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts b/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts index e69dfec814..066467934f 100644 --- a/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts +++ b/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { MosaicId } from '../../../src/model/mosaic/MosaicId'; @@ -39,7 +38,7 @@ describe('MosaicSupplyChangeTransaction', () => { let statement: Statement; const unresolvedMosaicId = new NamespaceId('mosaic'); const resolvedMosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -60,7 +59,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicSupplyChangeTransaction.maxFee.higher).to.be.equal(0); @@ -74,7 +73,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -89,7 +88,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicSupplyChangeTransaction.action).to.be.equal(MosaicSupplyChangeAction.Increase); @@ -113,7 +112,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicSupplyChangeTransaction.size).to.be.equal(145); expect(Convert.hexToUint8(mosaicSupplyChangeTransaction.serialize()).length).to.be.equal(mosaicSupplyChangeTransaction.size); @@ -125,7 +124,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(mosaicSupplyChangeTransaction.size).to.be.equal(145); expect(Convert.hexToUint8(mosaicSupplyChangeTransaction.serialize()).length).to.be.equal(mosaicSupplyChangeTransaction.size); @@ -140,7 +139,7 @@ describe('MosaicSupplyChangeTransaction', () => { mosaicId, MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(mosaicSupplyChangeTransaction.maxFee.compact()).to.be.equal(290); const signedTransaction = mosaicSupplyChangeTransaction.signWith(account, generationHash); @@ -149,7 +148,7 @@ describe('MosaicSupplyChangeTransaction', () => { it('Test resolveAlias can resolve', () => { const mosaicSupplyChangeTransaction = new MosaicSupplyChangeTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -173,7 +172,7 @@ describe('MosaicSupplyChangeTransaction', () => { new MosaicId([2262289484, 3405110546]), MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/MultisigAccountModificationTransaction.spec.ts b/test/model/transaction/MultisigAccountModificationTransaction.spec.ts index 5a817d2912..968ff5b7e6 100644 --- a/test/model/transaction/MultisigAccountModificationTransaction.spec.ts +++ b/test/model/transaction/MultisigAccountModificationTransaction.spec.ts @@ -24,20 +24,19 @@ import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { Address } from '../../../src/model/account/Address'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; -import { Duration } from 'js-joda'; describe('MultisigAccountModificationTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; const address1 = Address.createFromPublicKey( 'B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const address2 = Address.createFromPublicKey( 'B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -49,7 +48,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1, address2], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(modifyMultisigAccountTransaction.maxFee.higher).to.be.equal(0); @@ -63,7 +62,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1, address2], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -78,7 +77,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1, address2], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(modifyMultisigAccountTransaction.minApprovalDelta).to.be.equal(2); @@ -91,7 +90,7 @@ describe('MultisigAccountModificationTransaction', () => { const signedTransaction = modifyMultisigAccountTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '0102020000000000909FC4844A5206CFA44603EFA1FFC76FE9B0564D967FFE0D906B4CB49ECF224FC4F0F4FCA2F6034305B3A47B0BB90303', + '0102020000000000809FC4844A5206CFA44603EFA1FFC76FE9B0564D96735562806B4CB49ECF224FC4F0F4FCA2F6034305B3A47B0BB0D2C9', ); }); @@ -103,7 +102,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(modifyMultisigAccountTransaction.size).to.be.equal(160); expect(Convert.hexToUint8(modifyMultisigAccountTransaction.serialize()).length).to.be.equal( @@ -117,7 +116,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(modifyMultisigAccountTransaction.size).to.be.equal(160); expect(Convert.hexToUint8(modifyMultisigAccountTransaction.serialize()).length).to.be.equal( @@ -134,7 +133,7 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(modifyMultisigAccountTransaction.maxFee.compact()).to.be.equal(320); @@ -149,13 +148,13 @@ describe('MultisigAccountModificationTransaction', () => { 1, [address1], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = txAddition.shouldNotifyAccount(address1, []); expect(canNotify).to.be.true; - canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(txAddition, { signer: account.publicAccount }); @@ -167,13 +166,13 @@ describe('MultisigAccountModificationTransaction', () => { 1, [], [address1], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotifyDeletion = txDeletion.shouldNotifyAccount(address1, []); expect(canNotifyDeletion).to.be.true; - canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotifyDeletion).to.be.false; Object.assign(txDeletion, { signer: account.publicAccount }); @@ -189,16 +188,16 @@ describe('MultisigAccountModificationTransaction', () => { 1, [alias], [], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = txAddition.shouldNotifyAccount(address1, [alias]); expect(canNotify).to.be.true; - canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [wrongAlias]); + canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [wrongAlias]); expect(canNotify).to.be.false; - canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [alias]); + canNotify = txAddition.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [alias]); expect(canNotify).to.be.true; Object.assign(txAddition, { signer: account.publicAccount }); @@ -210,18 +209,18 @@ describe('MultisigAccountModificationTransaction', () => { 1, [], [alias], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotifyDeletion = txDeletion.shouldNotifyAccount(address1, [alias]); expect(canNotifyDeletion).to.be.true; - canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [ + canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [ wrongAlias, ]); expect(canNotifyDeletion).to.be.false; - canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [ + canNotifyDeletion = txDeletion.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [ alias, ]); expect(canNotifyDeletion).to.be.true; diff --git a/test/model/transaction/MultisigCosignatoryModification.spec.ts b/test/model/transaction/MultisigCosignatoryModification.spec.ts index 47f24f0872..b2014b0171 100644 --- a/test/model/transaction/MultisigCosignatoryModification.spec.ts +++ b/test/model/transaction/MultisigCosignatoryModification.spec.ts @@ -24,7 +24,7 @@ describe('MultisigCosignatoryModification', () => { it('should create Add MultisigCosignatoryModification', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( CosignatoryModificationAction.Add, - PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), + PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.PRIVATE_TEST), ); expect(multisigCosignatoryModification.cosignatoryPublicAccount.publicKey).to.be.equal( 'C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', @@ -35,7 +35,7 @@ describe('MultisigCosignatoryModification', () => { it('should create Add MultisigCosignatoryModification and get toDTO correctly', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( CosignatoryModificationAction.Add, - PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), + PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.PRIVATE_TEST), ).toDTO(); expect(multisigCosignatoryModification.cosignatoryPublicKey).to.be.equal( 'C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', @@ -46,7 +46,7 @@ describe('MultisigCosignatoryModification', () => { it('should create Remove MultisigCosignatoryModification', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( CosignatoryModificationAction.Remove, - PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), + PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.PRIVATE_TEST), ); expect(multisigCosignatoryModification.cosignatoryPublicAccount.publicKey).to.be.equal( 'C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', @@ -57,7 +57,7 @@ describe('MultisigCosignatoryModification', () => { it('should create Remove MultisigCosignatoryModification and get toDTO correctly', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( CosignatoryModificationAction.Remove, - PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), + PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.PRIVATE_TEST), ).toDTO(); expect(multisigCosignatoryModification.cosignatoryPublicKey).to.be.equal( 'C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', diff --git a/test/model/transaction/NamespaceMetadataTransaction.spec.ts b/test/model/transaction/NamespaceMetadataTransaction.spec.ts index e366bee763..5850a06ac1 100644 --- a/test/model/transaction/NamespaceMetadataTransaction.spec.ts +++ b/test/model/transaction/NamespaceMetadataTransaction.spec.ts @@ -27,12 +27,11 @@ import { EmbeddedTransactionBuilder } from 'catbuffer-typescript/dist/EmbeddedTr import { TransactionType } from '../../../src/model/transaction/TransactionType'; import { deepEqual } from 'assert'; import { Address } from '../../../src/model/account/Address'; -import { Duration } from 'js-joda'; describe('NamespaceMetadataTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -45,7 +44,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(namespaceMetadataTransaction.maxFee.higher).to.be.equal(0); @@ -60,7 +59,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -76,13 +75,13 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = namespaceMetadataTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA4E8030000000000004CCCD78612DDF5CA01000A0000000000000000000000', + '80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05CE8030000000000004CCCD78612DDF5CA01000A0000000000000000000000', ); }); @@ -95,7 +94,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(namespaceMetadataTransaction.size).to.be.equal(182); expect(Convert.hexToUint8(namespaceMetadataTransaction.serialize()).length).to.be.equal(namespaceMetadataTransaction.size); @@ -109,7 +108,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(namespaceMetadataTransaction.size).to.be.equal(182); expect(Convert.hexToUint8(namespaceMetadataTransaction.serialize()).length).to.be.equal(namespaceMetadataTransaction.size); @@ -125,7 +124,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(namespaceMetadataTransaction.maxFee.compact()).to.be.equal(364); @@ -141,7 +140,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(namespaceMetadataTransaction, { signer: account.publicAccount }); @@ -161,7 +160,7 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const resolved = namespaceMetadataTransaction.resolveAliases(); @@ -177,12 +176,12 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -199,12 +198,12 @@ describe('NamespaceMetadataTransaction', () => { new NamespaceId([2262289484, 3405110546]), 1, Convert.uint8ToUtf8(new Uint8Array(10)), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, [alias]); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), [wrongAlias]); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [wrongAlias]); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/NamespaceRegistrationTransaction.spec.ts b/test/model/transaction/NamespaceRegistrationTransaction.spec.ts index 244e35014f..5c499ab5dc 100644 --- a/test/model/transaction/NamespaceRegistrationTransaction.spec.ts +++ b/test/model/transaction/NamespaceRegistrationTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Convert } from '../../../src/core/format'; import { Account } from '../../../src/model/account/Account'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; @@ -28,7 +27,7 @@ import { TestingAccount } from '../../conf/conf.spec'; describe('NamespaceRegistrationTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -38,7 +37,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(registerNamespaceTransaction.maxFee.higher).to.be.equal(0); @@ -50,7 +49,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -63,7 +62,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(registerNamespaceTransaction.duration!.lower).to.be.equal(1000); @@ -81,7 +80,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', 'parent-test-namespace', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); @@ -96,7 +95,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', new NamespaceId([929036875, 2226345261]), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); @@ -112,7 +111,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(registerNamespaceTransaction.size).to.be.equal(165); expect(Convert.hexToUint8(registerNamespaceTransaction.serialize()).length).to.be.equal(registerNamespaceTransaction.size); @@ -122,7 +121,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(registerNamespaceTransaction.size).to.be.equal(165); expect(Convert.hexToUint8(registerNamespaceTransaction.serialize()).length).to.be.equal(registerNamespaceTransaction.size); @@ -135,7 +134,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(registerNamespaceTransaction.maxFee.compact()).to.be.equal(330); @@ -148,7 +147,7 @@ describe('NamespaceRegistrationTransaction', () => { Deadline.create(epochAdjustment), 'root-test-namespace', UInt64.fromUint(1000), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/NodeKeyLinkTransaction.spec.ts b/test/model/transaction/NodeKeyLinkTransaction.spec.ts index f93711619f..e6f1b01a74 100644 --- a/test/model/transaction/NodeKeyLinkTransaction.spec.ts +++ b/test/model/transaction/NodeKeyLinkTransaction.spec.ts @@ -24,12 +24,11 @@ import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { Address } from '../../../src/model/account/Address'; -import { Duration } from 'js-joda'; describe('NodeKeyLinkTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -39,7 +38,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(nodeKeyLinkTransaction.maxFee.higher).to.be.equal(0); @@ -51,7 +50,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -64,7 +63,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(nodeKeyLinkTransaction.linkAction).to.be.equal(1); @@ -82,7 +81,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(nodeKeyLinkTransaction.linkAction).to.be.equal(0); @@ -101,7 +100,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(nodeKeyLinkTransaction.serialize()).length).to.be.equal(nodeKeyLinkTransaction.size); expect(nodeKeyLinkTransaction.size).to.be.equal(161); @@ -111,7 +110,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(nodeKeyLinkTransaction.serialize()).length).to.be.equal(nodeKeyLinkTransaction.size); expect(nodeKeyLinkTransaction.size).to.be.equal(161); @@ -124,7 +123,7 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(nodeKeyLinkTransaction.maxFee.compact()).to.be.equal(322); @@ -137,12 +136,12 @@ describe('NodeKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ')); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ')); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/PersistentDelegationRequestTransaction.spec.ts b/test/model/transaction/PersistentDelegationRequestTransaction.spec.ts index 6445821b0d..fb1c2feb51 100644 --- a/test/model/transaction/PersistentDelegationRequestTransaction.spec.ts +++ b/test/model/transaction/PersistentDelegationRequestTransaction.spec.ts @@ -15,7 +15,6 @@ */ import { expect } from 'chai'; -import { Duration } from 'js-joda'; import { Account } from '../../../src/model/account/Account'; import { Address } from '../../../src/model/account/Address'; import { MessageMarker } from '../../../src/model/message/MessageMarker'; @@ -32,7 +31,7 @@ describe('PersistentDelegationRequestTransaction', () => { const recipientPublicKey = '9DBF67474D6E1F8B131B4EB1F5BA0595AFFAE1123607BC1048F342193D7E669F'; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; const messageMarker = MessageMarker.PersistentDelegationUnlock; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; @@ -44,7 +43,7 @@ describe('PersistentDelegationRequestTransaction', () => { delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(persistentDelegationRequestTransaction.maxFee.higher).to.be.equal(0); @@ -57,7 +56,7 @@ describe('PersistentDelegationRequestTransaction', () => { delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -71,7 +70,7 @@ describe('PersistentDelegationRequestTransaction', () => { delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(persistentDelegationRequestTransaction.message.payload.length).to.be.equal(248 + messageMarker.length); @@ -79,7 +78,7 @@ describe('PersistentDelegationRequestTransaction', () => { expect(persistentDelegationRequestTransaction.mosaics.length).to.be.equal(0); expect(persistentDelegationRequestTransaction.recipientAddress).to.be.instanceof(Address); expect((persistentDelegationRequestTransaction.recipientAddress as Address).plain()).to.be.equal( - 'SDBC4JE7GTJAKN2XJCQWWRJMYA35AFOYQBATXOQ', + 'QDBC4JE7GTJAKN2XJCQWWRJMYA35AFOYQBW3TJA', ); const signedTransaction = persistentDelegationRequestTransaction.signWith(account, generationHash); @@ -98,7 +97,7 @@ describe('PersistentDelegationRequestTransaction', () => { 'abc', vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); }).to.throw(); diff --git a/test/model/transaction/SecretLockTransaction.spec.ts b/test/model/transaction/SecretLockTransaction.spec.ts index b39d968bd9..6918b873bb 100644 --- a/test/model/transaction/SecretLockTransaction.spec.ts +++ b/test/model/transaction/SecretLockTransaction.spec.ts @@ -36,7 +36,6 @@ import { TransactionInfo } from '../../../src/model/transaction/TransactionInfo' import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import * as CryptoJS from 'crypto-js'; -import { Duration } from 'js-joda'; describe('SecretLockTransaction', () => { let account: Account; @@ -45,7 +44,7 @@ describe('SecretLockTransaction', () => { const unresolvedMosaicId = new NamespaceId('mosaic'); const mosaicId = new MosaicId('0DC67FBE1CAD29E5'); const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -65,7 +64,7 @@ describe('SecretLockTransaction', () => { it('should default maxFee field be set to 0', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -73,7 +72,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretLockTransaction.maxFee.higher).to.be.equal(0); @@ -82,7 +81,7 @@ describe('SecretLockTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -90,7 +89,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -100,7 +99,7 @@ describe('SecretLockTransaction', () => { it('should be created with LockHashAlgorithm: Op_Sha3_256 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -108,7 +107,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyLocal.NAMESPACE_ID.id); expect(secretLockTransaction.mosaic.amount.equals(UInt64.fromUint(10))).to.be.equal(true); @@ -120,7 +119,7 @@ describe('SecretLockTransaction', () => { it('should be created and sign SecretLock Transaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -128,18 +127,18 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = secretLockTransaction.signWith(account, generationHash); expect(signedTx.payload.substring(256, signedTx.payload.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B29B3155B37159DA50AA52D5967C509B410' + + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A9B3155B37159DA50AA52D5967C509B410' + 'F5A36A3B1E31ECB5AC76675D79B4A5E44B262C46CEABB850A00000000000000640000000000000000', ); }); it('should throw exception when the input is not related to HashTyp: Op_Sha3_256', () => { expect(() => { - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -147,14 +146,14 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, 'non valid hash', recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); it('should be created with LockHashAlgorithm: Op_Hash_160 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -162,7 +161,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_160, CryptoJS.RIPEMD160(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyLocal.NAMESPACE_ID.id); expect(secretLockTransaction.mosaic.amount.equals(UInt64.fromUint(10))).to.be.equal(true); @@ -174,7 +173,7 @@ describe('SecretLockTransaction', () => { it('should throw exception when the input is not related to HashTyp: Op_Hash_160', () => { expect(() => { - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -182,13 +181,13 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_160, 'non valid hash', recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); it('should be created with LockHashAlgorithm: Op_Hash_256 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -196,7 +195,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_256, CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyLocal.NAMESPACE_ID.id); expect(secretLockTransaction.mosaic.amount.equals(UInt64.fromUint(10))).to.be.equal(true); @@ -208,7 +207,7 @@ describe('SecretLockTransaction', () => { it('should throw exception when the input is not related to HashTyp: Op_Hash_256', () => { expect(() => { - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -216,7 +215,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_256, 'non valid hash', recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); @@ -224,7 +223,7 @@ describe('SecretLockTransaction', () => { describe('size', () => { it('should return 209 for SecretLockTransaction with proof of 32 bytes', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -232,7 +231,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_256, CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretLockTransaction.size).to.be.equal(209); expect(Convert.hexToUint8(secretLockTransaction.serialize()).length).to.be.equal(secretLockTransaction.size); @@ -240,7 +239,7 @@ describe('SecretLockTransaction', () => { it('should set payload size', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -248,7 +247,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Hash_256, CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretLockTransaction.size).to.be.equal(209); expect(Convert.hexToUint8(secretLockTransaction.serialize()).length).to.be.equal(secretLockTransaction.size); @@ -266,7 +265,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyLocal.NAMESPACE_ID.id); expect(secretLockTransaction.mosaic.amount.equals(UInt64.fromUint(10))).to.be.equal(true); @@ -278,7 +277,7 @@ describe('SecretLockTransaction', () => { it('Test set maxFee using multiplier', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -286,7 +285,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(secretLockTransaction.maxFee.compact()).to.be.equal(418); const signedTransaction = secretLockTransaction.signWith(account, generationHash); @@ -296,7 +295,7 @@ describe('SecretLockTransaction', () => { it('Test resolveAlias can resolve', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; const secretLockTransaction = new SecretLockTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -320,7 +319,7 @@ describe('SecretLockTransaction', () => { it('Notify Account', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipientAddress = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const recipientAddress = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const tx = SecretLockTransaction.create( Deadline.create(epochAdjustment), NetworkCurrencyLocal.createAbsolute(10), @@ -328,12 +327,12 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(recipientAddress, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -350,7 +349,7 @@ describe('SecretLockTransaction', () => { LockHashAlgorithm.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).shouldNotifyAccount(account.address, [namespaceId]); expect(canNotify).to.be.true; }); diff --git a/test/model/transaction/SecretProofTransaction.spec.ts b/test/model/transaction/SecretProofTransaction.spec.ts index a1c37a0834..3c1d017258 100644 --- a/test/model/transaction/SecretProofTransaction.spec.ts +++ b/test/model/transaction/SecretProofTransaction.spec.ts @@ -34,14 +34,13 @@ import { TestingAccount } from '../../conf/conf.spec'; import { EmbeddedTransactionBuilder } from 'catbuffer-typescript/dist/EmbeddedTransactionBuilder'; import { TransactionType } from '../../../src/model/transaction/TransactionType'; import * as CryptoJS from 'crypto-js'; -import { Duration } from 'js-joda'; describe('SecretProofTransaction', () => { let account: Account; let statement: Statement; const unresolvedAddress = new NamespaceId('address'); const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; statement = new Statement( @@ -63,7 +62,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.maxFee.higher).to.be.equal(0); @@ -78,7 +77,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -94,7 +93,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.hashAlgorithm).to.be.equal(0); expect(secretProofTransaction.secret).to.be.equal('9b3155b37159da50aa52d5967c509b410f5a36a3b1e31ecb5ac76675d79b4a5e'); @@ -110,7 +109,7 @@ describe('SecretProofTransaction', () => { 'non valid hash', account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); @@ -123,7 +122,7 @@ describe('SecretProofTransaction', () => { CryptoJS.RIPEMD160(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.hashAlgorithm).to.be.equal(1); expect(secretProofTransaction.secret).to.be.equal('3fc43d717d824302e3821de8129ea2f7786912e5'); @@ -139,7 +138,7 @@ describe('SecretProofTransaction', () => { 'non valid hash', account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); @@ -152,7 +151,7 @@ describe('SecretProofTransaction', () => { CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.hashAlgorithm).to.be.equal(2); expect(secretProofTransaction.secret).to.be.equal('c346f5ecf5bcfa54ab14fad815c8239bdeb051df8835d212dba2af59f688a00e'); @@ -168,7 +167,7 @@ describe('SecretProofTransaction', () => { 'non valid hash', account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error); }); @@ -182,7 +181,7 @@ describe('SecretProofTransaction', () => { CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.size).to.be.equal(219); expect(Convert.hexToUint8(secretProofTransaction.serialize()).length).to.be.equal(secretProofTransaction.size); @@ -197,13 +196,13 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const signedTx = secretProofTransaction.signWith(account, generationHash); expect(signedTx.payload.substring(256, signedTx.payload.length)).to.be.equal( - '90D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1204EA49B3155B37159DA50AA52D5967C509B410F5A36A3B1E31ECB5AC7667' + - '5D79B4A5E200000B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7', + '80D66C33420E5411995BACFCA2B28CF1C9F5DD7AB1A9C05C9B3155B37159DA50AA52D5967C509B410F5A' + + '36A3B1E31ECB5AC76675D79B4A5E200000B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7', ); }); @@ -216,7 +215,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), recipientAddress, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(secretProofTransaction.hashAlgorithm).to.be.equal(0); expect(secretProofTransaction.secret).to.be.equal('9b3155b37159da50aa52d5967c509b410f5a36a3b1e31ecb5ac76675d79b4a5e'); @@ -232,7 +231,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(secretProofTransaction.maxFee.compact()).to.be.equal(438); const signedTransaction = secretProofTransaction.signWith(account, generationHash); @@ -242,7 +241,7 @@ describe('SecretProofTransaction', () => { it('Test resolveAlias can resolve', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; const transferTransaction = new SecretProofTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -264,7 +263,7 @@ describe('SecretProofTransaction', () => { it('should create EmbeddedTransactionBuilder', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; const secretProofTransaction = new SecretProofTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -293,7 +292,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const secretBytes = secretProofTransaction.getSecretByte(); expect(secretBytes).not.to.be.undefined; @@ -308,12 +307,12 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -329,7 +328,7 @@ describe('SecretProofTransaction', () => { sha3_256.create().update(convert.hexToUint8(proof)).hex(), account.address, proof, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).shouldNotifyAccount(account.address, [namespaceId]); expect(canNotify).to.be.true; }); diff --git a/test/model/transaction/SignedTransaction.spec.ts b/test/model/transaction/SignedTransaction.spec.ts index b5dbb57468..decf958ebf 100644 --- a/test/model/transaction/SignedTransaction.spec.ts +++ b/test/model/transaction/SignedTransaction.spec.ts @@ -32,7 +32,7 @@ describe('SignedTransaction', () => { '07901DA8A8AFE1DFB76D1A079B8E785C1186BAF2C5B98227B62BDE2C77D79481', 'C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357ACB041E2F9AB402EFE', TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(signedTransaction.type).to.be.equal(TransactionType.TRANSFER); }); @@ -48,7 +48,7 @@ describe('SignedTransaction', () => { '231AA7700DC158CFC85606E0E2AC80F409923C6F3A845577C7D8D7A51A99E883', 'C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357ACB041E2F9AB402EFE', TransactionType.AGGREGATE_COMPLETE, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(signedTransaction.type).to.be.equal(TransactionType.AGGREGATE_COMPLETE); }); @@ -60,7 +60,7 @@ describe('SignedTransaction', () => { ].forEach((item) => { it("throws exception if string hasn't 64 character long", () => { expect(() => { - new SignedTransaction('', item, publicKey, TransactionType.AGGREGATE_BONDED, NetworkType.MIJIN_TEST); + new SignedTransaction('', item, publicKey, TransactionType.AGGREGATE_BONDED, NetworkType.PRIVATE_TEST); }).to.throw(Error); }); }); diff --git a/test/model/transaction/Transaction.spec.ts b/test/model/transaction/Transaction.spec.ts index c4a983f095..5fee48729c 100644 --- a/test/model/transaction/Transaction.spec.ts +++ b/test/model/transaction/Transaction.spec.ts @@ -32,11 +32,10 @@ import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; -import { Duration } from 'js-joda'; describe('Transaction', () => { let account: Account; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -75,7 +74,7 @@ describe('Transaction', () => { it('should return true when there is no Transaction Info', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -91,7 +90,7 @@ describe('Transaction', () => { it('should return true when height is 0', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -105,7 +104,7 @@ describe('Transaction', () => { it('should return false when height is not 0', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -121,7 +120,7 @@ describe('Transaction', () => { it('should return true when height is not 0', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -137,7 +136,7 @@ describe('Transaction', () => { it('should return false when height is 0 and hash and markehash are different', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -153,7 +152,7 @@ describe('Transaction', () => { it('should throw an error if the transaction is announced', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -168,7 +167,7 @@ describe('Transaction', () => { it('should return a new transaction', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -182,7 +181,7 @@ describe('Transaction', () => { it('should overide deadline properly', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -204,7 +203,7 @@ describe('Transaction', () => { it('should throw exception when adding an aggregated transaction as inner transaction', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -215,7 +214,7 @@ describe('Transaction', () => { const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -229,15 +228,15 @@ describe('Transaction', () => { it('Should return serialized payload', () => { const transaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const serialized = transaction.serialize(); expect(serialized.substring(256, serialized.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0000000000000000746573742D6D657373616765', + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0000000000000000746573742D6D657373616765', ); }); }); @@ -246,7 +245,7 @@ describe('Transaction', () => { it('should return version in hex format', () => { const transaction = new FakeTransaction( TransactionType.TRANSFER, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.create(epochAdjustment), UInt64.fromUint(0), @@ -254,7 +253,7 @@ describe('Transaction', () => { undefined, new TransactionInfo(UInt64.fromUint(100), 1, 'id_hash', 'hash', 'hash'), ); - expect(transaction.versionToHex()).to.be.equal('0x9001'); + expect(transaction.versionToHex()).to.be.equal('0x8001'); }); }); @@ -271,10 +270,10 @@ describe('Transaction', () => { '0801000000000000AC1F3E0EE2C16F465CDC2E091DC44D6EB55F7FE3988A5F21' + '309DF479BE6D3F0033E155695FB1133EA0EA64A67C1EDC2B430CFAF9722AF36B' + 'AE84DBDB1C8F1509C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357AC' + - 'B041E2F9AB402EFE000000000190414200000000000000006BA50FB91A000000' + + 'B041E2F9AB402EFE000000000180414200000000000000006BA50FB91A000000' + 'EA8F8301E7EDFD701F62E1DC1601ABDE22E5FCD11C9C7E7A01B87F8DFB6B62B0' + '60000000000000005D00000000000000C2F93346E27CE6AD1A9F8F5E3066F832' + - '6593A406BDF357ACB041E2F9AB402EFE00000000019054419050B9837EFAB4BB' + + '6593A406BDF357ACB041E2F9AB402EFE00000000018054419050B9837EFAB4BB' + 'E8A4B9BB32D812F9885C00D8FC1650E142000D000000000000746573742D6D65' + '7373616765000000'; @@ -343,7 +342,7 @@ describe('Transaction', () => { expect(hash1).to.equal(hash2); }); - it('create correct SHA3 transaction hash given network type MIJIN or MIJIN_TEST', () => { + it('create correct SHA3 transaction hash given network type PRIVATE or PRIVATE_TEST', () => { const hash1 = Transaction.createTransactionHash(knownPayload, generationHashBytes); const hash2 = Transaction.createTransactionHash(knownPayload, generationHashBytes); @@ -380,16 +379,16 @@ describe('Transaction', () => { it('is signed', () => { let tx = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ) as Transaction; expect(tx.isSigned(account.address)).to.be.false; const signed = tx.signWith(account, '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'); tx = TransactionMapping.createFromPayload(signed.payload) as Transaction; expect((tx as Transaction).isSigned(account.address)).to.be.true; - expect((tx as Transaction).isSigned(Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'))).to.be.false; + expect((tx as Transaction).isSigned(Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'))).to.be.false; }); }); diff --git a/test/model/transaction/TransactionStatusError.spec.ts b/test/model/transaction/TransactionStatusError.spec.ts index 62f4daa941..250ad2eff8 100644 --- a/test/model/transaction/TransactionStatusError.spec.ts +++ b/test/model/transaction/TransactionStatusError.spec.ts @@ -24,7 +24,7 @@ import { UInt64 } from '../../../src/model/UInt64'; describe('TransactionStatusError', () => { it('should createComplete an TransactionStatusError object', () => { const statusInfoErrorDTO = { - address: Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + address: Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), deadline: '1010', hash: 'transaction-hash', code: 'error-message', diff --git a/test/model/transaction/TransferTransaction.spec.ts b/test/model/transaction/TransferTransaction.spec.ts index 0fdab15185..cdf180f7c6 100644 --- a/test/model/transaction/TransferTransaction.spec.ts +++ b/test/model/transaction/TransferTransaction.spec.ts @@ -39,7 +39,6 @@ import { ResolutionType } from '../../../src/model/receipt/ResolutionType'; import { ReceiptSource } from '../../../src/model/receipt/ReceiptSource'; import { ResolutionEntry } from '../../../src/model/receipt/ResolutionEntry'; import { TransactionInfo } from '../../../src/model/transaction/TransactionInfo'; -import { Duration } from 'js-joda'; describe('TransferTransaction', () => { let account: Account; @@ -52,7 +51,7 @@ describe('TransferTransaction', () => { const unresolvedAddress = new NamespaceId('address'); const unresolvedMosaicId = new NamespaceId('mosaic'); const mosaicId = new MosaicId('0DC67FBE1CAD29E5'); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; }); @@ -76,10 +75,10 @@ describe('TransferTransaction', () => { it('should default maxFee field be set to 0', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.maxFee.higher).to.be.equal(0); @@ -89,10 +88,10 @@ describe('TransferTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -103,63 +102,63 @@ describe('TransferTransaction', () => { it('should createComplete an TransferTransaction object and sign it without mosaics', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(0); expect(transferTransaction.recipientAddress).to.be.instanceof(Address); - expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0000000000000000746573742D6D657373616765', + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0000000000000000746573742D6D657373616765', ); }); it('should createComplete an TransferTransaction object with empty message', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], EmptyMessage, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload).to.be.equal(''); expect(transferTransaction.mosaics.length).to.be.equal(0); expect(transferTransaction.recipientAddress).to.be.instanceof(Address); - expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20000000000000000', + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0000000000000000', ); }); it('should createComplete an TransferTransaction object and sign it with mosaics', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(1); expect(transferTransaction.recipientAddress).to.be.instanceof(Address); - expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0001000000000044B262C46CEABB8500E1F' + + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0001000000000044B262C46CEABB8500E1F' + '5050000000000746573742D6D657373616765', ); }); @@ -171,7 +170,7 @@ describe('TransferTransaction', () => { addressAlias, [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload).to.be.equal('test-message'); @@ -183,7 +182,7 @@ describe('TransferTransaction', () => { const signedTransaction = transferTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '9151776168D24257D80000000000000000000000000000000D0001000000000044B262C46CEABB8500E1' + + '8151776168D24257D80000000000000000000000000000000D0001000000000044B262C46CEABB8500E1' + 'F5050000000000746573742D6D657373616765', ); }); @@ -191,18 +190,18 @@ describe('TransferTransaction', () => { it('should format TransferTransaction payload with 24 bytes binary address', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); // test recipientToString with Address recipient - expect(transferTransaction.recipientToString()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect(transferTransaction.recipientToString()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); - expect(signedTransaction.payload.substring(256, 306)).to.be.equal('9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D'); + expect(signedTransaction.payload.substring(256, 306)).to.be.equal('8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D'); }); it('should format TransferTransaction payload with 8 bytes binary namespaceId', () => { @@ -211,7 +210,7 @@ describe('TransferTransaction', () => { new NamespaceId('nem.owner'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); // test recipientToString with NamespaceId recipient @@ -219,17 +218,17 @@ describe('TransferTransaction', () => { const signedTransaction = transferTransaction.signWith(account, generationHash); - expect(signedTransaction.payload.substring(256, 306)).to.be.equal('9151776168D24257D80000000000000000000000000000000D'); + expect(signedTransaction.payload.substring(256, 306)).to.be.equal('8151776168D24257D80000000000000000000000000000000D'); }); describe('size', () => { it('should return 180 for TransferTransaction with 1 mosaic and message NEM', () => { const transaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(transaction.serialize()).length).to.be.equal(transaction.size); expect(transaction.size).to.be.equal(180); @@ -238,10 +237,10 @@ describe('TransferTransaction', () => { it('should set payloadsize', () => { const transaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(transaction.serialize()).length).to.be.equal(transaction.size); expect(transaction.size).to.be.equal(180); @@ -252,21 +251,21 @@ describe('TransferTransaction', () => { it('should create TransferTransaction and sign using catbuffer-typescript', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(1); expect(transferTransaction.recipientAddress).to.be.instanceof(Address); - expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); expect(signedTransaction.payload.substring(256, signedTransaction.payload.length)).to.be.equal( - '9026D27E1D0A26CA4E316F901E23E55C8711DB20DF11A7B20D0001000000000044B262C46CEABB8500E1F' + + '8026D27E1D0A26CA4E316F901E23E55C8711DB20DFBE8F3A0D0001000000000044B262C46CEABB8500E1F' + '5050000000000746573742D6D657373616765', ); }); @@ -274,10 +273,10 @@ describe('TransferTransaction', () => { it('should create Transafer transaction for persistent harvesting delegation request transaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], - PersistentHarvestingDelegationMessage.create(delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, NetworkType.MIJIN_TEST), - NetworkType.MIJIN_TEST, + PersistentHarvestingDelegationMessage.create(delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, NetworkType.PRIVATE_TEST), + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.type).to.be.equal(MessageType.PersistentHarvestingDelegationMessage); @@ -286,16 +285,16 @@ describe('TransferTransaction', () => { it('should createComplete an persistentDelegationRequestTransaction object and sign it', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], - PersistentHarvestingDelegationMessage.create(delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, NetworkType.MIJIN_TEST), - NetworkType.MIJIN_TEST, + PersistentHarvestingDelegationMessage.create(delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, NetworkType.PRIVATE_TEST), + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.message.payload.length).to.be.equal(248 + messageMarker.length); expect(transferTransaction.message.payload.includes(messageMarker)).to.be.true; expect(transferTransaction.mosaics.length).to.be.equal(0); expect(transferTransaction.recipientAddress).to.be.instanceof(Address); - expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -307,15 +306,15 @@ describe('TransferTransaction', () => { expect(() => { TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PersistentHarvestingDelegationMessage.create( delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(Error, 'PersistentDelegationRequestTransaction should be created without Mosaic'); }); @@ -324,10 +323,10 @@ describe('TransferTransaction', () => { expect(() => { TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], - PersistentHarvestingDelegationMessage.create('abc', vrfPrivateKey, recipientPublicKey, NetworkType.MIJIN_TEST), - NetworkType.MIJIN_TEST, + PersistentHarvestingDelegationMessage.create('abc', vrfPrivateKey, recipientPublicKey, NetworkType.PRIVATE_TEST), + NetworkType.PRIVATE_TEST, ); }).to.throw(); }); @@ -336,15 +335,15 @@ describe('TransferTransaction', () => { expect(() => { TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createRelative(100)], PersistentHarvestingDelegationMessage.create( delegatedPrivateKey, vrfPrivateKey, recipientPublicKey, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); }).to.throw(); }); @@ -357,10 +356,10 @@ describe('TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), mosaics, PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.mosaics[0].id.id.compact()).to.be.equal(200); @@ -386,10 +385,10 @@ describe('TransferTransaction', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), mosaics, PlainMessage.create('NEM'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(transferTransaction.mosaics[0].id.toHex()).to.be.equal('D525AD41D95FCF29'); @@ -410,7 +409,7 @@ describe('TransferTransaction', () => { namespaceId, [NetworkCurrencyLocal.createAbsolute(1)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const payload = transferTransaction.serialize(); const newTransaction = CreateTransactionFromPayload(payload) as TransferTransaction; @@ -422,10 +421,10 @@ describe('TransferTransaction', () => { it('Test set maxFee using multiplier', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createAbsolute(1)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(transferTransaction.maxFee.compact()).to.be.equal(378); @@ -436,17 +435,17 @@ describe('TransferTransaction', () => { it('Test set maxFee using multiplier to throw', () => { const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [NetworkCurrencyLocal.createAbsolute(1)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(() => { AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ).setMaxFee(2); }).to.throw(); @@ -454,7 +453,7 @@ describe('TransferTransaction', () => { it('Test resolveAlias can resolve', () => { const transferTransaction = new TransferTransaction( - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 1, Deadline.createFromDTO('1'), UInt64.fromUint(0), @@ -475,18 +474,18 @@ describe('TransferTransaction', () => { }); it('Notify Account', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const tx = TransferTransaction.create( Deadline.create(epochAdjustment), address, [NetworkCurrencyLocal.createAbsolute(1)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(address, []); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY'), []); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY'), []); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); @@ -494,14 +493,14 @@ describe('TransferTransaction', () => { }); it('Notify Account with alias', () => { - const address = Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'); + const address = Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'); const namespaceId = new NamespaceId('test'); const canNotify = TransferTransaction.create( Deadline.create(epochAdjustment), namespaceId, [NetworkCurrencyLocal.createAbsolute(1)], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).shouldNotifyAccount(address, [namespaceId]); expect(canNotify).to.be.true; }); diff --git a/test/model/transaction/VotingKeyLinkTransaction.spec.ts b/test/model/transaction/VotingKeyLinkTransaction.spec.ts index 66268b5415..e72bfd6681 100644 --- a/test/model/transaction/VotingKeyLinkTransaction.spec.ts +++ b/test/model/transaction/VotingKeyLinkTransaction.spec.ts @@ -24,7 +24,6 @@ import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { Address } from '../../../src/model/account/Address'; -import { Duration } from 'js-joda'; describe('VotingKeyLinkTransaction', () => { let account: Account; @@ -32,7 +31,7 @@ describe('VotingKeyLinkTransaction', () => { const startEpoch = 1; const endEpoch = 10; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; before(() => { account = TestingAccount; votingKey = '344B9146A1F8DBBD8AFC830A2AAB7A83692E73AD775159B811355B1D2C0C27120243B10A16D4B5001B2AF0ED456C82D0'; @@ -45,7 +44,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(votingKeyLinkTransaction.maxFee.higher).to.be.equal(0); @@ -61,7 +60,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -78,7 +77,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(votingKeyLinkTransaction.linkAction).to.be.equal(1); @@ -100,7 +99,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(votingKeyLinkTransaction.linkAction).to.be.equal(0); @@ -123,7 +122,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(votingKeyLinkTransaction.serialize()).length).to.be.equal(votingKeyLinkTransaction.size); expect(votingKeyLinkTransaction.size).to.be.equal(185); @@ -137,7 +136,7 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(votingKeyLinkTransaction.maxFee.compact()).to.be.equal(370); @@ -152,12 +151,12 @@ describe('VotingKeyLinkTransaction', () => { startEpoch, endEpoch, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY')); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY')); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/transaction/VrfKeyLinkTransaction.spec.ts b/test/model/transaction/VrfKeyLinkTransaction.spec.ts index d623afa913..9cf82fc19f 100644 --- a/test/model/transaction/VrfKeyLinkTransaction.spec.ts +++ b/test/model/transaction/VrfKeyLinkTransaction.spec.ts @@ -24,7 +24,6 @@ import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { UInt64 } from '../../../src/model/UInt64'; import { TestingAccount } from '../../conf/conf.spec'; import { Address } from '../../../src/model/account/Address'; -import { Duration } from 'js-joda'; describe('VrfKeyLinkTransaction', () => { let account: Account; @@ -32,14 +31,14 @@ describe('VrfKeyLinkTransaction', () => { before(() => { account = TestingAccount; }); - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; it('should default maxFee field be set to 0', () => { const vrfKeyLinkTransaction = VrfKeyLinkTransaction.create( Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(vrfKeyLinkTransaction.maxFee.higher).to.be.equal(0); @@ -51,7 +50,7 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, new UInt64([1, 0]), ); @@ -64,7 +63,7 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Link, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(vrfKeyLinkTransaction.linkAction).to.be.equal(1); @@ -82,7 +81,7 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(vrfKeyLinkTransaction.linkAction).to.be.equal(0); @@ -101,7 +100,7 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); expect(Convert.hexToUint8(vrfKeyLinkTransaction.serialize()).length).to.be.equal(vrfKeyLinkTransaction.size); expect(vrfKeyLinkTransaction.size).to.be.equal(161); @@ -113,7 +112,7 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ).setMaxFee(2); expect(vrfKeyLinkTransaction.maxFee.compact()).to.be.equal(322); @@ -126,12 +125,12 @@ describe('VrfKeyLinkTransaction', () => { Deadline.create(epochAdjustment), account.publicKey, LinkAction.Unlink, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let canNotify = tx.shouldNotifyAccount(account.address); expect(canNotify).to.be.true; - canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('SDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL2Z5UYYY')); + canNotify = tx.shouldNotifyAccount(Address.createFromRawAddress('QDR6EW2WBHJQDYMNGFX2UBZHMMZC5PGL22JZIXY')); expect(canNotify).to.be.false; Object.assign(tx, { signer: account.publicAccount }); diff --git a/test/model/wallet/SimpleWallet.spec.ts b/test/model/wallet/SimpleWallet.spec.ts index 1a4475696d..ae72a40149 100644 --- a/test/model/wallet/SimpleWallet.spec.ts +++ b/test/model/wallet/SimpleWallet.spec.ts @@ -22,30 +22,40 @@ import { SimpleWallet } from '../../../src/model/wallet/SimpleWallet'; describe('SimpleWallet', () => { it('should create a new simple wallet', () => { - const simpleWallet = SimpleWallet.create('wallet-name', new Password('password'), NetworkType.MIJIN_TEST); + const simpleWallet = SimpleWallet.create('wallet-name', new Password('password'), NetworkType.PRIVATE_TEST); expect(simpleWallet.name).to.be.equal('wallet-name'); - expect(simpleWallet.networkType).to.be.equal(NetworkType.MIJIN_TEST); + expect(simpleWallet.networkType).to.be.equal(NetworkType.PRIVATE_TEST); expect(simpleWallet.schema).to.be.equal('simple_v2'); }); it('should create a new wallet with privateKey', () => { const privateKey = '5149a02ca2b2610138376717daaff8477f1639796aa108b7eee83e99e585b250'; - const account = Account.createFromPrivateKey(privateKey, NetworkType.MIJIN_TEST); - const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', new Password('password'), privateKey, NetworkType.MIJIN_TEST); + const account = Account.createFromPrivateKey(privateKey, NetworkType.PRIVATE_TEST); + const simpleWallet = SimpleWallet.createFromPrivateKey( + 'wallet-name', + new Password('password'), + privateKey, + NetworkType.PRIVATE_TEST, + ); expect(simpleWallet.name).to.be.equal('wallet-name'); - expect(simpleWallet.networkType).to.be.equal(NetworkType.MIJIN_TEST); + expect(simpleWallet.networkType).to.be.equal(NetworkType.PRIVATE_TEST); expect(simpleWallet.address.plain()).to.be.equal(account.address.plain()); }); it('should open a new simple wallet', () => { - const simpleWallet = SimpleWallet.create('wallet-name', new Password('password'), NetworkType.MIJIN_TEST); + const simpleWallet = SimpleWallet.create('wallet-name', new Password('password'), NetworkType.PRIVATE_TEST); const account = simpleWallet.open(new Password('password')); expect(account.address.plain()).to.be.equal(simpleWallet.address.plain()); }); it('should open a new simple wallet created from private key', () => { const privateKey = '5149a02ca2b2610138376717daaff8477f1639796aa108b7eee83e99e585b250'; - const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', new Password('password'), privateKey, NetworkType.MIJIN_TEST); + const simpleWallet = SimpleWallet.createFromPrivateKey( + 'wallet-name', + new Password('password'), + privateKey, + NetworkType.PRIVATE_TEST, + ); const account = simpleWallet.open(new Password('password')); expect(simpleWallet.address.plain()).to.be.equal(account.address.plain()); }); @@ -53,7 +63,7 @@ describe('SimpleWallet', () => { it('should open a simple wallet from a simple wallet without prototype', () => { const privateKey = '5149a02ca2b2610138376717daaff8477f1639796aa108b7eee83e99e585b250'; const password = new Password('password'); - const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', password, privateKey, NetworkType.MIJIN_TEST); + const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', password, privateKey, NetworkType.PRIVATE_TEST); const account = simpleWallet.open(new Password('password')); const simpleWalletNoProto = JSON.parse(JSON.stringify(simpleWallet)); const simpleWallet2 = SimpleWallet.createFromDTO(simpleWalletNoProto); @@ -64,7 +74,7 @@ describe('SimpleWallet', () => { it('should create a simple wallet DTO', () => { const privateKey = '5149a02ca2b2610138376717daaff8477f1639796aa108b7eee83e99e585b250'; const password = new Password('password'); - const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', password, privateKey, NetworkType.MIJIN_TEST); + const simpleWallet = SimpleWallet.createFromPrivateKey('wallet-name', password, privateKey, NetworkType.PRIVATE_TEST); const simpleWalletDTO = simpleWallet.toDTO(); expect(simpleWalletDTO).to.deep.equal(JSON.parse(JSON.stringify(simpleWallet))); }); diff --git a/test/service/AggregateTransactionService.spec.ts b/test/service/AggregateTransactionService.spec.ts index b49a93307c..b71dc1c882 100644 --- a/test/service/AggregateTransactionService.spec.ts +++ b/test/service/AggregateTransactionService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { ChronoUnit, Duration } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { MultisigRepository } from '../../src/infrastructure/MultisigRepository'; @@ -62,36 +62,36 @@ describe('AggregateTransactionService', () => { const account1 = Account.createFromPrivateKey( '82DB2528834C9926F0FCCE042466B24A266F5B685CB66D2869AF6648C043E950', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const multisig1 = Account.createFromPrivateKey( '8B0622C2CCFC5CCC5A74B500163E3C68F3AD3643DB12932FC931143EAC67280D', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const multisig2 = Account.createFromPrivateKey( '22A1D67F8519D1A45BD7116600BB6E857786E816FE0B45E4C5B9FFF3D64BC177', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const multisig3 = Account.createFromPrivateKey( '5E7812AB0E709ABC45466034E1A209099F6A12C4698748A63CDCAA9B0DDE1DBD', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const account2 = Account.createFromPrivateKey( 'A4D410270E01CECDCDEADCDE32EC79C8D9CDEA4DCD426CB1EB666EFEF148FBCE', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const account3 = Account.createFromPrivateKey( '336AB45EE65A6AFFC0E7ADC5342F91E34BACA0B901A1D9C876FA25A1E590077E', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const account4 = Account.createFromPrivateKey( '4D8B3756592532753344E11E2B7541317BCCFBBCF4444274CDBF359D2C4AE0F1', - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; function givenMultisig2AccountInfo(): MultisigAccountInfo { return new MultisigAccountInfo(multisig2.address, 2, 1, [multisig1.address, account1.address], []); @@ -190,16 +190,16 @@ describe('AggregateTransactionService', () => { */ const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig2.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -223,16 +223,16 @@ describe('AggregateTransactionService', () => { */ const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig2.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -256,16 +256,16 @@ describe('AggregateTransactionService', () => { */ const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig2.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -293,7 +293,7 @@ describe('AggregateTransactionService', () => { account2.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransaction2 = TransferTransaction.create( @@ -301,13 +301,13 @@ describe('AggregateTransactionService', () => { account2.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig2.publicAccount), transferTransaction2.toAggregate(account4.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4], generationHash); @@ -334,7 +334,7 @@ describe('AggregateTransactionService', () => { account2.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransaction2 = TransferTransaction.create( @@ -342,13 +342,13 @@ describe('AggregateTransactionService', () => { account2.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig2.publicAccount), transferTransaction2.toAggregate(account4.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(account1, [account4, account2], generationHash); @@ -373,13 +373,13 @@ describe('AggregateTransactionService', () => { 1, [], [account1.address], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [modifyMultisigTransaction.toAggregate(multisig2.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const signedTransaction = aggregateTransaction.signWith(account2, generationHash); @@ -400,16 +400,16 @@ describe('AggregateTransactionService', () => { */ const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account4.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -432,16 +432,16 @@ describe('AggregateTransactionService', () => { */ const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account4.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -473,7 +473,7 @@ describe('AggregateTransactionService', () => { account1.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransaction2 = TransferTransaction.create( @@ -481,13 +481,13 @@ describe('AggregateTransactionService', () => { account4.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account4.publicAccount), transferTransaction2.toAggregate(account1.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -518,7 +518,7 @@ describe('AggregateTransactionService', () => { account1.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const transferTransaction2 = TransferTransaction.create( @@ -526,13 +526,13 @@ describe('AggregateTransactionService', () => { account4.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account4.publicAccount), transferTransaction2.toAggregate(account1.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -556,13 +556,13 @@ describe('AggregateTransactionService', () => { account4.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig3.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -586,13 +586,13 @@ describe('AggregateTransactionService', () => { account4.address, [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(multisig3.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); diff --git a/test/service/BlockService.spec.ts b/test/service/BlockService.spec.ts index 12d194fe83..3d0fcaa94c 100644 --- a/test/service/BlockService.spec.ts +++ b/test/service/BlockService.spec.ts @@ -55,7 +55,7 @@ describe('BlockService', () => { 1, 'signature', account.publicAccount, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 0, 0, UInt64.fromUint(1), @@ -84,7 +84,7 @@ describe('BlockService', () => { 1, 'signature', account.publicAccount, - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, 0, 0, UInt64.fromUint(1), diff --git a/test/service/MetadataTransactionservice.spec.ts b/test/service/MetadataTransactionservice.spec.ts index 907ea7e41a..ee7d5317b1 100644 --- a/test/service/MetadataTransactionservice.spec.ts +++ b/test/service/MetadataTransactionservice.spec.ts @@ -35,7 +35,6 @@ import { UInt64 } from '../../src/model/UInt64'; import { MetadataTransactionService } from '../../src/service/MetadataTransactionService'; import { TestingAccount } from '../conf/conf.spec'; import { Page } from '../../src/infrastructure/Page'; -import { Duration } from 'js-joda'; describe('MetadataTransactionService', () => { let account: Account; @@ -44,7 +43,7 @@ describe('MetadataTransactionService', () => { const value = 'TEST'; const deltaValue = 'dalta'; const targetIdHex = '941299B2B7E1291C'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; function mockMetadata(type: MetadataType): Metadata { let targetId; @@ -114,7 +113,7 @@ describe('MetadataTransactionService', () => { metadataTransactionService .createAccountMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, key, value + deltaValue, @@ -137,7 +136,7 @@ describe('MetadataTransactionService', () => { metadataTransactionService .createMosaicMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, new MosaicId(targetIdHex), key, @@ -162,7 +161,7 @@ describe('MetadataTransactionService', () => { metadataTransactionService .createNamespaceMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, NamespaceId.createFromEncoded(targetIdHex), key, @@ -197,7 +196,7 @@ describe('MetadataTransactionService', () => { expect(() => { metadataTransactionService.createAccountMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, key, value + deltaValue, @@ -221,7 +220,7 @@ describe('MetadataTransactionService', () => { expect(() => { metadataTransactionService.createMosaicMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, new MosaicId(targetIdHex), key, @@ -246,7 +245,7 @@ describe('MetadataTransactionService', () => { expect(() => { metadataTransactionService.createNamespaceMetadataTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, account.address, NamespaceId.createFromEncoded(targetIdHex), key, diff --git a/test/service/MosaicRestrictionTransactionservice.spec.ts b/test/service/MosaicRestrictionTransactionservice.spec.ts index c177c9dfbf..2c9023b747 100644 --- a/test/service/MosaicRestrictionTransactionservice.spec.ts +++ b/test/service/MosaicRestrictionTransactionservice.spec.ts @@ -37,7 +37,6 @@ import { UInt64 } from '../../src/model/UInt64'; import { MosaicRestrictionTransactionService } from '../../src/service/MosaicRestrictionTransactionService'; import { TestingAccount } from '../conf/conf.spec'; import { Page } from '../../src/infrastructure/Page'; -import { Duration } from 'js-joda'; describe('MosaicRestrictionTransactionService', () => { let account: Account; @@ -52,7 +51,7 @@ describe('MosaicRestrictionTransactionService', () => { const globalRestrictionValue = '1000'; const globalRestrictionType = MosaicRestrictionType.LE; const addressRestrictionValue = '10'; - const epochAdjustment = Duration.ofSeconds(1573430400); + const epochAdjustment = 1573430400; function mockGlobalRestriction(): Page { const restriction = new MosaicGlobalRestriction( @@ -106,7 +105,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicGlobalRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, '2000', @@ -126,7 +125,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicGlobalRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, '2000', @@ -147,7 +146,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicAddressRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, account.address, @@ -166,7 +165,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicGlobalRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, unresolvedMosaicId, key, '2000', @@ -186,7 +185,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicAddressRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, unresolvedMosaicId, key, unresolvedAddress, @@ -205,7 +204,7 @@ describe('MosaicRestrictionTransactionService', () => { expect(() => { mosaicRestrictionTransactionService.createMosaicGlobalRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, unresolvedAddress, key, '2000', @@ -218,7 +217,7 @@ describe('MosaicRestrictionTransactionService', () => { expect(() => { mosaicRestrictionTransactionService.createMosaicAddressRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, unresolvedMosaicId, @@ -231,7 +230,7 @@ describe('MosaicRestrictionTransactionService', () => { expect(() => { mosaicRestrictionTransactionService.createMosaicGlobalRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, 'wrong value', @@ -242,7 +241,7 @@ describe('MosaicRestrictionTransactionService', () => { expect(() => { mosaicRestrictionTransactionService.createMosaicAddressRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicId, key, account.address, @@ -255,7 +254,7 @@ describe('MosaicRestrictionTransactionService', () => { mosaicRestrictionTransactionService .createMosaicAddressRestrictionTransaction( Deadline.create(epochAdjustment), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, mosaicIdWrongKey, invalidKey, account.address, diff --git a/test/service/NamespaceService.spec.ts b/test/service/NamespaceService.spec.ts index c22802d248..acc5ed9902 100644 --- a/test/service/NamespaceService.spec.ts +++ b/test/service/NamespaceService.spec.ts @@ -37,7 +37,7 @@ describe('NamespaceService', () => { 1, [new NamespaceId([3316183705, 3829351378])], new NamespaceId([0, 0]), - Address.createFromPublicKey('1026D70E1954775749C6811084D6450A3184D977383F0E4282CD47118AF37755', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('1026D70E1954775749C6811084D6450A3184D977383F0E4282CD47118AF37755', NetworkType.PRIVATE_TEST), new UInt64([795, 0]), new UInt64([50795, 0]), new EmptyAlias(), @@ -53,7 +53,7 @@ describe('NamespaceService', () => { 2, [new NamespaceId([3316183705, 3829351378]), new NamespaceId([1781696705, 4157485863])], new NamespaceId([3316183705, 3829351378]), - Address.createFromPublicKey('1026D70E1954775749C6811084D6450A3184D977383F0E4282CD47118AF37755', NetworkType.MIJIN_TEST), + Address.createFromPublicKey('1026D70E1954775749C6811084D6450A3184D977383F0E4282CD47118AF37755', NetworkType.PRIVATE_TEST), new UInt64([795, 0]), new UInt64([50795, 0]), new EmptyAlias(), diff --git a/test/service/TransactionService.spec.ts b/test/service/TransactionService.spec.ts index caef819213..d4f0f8430a 100644 --- a/test/service/TransactionService.spec.ts +++ b/test/service/TransactionService.spec.ts @@ -15,7 +15,7 @@ */ import { expect } from 'chai'; -import { ChronoUnit, Duration } from 'js-joda'; +import { ChronoUnit } from '@js-joda/core'; import { EMPTY, of as observableOf } from 'rxjs'; import { deepEqual, instance, mock, when } from 'ts-mockito'; import { IListener } from '../../src/infrastructure/IListener'; @@ -43,27 +43,27 @@ import { TransactionService } from '../../src/service/TransactionService'; */ describe('TransactionService', () => { const generationHash = '82DB2528834C9926F0FCCE042466B24A266F5B685CB66D2869AF6648C043E950'; - const account = Account.generateNewAccount(NetworkType.MIJIN_TEST); - const epochAdjustment = Duration.ofSeconds(1573430400); + const account = Account.generateNewAccount(NetworkType.PRIVATE_TEST); + const epochAdjustment = 1573430400; const transferTransaction = TransferTransaction.create( Deadline.create(epochAdjustment, 1, ChronoUnit.HOURS), - Address.createFromRawAddress('SATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA34I2PMQ'), + Address.createFromRawAddress('QATNE7Q5BITMUTRRN6IB4I7FLSDRDWZA367I6OQ'), [], PlainMessage.create('test-message'), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); const aggregateCompleteTransaction = AggregateTransaction.createComplete( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); const aggregateBondedTransaction = AggregateTransaction.createBonded( Deadline.create(epochAdjustment), [transferTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, [], ); @@ -72,7 +72,7 @@ describe('TransactionService', () => { new Mosaic(new NamespaceId('cat.currency'), UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyLocal.DIVISIBILITY))), UInt64.fromUint(10000), account.sign(aggregateBondedTransaction, generationHash), - NetworkType.MIJIN_TEST, + NetworkType.PRIVATE_TEST, ); let transactionRepositoryMock: TransactionRepository;