@ellipticltd/aml-utils 0.14.2-SCR-638 → 0.14.2-SCR-638-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -158,7 +158,7 @@ export namespace doge {
|
|
|
158
158
|
function isTxHash(str: any): boolean;
|
|
159
159
|
function isTxHash(str: any): boolean;
|
|
160
160
|
}
|
|
161
|
-
export namespace
|
|
161
|
+
export namespace cosmos {
|
|
162
162
|
function isAddress(str: any): boolean;
|
|
163
163
|
function isAddress(str: any): boolean;
|
|
164
164
|
function isTxHash(str: any): any;
|
|
@@ -310,14 +310,14 @@ describe('Validations', () => {
|
|
|
310
310
|
});
|
|
311
311
|
describe('ATOM', () => {
|
|
312
312
|
describe('isAddress', () => {
|
|
313
|
-
it('should correctly validate valid ATOM addresses', () => validations_1.default.
|
|
314
|
-
it('should correctly validate an incorrect ATOM address', () => validations_1.default.
|
|
315
|
-
it('should correctly validate an incorrect (too long) ATOM address', () => validations_1.default.
|
|
313
|
+
it('should correctly validate valid ATOM addresses', () => validations_1.default.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.true);
|
|
314
|
+
it('should correctly validate an incorrect ATOM address', () => validations_1.default.cosmos.isAddress('kosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.false);
|
|
315
|
+
it('should correctly validate an incorrect (too long) ATOM address', () => validations_1.default.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x50').should.be.false);
|
|
316
316
|
});
|
|
317
317
|
describe('isTxHash', () => {
|
|
318
|
-
it('should correctly validate a valid ATOM hash', () => validations_1.default.
|
|
319
|
-
it('should correctly validate an incorrect ATOM hash', () => validations_1.default.
|
|
320
|
-
it('should return false when passed a non-hex string', () => validations_1.default.
|
|
318
|
+
it('should correctly validate a valid ATOM hash', () => validations_1.default.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.true);
|
|
319
|
+
it('should correctly validate an incorrect ATOM hash', () => validations_1.default.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7').should.be.false);
|
|
320
|
+
it('should return false when passed a non-hex string', () => validations_1.default.cosmos.isTxHash('ZZA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.false);
|
|
321
321
|
});
|
|
322
322
|
});
|
|
323
323
|
});
|
|
@@ -401,19 +401,19 @@ describe('Validations', () => {
|
|
|
401
401
|
|
|
402
402
|
describe('ATOM', () => {
|
|
403
403
|
describe('isAddress', () => {
|
|
404
|
-
it('should correctly validate valid ATOM addresses', () => validations.
|
|
404
|
+
it('should correctly validate valid ATOM addresses', () => validations.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.true);
|
|
405
405
|
|
|
406
|
-
it('should correctly validate an incorrect ATOM address', () => validations.
|
|
406
|
+
it('should correctly validate an incorrect ATOM address', () => validations.cosmos.isAddress('kosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x5').should.be.false);
|
|
407
407
|
|
|
408
|
-
it('should correctly validate an incorrect (too long) ATOM address', () => validations.
|
|
408
|
+
it('should correctly validate an incorrect (too long) ATOM address', () => validations.cosmos.isAddress('cosmos153lf4zntqt33a4v0sm5cytrxyqn78q7kz8j8x50').should.be.false);
|
|
409
409
|
});
|
|
410
410
|
|
|
411
411
|
describe('isTxHash', () => {
|
|
412
|
-
it('should correctly validate a valid ATOM hash', () => validations.
|
|
412
|
+
it('should correctly validate a valid ATOM hash', () => validations.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.true);
|
|
413
413
|
|
|
414
|
-
it('should correctly validate an incorrect ATOM hash', () => validations.
|
|
414
|
+
it('should correctly validate an incorrect ATOM hash', () => validations.cosmos.isTxHash('BFA0252193CCAA0592AF2A27541473E7').should.be.false);
|
|
415
415
|
|
|
416
|
-
it('should return false when passed a non-hex string', () => validations.
|
|
416
|
+
it('should return false when passed a non-hex string', () => validations.cosmos.isTxHash('ZZA0252193CCAA0592AF2A27541473E7F6422A9AD85CFC9525CF67FA2AA2CD6F').should.be.false);
|
|
417
417
|
});
|
|
418
418
|
});
|
|
419
419
|
});
|