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.
25 lines
606 B
25 lines
606 B
'use strict';
|
|
var imports = require('soop').imports();
|
|
var parent = imports.parent || require('./util/VersionedData');
|
|
|
|
function Address() {
|
|
Address.super(this, arguments);
|
|
}
|
|
|
|
Address.parent = parent;
|
|
parent.applyEncodingsTo(Address);
|
|
|
|
|
|
Address.prototype.validate = function() {
|
|
this.doAsBinary(function() {
|
|
Address.super(this, 'validate', arguments);
|
|
if(this.data.length !== 21) throw new Error('invalid data length');
|
|
});
|
|
};
|
|
|
|
Address.prototype.isValid = function() {
|
|
var answer = Address.super(this, 'isValid', arguments);
|
|
return answer;
|
|
};
|
|
|
|
module.exports = require('soop')(Address);
|
|
|