diff --git a/src/PublicApostille.ts b/src/PublicApostille.ts index d1e108c..3de8511 100644 --- a/src/PublicApostille.ts +++ b/src/PublicApostille.ts @@ -1,7 +1,7 @@ import { Address, AggregateTransaction, Deadline, Listener, LockFundsTransaction, NetworkType, PlainMessage, SignedTransaction, TransactionHttp, TransferTransaction, UInt64, XEM } from 'nem2-sdk'; import { Errors, HistoricalEndpoints, Initiator } from '../index'; -import { Sinks } from './Sinks'; import { HashFunction } from './hashFunctions/HashFunction'; +import { Sinks } from './Sinks'; // TODO: add tx hash of the update /** @@ -98,7 +98,7 @@ class PublicApostille { transactionHttp = new TransactionHttp(urls); listener = new Listener(urls); } else { - if (this.networkType === NetworkType.MAIN_NET || this.networkType === NetworkType.TEST_NET) { + if (this.networkType === NetworkType.MIJIN) { throw new Error(Errors[Errors.MIJIN_ENDPOINT_NEEDED]); } transactionHttp = new TransactionHttp(HistoricalEndpoints[this.networkType]); diff --git a/tests/unit/Private/Functionalities.spec.ts b/tests/unit/Private/Functionalities.spec.ts index e230cb0..7329459 100644 --- a/tests/unit/Private/Functionalities.spec.ts +++ b/tests/unit/Private/Functionalities.spec.ts @@ -181,17 +181,17 @@ describe('isAnnounced function should work properly', () => { try { return apostilleMJ.isAnnouced(); } catch (e) { - expect(e.message).toMatch(Errors[Errors.MISSING_ENDPOINT_ARGUMENT]); + expect(e.message).toMatch(Errors[Errors.MIJIN_ENDPOINT_NEEDED]); } }); - it('should return false before an announce', () => { + it.skip('should return false before an announce', () => { const MTgenerator = Account.createFromPrivateKey(sk, NetworkType.MIJIN_TEST); const MJgenerator = Account.createFromPrivateKey(sk, NetworkType.MIJIN); const MNgenerator = Account.createFromPrivateKey(sk, NetworkType.MAIN_NET); const Tgenerator = Account.createFromPrivateKey(sk, NetworkType.TEST_NET); const apostilleMT = new Apostille('QUleqZedaOUtlSh', MTgenerator); - const apostilleMJ = new Apostille('QUleqZedaOUtlSh', MJgenerator); + const apostilleMJ = new Apostille('QUleqZedaOUtlSS', MJgenerator); const apostilleMN = new Apostille('QUleqZedaOUtlSh', MNgenerator); const apostilleT = new Apostille('QUleqZedaOUtlSh', Tgenerator); return apostilleMT.isAnnouced().then((MT) => {