git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 4ff6379f39ae924c4b07f1019a4716bcceee6eda

Address: support instantiation from another Address

Alex Beregszaszi committed on 8/13/2016, 1:47:01 AM
Parent: feab13c39501456b20f90cec13af46229317a9e8

Files changed

address.jschanged
address.jsView
@@ -1,8 +1,14 @@
11 const ethUtils = require('ethereumjs-util')
22
33 module.exports = class Address {
44 constructor (value) {
5+ // Special case: duplicate
6+ if (value instanceof Address) {
7+ this._value = new Buffer(value._value)
8+ return
9+ }
10+
511 if (typeof value !== 'string') {
612 throw new Error('Invalid input to address')
713 }
814

Built with git-ssb-web