Skip to content

Commit

Permalink
Rewire fixes (#125)
Browse files Browse the repository at this point in the history
* fix unit tests

* Fix avalanchego version and remove unused files

* delete yarn.lock

---------

Co-authored-by: Shubham Goyal <[email protected]>
  • Loading branch information
atvanguard and lumos42 authored Oct 1, 2023
1 parent 9d06705 commit 4472792
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 1,556 deletions.
2 changes: 1 addition & 1 deletion plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ func (vm *VM) initializeChain(lastAcceptedHash common.Hash, ethConfig ethconfig.
vm.blockChain = vm.eth.BlockChain()
vm.miner = vm.eth.Miner()

vm.limitOrderProcesser = vm.NewLimitOrderProcesser()
vm.eth.Start()
return vm.initChainState(vm.blockChain.LastAcceptedBlock())
}
Expand Down Expand Up @@ -624,7 +625,6 @@ func (vm *VM) initBlockBuilding() {
vm.builder = vm.NewBlockBuilder(vm.toEngine)
vm.builder.awaitSubmittedTxs()
vm.Network.SetGossipHandler(NewGossipHandler(vm, gossipStats))

vm.limitOrderProcesser.ListenAndProcessTransactions(vm.builder)
}

Expand Down
7 changes: 0 additions & 7 deletions plugin/evm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ import (
"testing"
"time"

"github.com/ava-labs/subnet-evm/commontype"
"github.com/ava-labs/subnet-evm/internal/ethapi"
"github.com/ava-labs/subnet-evm/metrics"
"github.com/ava-labs/subnet-evm/plugin/evm/message"
"github.com/ava-labs/subnet-evm/precompile"
"github.com/ava-labs/subnet-evm/trie"
"github.com/ava-labs/subnet-evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
Expand Down
68 changes: 0 additions & 68 deletions precompile/contracts/hubblebibliophile/config.go

This file was deleted.

185 changes: 0 additions & 185 deletions precompile/contracts/hubblebibliophile/contract.go

This file was deleted.

18 changes: 9 additions & 9 deletions precompile/contracts/ticks/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
package ticks

import (
"math/big"
"testing"

"github.com/ava-labs/subnet-evm/precompile/precompileconfig"
"github.com/ava-labs/subnet-evm/precompile/testutils"
"github.com/ava-labs/subnet-evm/utils"
)

// TestVerify tests the verification of Config.
func TestVerify(t *testing.T) {
tests := map[string]testutils.ConfigVerifyTest{
"valid config": {
Config: NewConfig(big.NewInt(3)),
Config: NewConfig(utils.NewUint64(3)),
ExpectedError: "",
},
// CUSTOM CODE STARTS HERE
// Add your own Verify tests here, e.g.:
// "your custom test name": {
// Config: NewConfig(big.NewInt(3),),
// Config: NewConfig(utils.NewUint64(3),),
// ExpectedError: ErrYourCustomError.Error(),
// },
}
Expand All @@ -34,23 +34,23 @@ func TestVerify(t *testing.T) {
func TestEqual(t *testing.T) {
tests := map[string]testutils.ConfigEqualTest{
"non-nil config and nil other": {
Config: NewConfig(big.NewInt(3)),
Config: NewConfig(utils.NewUint64(3)),
Other: nil,
Expected: false,
},
"different type": {
Config: NewConfig(big.NewInt(3)),
Config: NewConfig(utils.NewUint64(3)),
Other: precompileconfig.NewNoopStatefulPrecompileConfig(),
Expected: false,
},
"different timestamp": {
Config: NewConfig(big.NewInt(3)),
Other: NewConfig(big.NewInt(4)),
Config: NewConfig(utils.NewUint64(3)),
Other: NewConfig(utils.NewUint64(4)),
Expected: false,
},
"same config": {
Config: NewConfig(big.NewInt(3)),
Other: NewConfig(big.NewInt(3)),
Config: NewConfig(utils.NewUint64(3)),
Other: NewConfig(utils.NewUint64(3)),
Expected: true,
},
// CUSTOM CODE STARTS HERE
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ avalanche subnet configure hubblenet --subnet-config subnet.json --config .avala

# use the same avalanchego version as the one used in subnet-evm
# use tee to keep showing outut while storing in a var
OUTPUT=$(avalanche subnet deploy hubblenet -l --avalanchego-version v1.9.14 --config .avalanche-cli.json | tee /dev/fd/2)
OUTPUT=$(avalanche subnet deploy hubblenet -l --avalanchego-version v1.10.5 --config .avalanche-cli.json | tee /dev/fd/2)

setStatus
2 changes: 1 addition & 1 deletion scripts/upgrade_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ avalanche network stop --snapshot-name snap1
avalanche subnet upgrade vm hubblenet --binary custom_evm.bin --local

# utse tee to keep showing outut while storing in a var
OUTPUT=$(avalanche network start --avalanchego-version v1.10.0 --snapshot-name snap1 --config .avalanche-cli.json | tee /dev/fd/2)
OUTPUT=$(avalanche network start --avalanchego-version v1.10.5 --snapshot-name snap1 --config .avalanche-cli.json | tee /dev/fd/2)

setStatus
Loading

0 comments on commit 4472792

Please sign in to comment.