diff --git a/lib/Address.js b/lib/Address.js index 40e6cdc..9ca055b 100644 --- a/lib/Address.js +++ b/lib/Address.js @@ -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); }; diff --git a/test/test.Address.js b/test/test.Address.js index 80a87ee..13f2f18 100644 --- a/test/test.Address.js +++ b/test/test.Address.js @@ -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'); }); });