From 3eb9788976653cec362dc709b51ee84c095ec43e Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Wed, 17 Jun 2020 23:29:30 -0400 Subject: [PATCH 1/2] formatting changes --- api/health/service.go | 6 ++++-- api/keystore/service.go | 5 +++-- api/metrics/service.go | 3 ++- chains/atomic/memory.go | 2 +- database/encdb/db.go | 2 +- database/leveldb/db.go | 5 +++-- database/nodb/db.go | 2 +- database/rpcdb/db_client.go | 27 +++++++++++++++------------ database/rpcdb/db_server.go | 32 ++++++++++++++++++-------------- genesis/aliases.go | 34 +++++++++++++++++----------------- genesis/genesis.go | 12 ++++++------ go.sum | 7 +++++++ 12 files changed, 78 insertions(+), 59 deletions(-) diff --git a/api/health/service.go b/api/health/service.go index fdd405b..1989ab3 100644 --- a/api/health/service.go +++ b/api/health/service.go @@ -7,11 +7,13 @@ import ( "net/http" "time" - "github.com/AppsFlyer/go-sundheit" + health "github.com/AppsFlyer/go-sundheit" + + "github.com/gorilla/rpc/v2" + "github.com/ava-labs/gecko/snow/engine/common" "github.com/ava-labs/gecko/utils/json" "github.com/ava-labs/gecko/utils/logging" - "github.com/gorilla/rpc/v2" ) // defaultCheckOpts is a Check whose properties represent a default Check diff --git a/api/keystore/service.go b/api/keystore/service.go index ac9e4e6..e6979fa 100644 --- a/api/keystore/service.go +++ b/api/keystore/service.go @@ -12,6 +12,8 @@ import ( "github.com/gorilla/rpc/v2" + zxcvbn "github.com/nbutton23/zxcvbn-go" + "github.com/ava-labs/gecko/chains/atomic" "github.com/ava-labs/gecko/database" "github.com/ava-labs/gecko/database/encdb" @@ -19,12 +21,11 @@ import ( "github.com/ava-labs/gecko/database/prefixdb" "github.com/ava-labs/gecko/ids" "github.com/ava-labs/gecko/snow/engine/common" + "github.com/ava-labs/gecko/utils/codec" "github.com/ava-labs/gecko/utils/formatting" "github.com/ava-labs/gecko/utils/logging" - "github.com/ava-labs/gecko/utils/codec" jsoncodec "github.com/ava-labs/gecko/utils/json" - zxcvbn "github.com/nbutton23/zxcvbn-go" ) const ( diff --git a/api/metrics/service.go b/api/metrics/service.go index 5fa9206..463456a 100644 --- a/api/metrics/service.go +++ b/api/metrics/service.go @@ -4,9 +4,10 @@ package metrics import ( - "github.com/ava-labs/gecko/snow/engine/common" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + + "github.com/ava-labs/gecko/snow/engine/common" ) // NewService returns a new prometheus service diff --git a/chains/atomic/memory.go b/chains/atomic/memory.go index 9774711..778b9e5 100644 --- a/chains/atomic/memory.go +++ b/chains/atomic/memory.go @@ -10,9 +10,9 @@ import ( "github.com/ava-labs/gecko/database" "github.com/ava-labs/gecko/database/prefixdb" "github.com/ava-labs/gecko/ids" + "github.com/ava-labs/gecko/utils/codec" "github.com/ava-labs/gecko/utils/hashing" "github.com/ava-labs/gecko/utils/logging" - "github.com/ava-labs/gecko/utils/codec" ) type rcLock struct { diff --git a/database/encdb/db.go b/database/encdb/db.go index 4814805..fe33fa7 100644 --- a/database/encdb/db.go +++ b/database/encdb/db.go @@ -13,8 +13,8 @@ import ( "github.com/ava-labs/gecko/database" "github.com/ava-labs/gecko/database/nodb" "github.com/ava-labs/gecko/utils" - "github.com/ava-labs/gecko/utils/hashing" "github.com/ava-labs/gecko/utils/codec" + "github.com/ava-labs/gecko/utils/hashing" ) // Database encrypts all values that are provided diff --git a/database/leveldb/db.go b/database/leveldb/db.go index edcb4be..7055d61 100644 --- a/database/leveldb/db.go +++ b/database/leveldb/db.go @@ -6,14 +6,15 @@ package leveldb import ( "bytes" - "github.com/ava-labs/gecko/database" - "github.com/ava-labs/gecko/utils" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ava-labs/gecko/database" + "github.com/ava-labs/gecko/utils" ) const ( diff --git a/database/nodb/db.go b/database/nodb/db.go index 3f1bceb..9a7525f 100644 --- a/database/nodb/db.go +++ b/database/nodb/db.go @@ -17,7 +17,7 @@ func (*Database) Has([]byte) (bool, error) { return false, database.ErrClosed } func (*Database) Get([]byte) ([]byte, error) { return nil, database.ErrClosed } // Put returns nil -func (*Database) Put(_ []byte, _ []byte) error { return database.ErrClosed } +func (*Database) Put(_, _ []byte) error { return database.ErrClosed } // Delete returns nil func (*Database) Delete([]byte) error { return database.ErrClosed } diff --git a/database/rpcdb/db_client.go b/database/rpcdb/db_client.go index 67af7ef..dc3f60b 100644 --- a/database/rpcdb/db_client.go +++ b/database/rpcdb/db_client.go @@ -27,7 +27,7 @@ func NewClient(client rpcdbproto.DatabaseClient) *DatabaseClient { return &DatabaseClient{client: client} } -// Has returns false, nil +// Has attempts to return if the database has a key with the provided value. func (db *DatabaseClient) Has(key []byte) (bool, error) { resp, err := db.client.Has(context.Background(), &rpcdbproto.HasRequest{ Key: key, @@ -38,7 +38,7 @@ func (db *DatabaseClient) Has(key []byte) (bool, error) { return resp.Has, nil } -// Get returns nil, error +// Get attempts to return the value that was mapped to the key that was provided func (db *DatabaseClient) Get(key []byte) ([]byte, error) { resp, err := db.client.Get(context.Background(), &rpcdbproto.GetRequest{ Key: key, @@ -49,7 +49,7 @@ func (db *DatabaseClient) Get(key []byte) ([]byte, error) { return resp.Value, nil } -// Put returns nil +// Put attempts to set the value this key maps to func (db *DatabaseClient) Put(key, value []byte) error { _, err := db.client.Put(context.Background(), &rpcdbproto.PutRequest{ Key: key, @@ -58,7 +58,7 @@ func (db *DatabaseClient) Put(key, value []byte) error { return updateError(err) } -// Delete returns nil +// Delete attempts to remove any mapping from the key func (db *DatabaseClient) Delete(key []byte) error { _, err := db.client.Delete(context.Background(), &rpcdbproto.DeleteRequest{ Key: key, @@ -99,7 +99,7 @@ func (db *DatabaseClient) NewIteratorWithStartAndPrefix(start, prefix []byte) da } } -// Stat returns an error +// Stat attempts to return the statistic of this database func (db *DatabaseClient) Stat(property string) (string, error) { resp, err := db.client.Stat(context.Background(), &rpcdbproto.StatRequest{ Property: property, @@ -110,7 +110,7 @@ func (db *DatabaseClient) Stat(property string) (string, error) { return resp.Stat, nil } -// Compact returns nil +// Compact attempts to optimize the space utilization in the provided range func (db *DatabaseClient) Compact(start, limit []byte) error { _, err := db.client.Compact(context.Background(), &rpcdbproto.CompactRequest{ Start: start, @@ -119,7 +119,7 @@ func (db *DatabaseClient) Compact(start, limit []byte) error { return updateError(err) } -// Close returns nil +// Close attempts to close the database func (db *DatabaseClient) Close() error { _, err := db.client.Close(context.Background(), &rpcdbproto.CloseRequest{}) return updateError(err) @@ -207,7 +207,8 @@ type iterator struct { err error } -// Next returns false +// Next attempts to move the iterator to the next element and returns if this +// succeeded func (it *iterator) Next() bool { resp, err := it.db.client.IteratorNext(context.Background(), &rpcdbproto.IteratorNextRequest{ Id: it.id, @@ -221,7 +222,7 @@ func (it *iterator) Next() bool { return resp.FoundNext } -// Error returns any errors +// Error returns any that occurred while iterating func (it *iterator) Error() error { if it.err != nil { return it.err @@ -234,19 +235,21 @@ func (it *iterator) Error() error { return it.err } -// Key returns nil +// Key returns the key of the current element func (it *iterator) Key() []byte { return it.key } -// Value returns nil +// Value returns the value of the current element func (it *iterator) Value() []byte { return it.value } -// Release does nothing +// Release frees any resources held by the iterator func (it *iterator) Release() { it.db.client.IteratorRelease(context.Background(), &rpcdbproto.IteratorReleaseRequest{ Id: it.id, }) } +// updateError sets the error value to the errors required by the Database +// interface func updateError(err error) error { if err == nil { return nil diff --git a/database/rpcdb/db_server.go b/database/rpcdb/db_server.go index fe4b47a..cc32db8 100644 --- a/database/rpcdb/db_server.go +++ b/database/rpcdb/db_server.go @@ -34,16 +34,16 @@ func NewServer(db database.Database) *DatabaseServer { } } -// Has ... +// Has delegates the Has call to the managed database and returns the result func (db *DatabaseServer) Has(_ context.Context, req *rpcdbproto.HasRequest) (*rpcdbproto.HasResponse, error) { has, err := db.db.Has(req.Key) if err != nil { return nil, err } - return &rpcdbproto.HasResponse{Has: has}, nil + return &rpcdbproto.HasResponse{Has: has}, err } -// Get ... +// Get delegates the Get call to the managed database and returns the result func (db *DatabaseServer) Get(_ context.Context, req *rpcdbproto.GetRequest) (*rpcdbproto.GetResponse, error) { value, err := db.db.Get(req.Key) if err != nil { @@ -52,17 +52,18 @@ func (db *DatabaseServer) Get(_ context.Context, req *rpcdbproto.GetRequest) (*r return &rpcdbproto.GetResponse{Value: value}, nil } -// Put ... +// Put delegates the Put call to the managed database and returns the result func (db *DatabaseServer) Put(_ context.Context, req *rpcdbproto.PutRequest) (*rpcdbproto.PutResponse, error) { return &rpcdbproto.PutResponse{}, db.db.Put(req.Key, req.Value) } -// Delete ... +// Delete delegates the Delete call to the managed database and returns the +// result func (db *DatabaseServer) Delete(_ context.Context, req *rpcdbproto.DeleteRequest) (*rpcdbproto.DeleteResponse, error) { return &rpcdbproto.DeleteResponse{}, db.db.Delete(req.Key) } -// Stat ... +// Stat delegates the Stat call to the managed database and returns the result func (db *DatabaseServer) Stat(_ context.Context, req *rpcdbproto.StatRequest) (*rpcdbproto.StatResponse, error) { stat, err := db.db.Stat(req.Property) if err != nil { @@ -71,17 +72,19 @@ func (db *DatabaseServer) Stat(_ context.Context, req *rpcdbproto.StatRequest) ( return &rpcdbproto.StatResponse{Stat: stat}, nil } -// Compact ... +// Compact delegates the Compact call to the managed database and returns the +// result func (db *DatabaseServer) Compact(_ context.Context, req *rpcdbproto.CompactRequest) (*rpcdbproto.CompactResponse, error) { return &rpcdbproto.CompactResponse{}, db.db.Compact(req.Start, req.Limit) } -// Close ... -func (db *DatabaseServer) Close(_ context.Context, _ *rpcdbproto.CloseRequest) (*rpcdbproto.CloseResponse, error) { +// Close delegates the Close call to the managed database and returns the result +func (db *DatabaseServer) Close(context.Context, *rpcdbproto.CloseRequest) (*rpcdbproto.CloseResponse, error) { return &rpcdbproto.CloseResponse{}, db.db.Close() } -// WriteBatch ... +// WriteBatch takes in a set of key-value pairs and atomically writes them to +// the internal database func (db *DatabaseServer) WriteBatch(_ context.Context, req *rpcdbproto.WriteBatchRequest) (*rpcdbproto.WriteBatchResponse, error) { db.batch.Reset() @@ -100,7 +103,8 @@ func (db *DatabaseServer) WriteBatch(_ context.Context, req *rpcdbproto.WriteBat return &rpcdbproto.WriteBatchResponse{}, db.batch.Write() } -// NewIteratorWithStartAndPrefix ... +// NewIteratorWithStartAndPrefix allocates an iterator and returns the iterator +// ID func (db *DatabaseServer) NewIteratorWithStartAndPrefix(_ context.Context, req *rpcdbproto.NewIteratorWithStartAndPrefixRequest) (*rpcdbproto.NewIteratorWithStartAndPrefixResponse, error) { id := db.nextIteratorID it := db.db.NewIteratorWithStartAndPrefix(req.Start, req.Prefix) @@ -110,7 +114,7 @@ func (db *DatabaseServer) NewIteratorWithStartAndPrefix(_ context.Context, req * return &rpcdbproto.NewIteratorWithStartAndPrefixResponse{Id: id}, nil } -// IteratorNext ... +// IteratorNext attempts to call next on the requested iterator func (db *DatabaseServer) IteratorNext(_ context.Context, req *rpcdbproto.IteratorNextRequest) (*rpcdbproto.IteratorNextResponse, error) { it, exists := db.iterators[req.Id] if !exists { @@ -123,7 +127,7 @@ func (db *DatabaseServer) IteratorNext(_ context.Context, req *rpcdbproto.Iterat }, nil } -// IteratorError ... +// IteratorError attempts to report any errors that occurred during iteration func (db *DatabaseServer) IteratorError(_ context.Context, req *rpcdbproto.IteratorErrorRequest) (*rpcdbproto.IteratorErrorResponse, error) { it, exists := db.iterators[req.Id] if !exists { @@ -132,7 +136,7 @@ func (db *DatabaseServer) IteratorError(_ context.Context, req *rpcdbproto.Itera return &rpcdbproto.IteratorErrorResponse{}, it.Error() } -// IteratorRelease ... +// IteratorRelease attempts to release the resources allocated to an iterator func (db *DatabaseServer) IteratorRelease(_ context.Context, req *rpcdbproto.IteratorReleaseRequest) (*rpcdbproto.IteratorReleaseResponse, error) { it, exists := db.iterators[req.Id] if exists { diff --git a/genesis/aliases.go b/genesis/aliases.go index 80e5dcd..b1eae46 100644 --- a/genesis/aliases.go +++ b/genesis/aliases.go @@ -18,27 +18,27 @@ import ( // Aliases returns the default aliases based on the network ID func Aliases(networkID uint32) (map[string][]string, map[[32]byte][]string, map[[32]byte][]string, error) { generalAliases := map[string][]string{ - "vm/" + platformvm.ID.String(): []string{"vm/platform"}, - "vm/" + avm.ID.String(): []string{"vm/avm"}, - "vm/" + EVMID.String(): []string{"vm/evm"}, - "vm/" + spdagvm.ID.String(): []string{"vm/spdag"}, - "vm/" + spchainvm.ID.String(): []string{"vm/spchain"}, - "vm/" + timestampvm.ID.String(): []string{"vm/timestamp"}, - "bc/" + ids.Empty.String(): []string{"P", "platform", "bc/P", "bc/platform"}, + "vm/" + platformvm.ID.String(): {"vm/platform"}, + "vm/" + avm.ID.String(): {"vm/avm"}, + "vm/" + EVMID.String(): {"vm/evm"}, + "vm/" + spdagvm.ID.String(): {"vm/spdag"}, + "vm/" + spchainvm.ID.String(): {"vm/spchain"}, + "vm/" + timestampvm.ID.String(): {"vm/timestamp"}, + "bc/" + ids.Empty.String(): {"P", "platform", "bc/P", "bc/platform"}, } chainAliases := map[[32]byte][]string{ - ids.Empty.Key(): []string{"P", "platform"}, + ids.Empty.Key(): {"P", "platform"}, } vmAliases := map[[32]byte][]string{ - platformvm.ID.Key(): []string{"platform"}, - avm.ID.Key(): []string{"avm"}, - EVMID.Key(): []string{"evm"}, - spdagvm.ID.Key(): []string{"spdag"}, - spchainvm.ID.Key(): []string{"spchain"}, - timestampvm.ID.Key(): []string{"timestamp"}, - secp256k1fx.ID.Key(): []string{"secp256k1fx"}, - nftfx.ID.Key(): []string{"nftfx"}, - propertyfx.ID.Key(): []string{"propertyfx"}, + platformvm.ID.Key(): {"platform"}, + avm.ID.Key(): {"avm"}, + EVMID.Key(): {"evm"}, + spdagvm.ID.Key(): {"spdag"}, + spchainvm.ID.Key(): {"spchain"}, + timestampvm.ID.Key(): {"timestamp"}, + secp256k1fx.ID.Key(): {"secp256k1fx"}, + nftfx.ID.Key(): {"nftfx"}, + propertyfx.ID.Key(): {"propertyfx"}, } genesisBytes, err := Genesis(networkID) diff --git a/genesis/genesis.go b/genesis/genesis.go index c4245b9..f37a584 100644 --- a/genesis/genesis.go +++ b/genesis/genesis.go @@ -9,12 +9,12 @@ import ( "time" "github.com/ava-labs/gecko/ids" + "github.com/ava-labs/gecko/utils/codec" "github.com/ava-labs/gecko/utils/formatting" "github.com/ava-labs/gecko/utils/json" "github.com/ava-labs/gecko/utils/units" "github.com/ava-labs/gecko/utils/wrappers" "github.com/ava-labs/gecko/vms/avm" - "github.com/ava-labs/gecko/utils/codec" "github.com/ava-labs/gecko/vms/nftfx" "github.com/ava-labs/gecko/vms/platformvm" "github.com/ava-labs/gecko/vms/propertyfx" @@ -156,7 +156,7 @@ func FromConfig(networkID uint32, config *Config) ([]byte, error) { // Specify the chains that exist upon this network's creation platformvmArgs.Chains = []platformvm.APIChain{ - platformvm.APIChain{ + { GenesisData: avmReply.Bytes, SubnetID: platformvm.DefaultSubnetID, VMID: avm.ID, @@ -167,25 +167,25 @@ func FromConfig(networkID uint32, config *Config) ([]byte, error) { }, Name: "X-Chain", }, - platformvm.APIChain{ + { GenesisData: formatting.CB58{Bytes: config.EVMBytes}, SubnetID: platformvm.DefaultSubnetID, VMID: EVMID, Name: "C-Chain", }, - platformvm.APIChain{ + { GenesisData: spdagvmReply.Bytes, SubnetID: platformvm.DefaultSubnetID, VMID: spdagvm.ID, Name: "Simple DAG Payments", }, - platformvm.APIChain{ + { GenesisData: spchainvmReply.Bytes, SubnetID: platformvm.DefaultSubnetID, VMID: spchainvm.ID, Name: "Simple Chain Payments", }, - platformvm.APIChain{ + { GenesisData: formatting.CB58{Bytes: []byte{}}, // There is no genesis data SubnetID: platformvm.DefaultSubnetID, VMID: timestampvm.ID, diff --git a/go.sum b/go.sum index d46c985..3f809ed 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -122,6 +123,7 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= @@ -177,8 +179,10 @@ github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= @@ -230,6 +234,7 @@ github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8 github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -345,6 +350,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= @@ -354,6 +360,7 @@ gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLv gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9 h1:ITeyKbRetrVzqR3U1eY+ywgp7IBspGd1U/bkwd1gWu4= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= From 84c4e30937e67fc7dad8924062fa06f560f12995 Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Thu, 18 Jun 2020 00:30:15 -0400 Subject: [PATCH 2/2] formatting update --- snow/consensus/snowball/parameters_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snow/consensus/snowball/parameters_test.go b/snow/consensus/snowball/parameters_test.go index 7c3668c..056e229 100644 --- a/snow/consensus/snowball/parameters_test.go +++ b/snow/consensus/snowball/parameters_test.go @@ -125,14 +125,14 @@ func TestParametersAnotherInvalidBetaRogue(t *testing.T) { func TestParametersInvalidConcurrentRepolls(t *testing.T) { tests := []Parameters{ - Parameters{ + { K: 1, Alpha: 1, BetaVirtuous: 1, BetaRogue: 1, ConcurrentRepolls: 2, }, - Parameters{ + { K: 1, Alpha: 1, BetaVirtuous: 1,