Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Commit 8ca21bd

Browse files
committed
preliminary array support; closes #5
1 parent 31f1812 commit 8ca21bd

File tree

8 files changed

+597
-458
lines changed

8 files changed

+597
-458
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ go:
55
- "master"
66

77
script:
8+
- go get -u github.com/ethereum/go-ethereum
89
- make test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all:
33

44
.PHONY: test
55
test:
6-
go test -v ./...
6+
@go test -v `go list ./... | grep -v example` && echo "ALL PASS" || echo "FAILURE"
77

88
.PHONY: deps
99
deps:

example/array_example.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package main
2+
3+
import (
4+
"encoding/hex"
5+
"fmt"
6+
7+
"github.com/miguelmota/go-solidity-sha3"
8+
)
9+
10+
func main() {
11+
hash := solsha3.SoliditySHA3(
12+
solsha3.Uint8Array([3]uint{1, 2, 3}),
13+
)
14+
15+
fmt.Println(hex.EncodeToString(hash)) // 6e0c627900b24bd432fe7b1f713f1b0744091a646a9fe4a65a18dfed21f2949c
16+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module github.com/miguelmota/go-solidity-sha3
22

33
require (
44
github.com/btcsuite/btcd v0.0.0-20190109040709-5bda5314ca95 // indirect
5+
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495
56
github.com/ethereum/go-ethereum v1.8.20
67
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc
78
)

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa
88
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
99
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
1010
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
11+
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
1112
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1213
github.com/ethereum/go-ethereum v1.8.20 h1:Sr6DLbdc7Fl2IMDC0sjF2wO1jTO5nALFC1SoQnyAQEk=
1314
github.com/ethereum/go-ethereum v1.8.20/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY=

0 commit comments

Comments
 (0)