Skip to content

Commit

Permalink
snow/*: Create stop vertex + Add e2e tests (#1151)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Buttolph <[email protected]>
  • Loading branch information
gyuho and StephenButtolph authored Feb 24, 2022
1 parent db707a8 commit bc6c6d2
Show file tree
Hide file tree
Showing 53 changed files with 3,394 additions and 267 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test e2e

on:
push:
branches:
- dev
pull_request:

permissions:
contents: read

jobs:
test_e2e:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build the avalanchego binaries
shell: bash
run: ./scripts/build.sh
- name: Run e2e tests
shell: bash
run: scripts/tests.e2e.sh ./build/avalanchego
27 changes: 27 additions & 0 deletions .github/workflows/test.upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test upgrade

on:
push:
branches:
- dev
pull_request:

permissions:
contents: read

jobs:
test_upgrade:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build the avalanchego binaries
shell: bash
run: ./scripts/build.sh
- name: Run upgrade tests
shell: bash
run: scripts/tests.upgrade.sh 1.7.4 ./build/avalanchego
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ plugins/

scripts/ansible/*inventory.yml
scripts/.build_image_gopath/

tests/e2e/e2e.test
tests/upgrade/upgrade.test
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ linters-settings:
- "all"
- "-SA6002" # argument should be pointer-like to avoid allocation, for sync.Pool
- "-SA1019" # deprecated packages e.g., golang.org/x/crypto/ripemd160
# https://golangci-lint.run/usage/linters#gosec
gosec:
excludes:
- G107 # https://securego.io/docs/rules/g107.html
12 changes: 8 additions & 4 deletions genesis/genesis_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package genesis
import (
"time"

"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/crypto"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/ava-labs/avalanchego/utils/units"
Expand All @@ -18,8 +19,11 @@ import (
// 56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027 => 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC

const (
vmrqKeyStr = "vmRQiZeXEXYMyJhEiqdC2z5JhuDbxL8ix9UVvjgMu2Er1NepE"
ewoqKeyStr = "ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN"
VMRQKeyStr = "vmRQiZeXEXYMyJhEiqdC2z5JhuDbxL8ix9UVvjgMu2Er1NepE"
VMRQKeyFormattedStr = constants.SecretKeyPrefix + VMRQKeyStr

EWOQKeyStr = "ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN"
EWOQKeyFormattedStr = constants.SecretKeyPrefix + EWOQKeyStr
)

var (
Expand Down Expand Up @@ -131,9 +135,9 @@ var (

func init() {
errs := wrappers.Errs{}
vmrqBytes, err := formatting.Decode(formatting.CB58, vmrqKeyStr)
vmrqBytes, err := formatting.Decode(formatting.CB58, VMRQKeyStr)
errs.Add(err)
ewoqBytes, err := formatting.Decode(formatting.CB58, ewoqKeyStr)
ewoqBytes, err := formatting.Decode(formatting.CB58, EWOQKeyStr)
errs.Add(err)

factory := crypto.FactorySECP256K1R{}
Expand Down
21 changes: 12 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ module github.com/ava-labs/avalanchego
go 1.16

require (
github.com/Microsoft/go-winio v0.4.14
github.com/Microsoft/go-winio v0.4.16
github.com/NYTimes/gziphandler v1.1.1
github.com/ava-labs/avalanche-network-runner v1.0.5
github.com/ava-labs/coreth v0.8.5-rc.2
github.com/btcsuite/btcutil v1.0.2
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200627015759-01fd2de07837
github.com/golang-jwt/jwt v3.2.1+incompatible
github.com/golang/mock v1.3.1
github.com/golang/mock v1.6.0
github.com/google/btree v1.0.1
github.com/gorilla/handlers v1.4.2
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/gorilla/rpc v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/go-hclog v0.14.1
github.com/hashicorp/go-hclog v1.0.0
github.com/hashicorp/go-plugin v1.4.3
github.com/holiman/bloomfilter/v2 v2.0.3
github.com/huin/goupnp v1.0.2
Expand All @@ -33,20 +34,22 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/mr-tron/base58 v1.2.0
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d
github.com/prometheus/client_golang v1.7.1
github.com/onsi/ginkgo/v2 v2.1.0
github.com/onsi/gomega v1.17.0
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/rs/cors v1.7.0
github.com/spaolacci/murmur3 v1.1.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.7.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
gonum.org/v1/gonum v0.9.1
google.golang.org/grpc v1.37.0
google.golang.org/grpc v1.43.0
google.golang.org/protobuf v1.27.1
gotest.tools v2.2.0+incompatible
)
Loading

0 comments on commit bc6c6d2

Please sign in to comment.