Skip to content

Commit adad2d1

Browse files
authored
golang version 1.17 (#349)
1 parent 5e09a99 commit adad2d1

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup
1111
uses: actions/setup-go@v1
1212
with:
13-
go-version: 1.14.x
13+
go-version: 1.17.x
1414
id: go
1515
- name: Checkout
1616
uses: actions/checkout@v1

accounts/abi/bind/bind_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,11 +1609,11 @@ func TestGolangBindings(t *testing.T) {
16091609
t.Skip("go sdk not found for testing")
16101610
}
16111611
// Create a temporary workspace for the test suite
1612-
ws, err := ioutil.TempDir("", "")
1612+
ws, err := ioutil.TempDir("", "binding-test")
16131613
if err != nil {
16141614
t.Fatalf("failed to create temporary workspace: %v", err)
16151615
}
1616-
defer os.RemoveAll(ws)
1616+
//defer os.RemoveAll(ws)
16171617

16181618
pkg := filepath.Join(ws, "bindtest")
16191619
if err = os.MkdirAll(pkg, 0700); err != nil {
@@ -1659,11 +1659,16 @@ func TestGolangBindings(t *testing.T) {
16591659
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out)
16601660
}
16611661
pwd, _ := os.Getwd()
1662-
replacer := exec.Command(gocmd, "mod", "edit", "-replace", "github.com/core-coin/go-core="+filepath.Join(pwd, "..", "..", "..")) // Repo root
1662+
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
16631663
replacer.Dir = pkg
16641664
if out, err := replacer.CombinedOutput(); err != nil {
16651665
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
16661666
}
1667+
tidier := exec.Command(gocmd, "mod", "tidy")
1668+
tidier.Dir = pkg
1669+
if out, err := tidier.CombinedOutput(); err != nil {
1670+
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)
1671+
}
16671672
// Test the entire package and report any failures
16681673
cmd := exec.Command(gocmd, "test", "-v", "-count", "1")
16691674
cmd.Dir = pkg

p2p/discover/v5_encoding.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"crypto/sha256"
2525
"errors"
2626
"fmt"
27+
"golang.org/x/crypto/sha3"
2728
"hash"
2829
"net"
2930
"time"
@@ -382,7 +383,7 @@ func (c *wireCodec) deriveKeys(n1, n2 enode.ID, priv *eddsa.PrivateKey, pub *edd
382383
info := []byte("discovery v5 key agreement")
383384
info = append(info, n1[:]...)
384385
info = append(info, n2[:]...)
385-
kdf := hkdf.New(c.sha256reset, eph, challenge.IDNonce[:], info)
386+
kdf := hkdf.New(sha3.New256, eph, challenge.IDNonce[:], info)
386387
sec := handshakeSecrets{
387388
writeKey: make([]byte, aesKeySize),
388389
readKey: make([]byte, aesKeySize),

0 commit comments

Comments
 (0)