name change forKey -> fromKey

This commit is contained in:
Manuel Araoz 2014-04-29 11:48:59 -03:00
parent a1a844c1e6
commit ce00b77de0
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ Address.fromPubKey = function(pubKey, network) {
};
// create an address from a Key object
Address.forKey = function(key, network) {
Address.fromKey = function(key, network) {
return Address.fromPubKey(key.public, network);
};

View File

@ -87,13 +87,13 @@ describe('Address', function() {
addr.toString().should.equal(Address.fromPubKey(pubkey).toString());
});
});
describe('#forKey', function() {
describe('#fromKey', function() {
it('should make this pubkeyhash address from uncompressed this public key', function() {
var k = new Key();
k.private = new Buffer('43532455C88590A594D552F76DDB70EC1CFD7746F05C10CBB70B1EA9552EDF87', 'hex');
k.compressed = true;
k.regenerateSync();
var a = Address.forKey(k);
var a = Address.fromKey(k);
a.toString().should.equal('1L8k7WpWHMNkqVPTaZhzFU5VaWyjZEK7mD');
});
});