Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update vmcommon and use LegacyBlockchainHook interface #109

Open
wants to merge 4 commits into
base: rc/barnard
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/multiversx/mx-chain-core-go v1.2.21-0.20240725065431-6e9bfee5a4c6
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240726095253-28ca342f0626
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240726094554-651b1b43c6aa
github.com/multiversx/mx-components-big-int v1.0.0
github.com/pelletier/go-toml v1.9.3
github.com/stretchr/testify v1.8.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f h
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f/go.mod h1:9aSp//uBSvqFdzh4gvYISraoruhr1FCTXgPQalQ687k=
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775 h1:a8LOfz3p4MQfRtbF00rGDAJiebziwtSfVmBHIaHBDdY=
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775/go.mod h1:owPYyrK7RcsLx9eOCAZQ22fIyW6BE7ttJr4XIhFIbQw=
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6 h1:QGQjSlPix5nBtCkcdyKo0b2sRYXwYF/GBtccOqDbU6Y=
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6/go.mod h1:MvJiMtuyGq43aS9eOgF+xQUWk0hYxvCQqLrT77bhBaE=
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240726095253-28ca342f0626 h1:AHilWDdkyZiT71jnAcp0wwcq/4H0ZoawQqF5t3gVq0s=
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240726095253-28ca342f0626/go.mod h1:Wzjwp5OtHa7HaOwaFBFSFIxltydpUzVVh8DshLp8+cM=
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf h1:L9K7Xzq5SZz6k55R7HrafiRcU+c8/PqozJxys65G4bI=
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf/go.mod h1:ptvW/8r6bam55mVpeVZbyvvvydYM0DQwcPOH0W4Xyx8=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087 h1:ovxs8X50iBL9TOkn0qHrkuXrBS1Y/EWfQOYmFEaXRNs=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087/go.mod h1:nNGN+rdLRN8Nd6OhFGrkEZS5Ipj5IQCvFT0L/iQbOpU=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240726094554-651b1b43c6aa h1:PsLO4gn0Q5qF4HDN7Zdrws3kVAY2RmMQe+/38zGNMAs=
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240726094554-651b1b43c6aa/go.mod h1:nNGN+rdLRN8Nd6OhFGrkEZS5Ipj5IQCvFT0L/iQbOpU=
github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down
4 changes: 2 additions & 2 deletions mock/context/blockChainHookStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"math/big"

"github.com/multiversx/mx-chain-core-go/data/esdt"
"github.com/multiversx/mx-chain-vm-common-go"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
)

var _ vmcommon.BlockchainHook = (*BlockchainHookStub)(nil)
var _ vmcommon.LegacyBlockchainHook = (*BlockchainHookStub)(nil)

// BlockchainHookStub is used in tests to check that interface methods were called
type BlockchainHookStub struct {
Expand Down
4 changes: 2 additions & 2 deletions testcommon/testInitializer_inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,15 @@ func DefaultTestVMWithWorldMockWithGasSchedule(tb testing.TB, customGasSchedule
}

// DefaultTestVM creates a host configured with a blockchain hook
func DefaultTestVM(tb testing.TB, blockchain vmcommon.BlockchainHook) vmhost.VMHost {
func DefaultTestVM(tb testing.TB, blockchain vmcommon.LegacyBlockchainHook) vmhost.VMHost {
customGasSchedule := config.GasScheduleMap(nil)
return DefaultTestVMWithGasSchedule(tb, blockchain, customGasSchedule, false)
}

// DefaultTestVMWithGasSchedule creates a host with the provided blockchain hook and gas schedule
func DefaultTestVMWithGasSchedule(
tb testing.TB,
blockchain vmcommon.BlockchainHook,
blockchain vmcommon.LegacyBlockchainHook,
customGasSchedule config.GasScheduleMap,
wasmerSIGSEGVPassthrough bool,
) vmhost.VMHost {
Expand Down
4 changes: 2 additions & 2 deletions vmhost/contexts/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ var log = logger.GetOrCreate("vm/blockchainContext")

type blockchainContext struct {
host vmhost.VMHost
blockChainHook vmcommon.BlockchainHook
blockChainHook vmcommon.LegacyBlockchainHook
stateStack []int
}

// NewBlockchainContext creates a new blockchainContext
func NewBlockchainContext(
host vmhost.VMHost,
blockChainHook vmcommon.BlockchainHook,
blockChainHook vmcommon.LegacyBlockchainHook,
) (*blockchainContext, error) {

context := &blockchainContext{
Expand Down
4 changes: 2 additions & 2 deletions vmhost/contexts/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var logStorage = logger.GetOrCreate("vm/storage")

type storageContext struct {
host vmhost.VMHost
blockChainHook vmcommon.BlockchainHook
blockChainHook vmcommon.LegacyBlockchainHook
address []byte
stateStack [][]byte
protectedKeyPrefix []byte
Expand All @@ -24,7 +24,7 @@ type storageContext struct {
// NewStorageContext creates a new storageContext
func NewStorageContext(
host vmhost.VMHost,
blockChainHook vmcommon.BlockchainHook,
blockChainHook vmcommon.LegacyBlockchainHook,
protectedKeyPrefix []byte,
) (*storageContext, error) {
if len(protectedKeyPrefix) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion vmhost/hostCore/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type vmHost struct {

// NewVMHost creates a new VM vmHost
func NewVMHost(
blockChainHook vmcommon.BlockchainHook,
blockChainHook vmcommon.LegacyBlockchainHook,
hostParameters *vmhost.VMHostParameters,
) (vmhost.VMHost, error) {

Expand Down
Loading