You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
946 B
36 lines
946 B
'use strict';
|
|
|
|
var chai = require('chai');
|
|
var bitcore = require('../bitcore');
|
|
|
|
var should = chai.should();
|
|
|
|
var AddressModule = bitcore.Address;
|
|
var Address;
|
|
|
|
describe('Address', function() {
|
|
it('should initialze the main object', function() {
|
|
should.exist(AddressModule);
|
|
});
|
|
it('should be able to create class', function() {
|
|
Address = AddressModule.class();
|
|
should.exist(Address);
|
|
});
|
|
it('should be able to create instance', function() {
|
|
var a = new Address('1KfyjCgBSMsLqiCbakfSdeoBUqMqLUiu3T');
|
|
should.exist(a);
|
|
});
|
|
it('should validate correctly', function() {
|
|
var a = new Address('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');
|
|
var m = new Address('32QBdjycLwbDTuGafUwaU5p5GxzSLPYoF6');
|
|
var b = new Address('11111111111111111111111111122222234');
|
|
a.validate.bind(a).should.not.throw(Error);
|
|
m.validate.bind(m).should.not.throw(Error);
|
|
b.validate.bind(b).should.throw(Error);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|