aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-17 20:09:22 +0800
committerobscuren <geffobscura@gmail.com>2015-03-17 20:09:22 +0800
commitff55c6f5badda7ef11c38ef5d94b71420b14817c (patch)
tree02c5fa61766a61224e8c33deed0c772b7e49e12b /common
parentb0ebccb31e944e7cb7fabbbecf279a5507e513ab (diff)
parent9663493ba0d493ec62153e725b5d30340f2aa525 (diff)
downloadgo-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.gz
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.bz2
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.lz
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.xz
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.tar.zst
go-tangerine-ff55c6f5badda7ef11c38ef5d94b71420b14817c.zip
Merge branch 'develop' into conversion
Conflicts: common/types.go
Diffstat (limited to 'common')
-rw-r--r--common/types.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/common/types.go b/common/types.go
index 9729378e8..da46db874 100644
--- a/common/types.go
+++ b/common/types.go
@@ -12,11 +12,6 @@ type (
Address [addressLength]byte
)
-var (
- zeroHash Hash
- zeroAddress Address
-)
-
func BytesToHash(b []byte) Hash {
var h Hash
h.SetBytes(b)
@@ -41,7 +36,7 @@ func (h *Hash) SetBytes(b []byte) {
// reverse loop
for i := len(b) - 1; i >= 0; i-- {
- h[i] = b[i]
+ h[hashLength-len(b)+i] = b[i]
}
}
@@ -79,7 +74,7 @@ func (a *Address) SetBytes(b []byte) {
// reverse loop
for i := len(b) - 1; i >= 0; i-- {
- a[i] = b[i]
+ a[addressLength-len(b)+i] = b[i]
}
}