Skip to content

Commit

Permalink
test(ApostillePublicAccount): Add test for mismatched networkType
Browse files Browse the repository at this point in the history
  • Loading branch information
jontey committed Nov 27, 2018
1 parent 5c20b2a commit 4f00f20
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/model/apostille/ApostillePublicAccount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ describe('apostille public account transaction methods should work properly', ()
expect(updateTransaction.type).toEqual(TransactionType.TRANSFER);
});

it('should not sign if apostille and signer are from different networkTypes', () => {
const alienAccount = Account.createFromPrivateKey(
'aaaaaaaaaaeeeeeeeeeebbbbbbbbbb5555555555dddddddddd1111111111aaee',
NetworkType.MAIN_NET);
const updateTransaction = apostillePublicAccount.update(
'LuxTag is awesome',
[]);
expect(() => {
apostillePublicAccount.sign(updateTransaction, alienAccount);
}).toThrowError(Errors[Errors.NETWORK_TYPE_MISMATCHED]);
});

it('should return correct signed update transaction', () => {
const updateTransaction = apostillePublicAccount.update(
'LuxTag is awesome',
Expand Down

0 comments on commit 4f00f20

Please sign in to comment.