Skip to content

Commit

Permalink
golang version 1.17 (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
error2215 authored Sep 28, 2021
1 parent 5e09a99 commit adad2d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Setup
uses: actions/setup-go@v1
with:
go-version: 1.14.x
go-version: 1.17.x
id: go
- name: Checkout
uses: actions/checkout@v1
Expand Down
11 changes: 8 additions & 3 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1609,11 +1609,11 @@ func TestGolangBindings(t *testing.T) {
t.Skip("go sdk not found for testing")
}
// Create a temporary workspace for the test suite
ws, err := ioutil.TempDir("", "")
ws, err := ioutil.TempDir("", "binding-test")
if err != nil {
t.Fatalf("failed to create temporary workspace: %v", err)
}
defer os.RemoveAll(ws)
//defer os.RemoveAll(ws)

pkg := filepath.Join(ws, "bindtest")
if err = os.MkdirAll(pkg, 0700); err != nil {
Expand Down Expand Up @@ -1659,11 +1659,16 @@ func TestGolangBindings(t *testing.T) {
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out)
}
pwd, _ := os.Getwd()
replacer := exec.Command(gocmd, "mod", "edit", "-replace", "github.com/core-coin/go-core="+filepath.Join(pwd, "..", "..", "..")) // Repo root
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/core-coin/[email protected]", "-replace", "github.com/core-coin/go-core="+filepath.Join(pwd, "..", "..", "..")) // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
tidier := exec.Command(gocmd, "mod", "tidy")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)
}
// Test the entire package and report any failures
cmd := exec.Command(gocmd, "test", "-v", "-count", "1")
cmd.Dir = pkg
Expand Down
3 changes: 2 additions & 1 deletion p2p/discover/v5_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"crypto/sha256"
"errors"
"fmt"
"golang.org/x/crypto/sha3"
"hash"
"net"
"time"
Expand Down Expand Up @@ -382,7 +383,7 @@ func (c *wireCodec) deriveKeys(n1, n2 enode.ID, priv *eddsa.PrivateKey, pub *edd
info := []byte("discovery v5 key agreement")
info = append(info, n1[:]...)
info = append(info, n2[:]...)
kdf := hkdf.New(c.sha256reset, eph, challenge.IDNonce[:], info)
kdf := hkdf.New(sha3.New256, eph, challenge.IDNonce[:], info)
sec := handshakeSecrets{
writeKey: make([]byte, aesKeySize),
readKey: make([]byte, aesKeySize),
Expand Down

0 comments on commit adad2d1

Please sign in to comment.