Browse Source

ci: remove `add-path` (#5674)

pull/5683/head
Marko 4 years ago
committed by Marko
parent
commit
23bc2f690c
3 changed files with 22 additions and 22 deletions
  1. +7
    -19
      .github/workflows/tests.yml
  2. +4
    -0
      test/e2e/pkg/manifest.go
  3. +11
    -3
      test/e2e/pkg/testnet.go

+ 7
- 19
.github/workflows/tests.yml View File

@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.4'
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
@ -33,9 +33,6 @@ jobs:
**/**.go
go.mod
go.sum
- name: Set GOBIN
run: |
echo "::add-path::$(go env GOPATH)/bin"
- name: install
run: make install install_abci
if: "env.GIT_DIFF != ''"
@ -60,7 +57,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.4'
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
@ -68,10 +65,7 @@ jobs:
**/**.go
go.mod
go.sum
- name: Set GOBIN
run: |
echo "::add-path::$(go env GOPATH)/bin"
- uses: actions/cache@v2.1.2
- uses: actions/cache@v2.1.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@ -95,7 +89,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.4'
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
@ -103,10 +97,7 @@ jobs:
**/**.go
go.mod
go.sum
- name: Set GOBIN
run: |
echo "::add-path::$(go env GOPATH)/bin"
- uses: actions/cache@v2.1.2
- uses: actions/cache@v2.1.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@ -129,7 +120,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.4'
go-version: "^1.15.4"
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
@ -137,10 +128,7 @@ jobs:
**/**.go
go.mod
go.sum
- name: Set GOBIN
run: |
echo "::add-path::$(go env GOPATH)/bin"
- uses: actions/cache@v2.1.2
- uses: actions/cache@v2.1.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}


+ 4
- 0
test/e2e/pkg/manifest.go View File

@ -46,6 +46,10 @@ type Manifest struct {
// Nodes specifies the network nodes. At least one node must be given.
Nodes map[string]*ManifestNode `toml:"node"`
// KeyType sets the curve that will be used by validators.
// Options are ed25519 & secp256k1
KeyType string `toml:"key_type"`
}
// ManifestNode represents a node in a testnet manifest.


+ 11
- 3
test/e2e/pkg/testnet.go View File

@ -14,6 +14,7 @@ import (
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/secp256k1"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
mcs "github.com/tendermint/tendermint/test/maverick/consensus"
)
@ -57,6 +58,7 @@ type Testnet struct {
Validators map[*Node]int64
ValidatorUpdates map[int64]map[*Node]int64
Nodes []*Node
KeyType string
}
// Node represents a Tendermint node in a testnet.
@ -468,15 +470,21 @@ func newKeyGenerator(seed int64) *keyGenerator {
}
}
func (g *keyGenerator) Generate() crypto.PrivKey {
func (g *keyGenerator) Generate(keyType string) crypto.PrivKey {
seed := make([]byte, ed25519.SeedSize)
_, err := io.ReadFull(g.random, seed)
if err != nil {
panic(err) // this shouldn't happen
}
return ed25519.GenPrivKeyFromSecret(seed)
switch keyType {
case "secp256k1":
return secp256k1.GenPrivKeySecp256k1(seed)
case "", "ed25519":
return ed25519.GenPrivKeyFromSecret(seed)
default:
panic("KeyType not supported") // should not make it this far
}
}
// portGenerator generates local Docker proxy ports for each node.


Loading…
Cancel
Save