Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a00430a
fixing todos
sasurobert Aug 5, 2025
06e2470
AI Agent review and code refactor
sasurobert Aug 5, 2025
a92b826
disable function
sasurobert Aug 5, 2025
c6f5a0a
asynclocal refactor
sasurobert Aug 5, 2025
71f4c2c
more refactors
sasurobert Aug 5, 2025
60ad7cd
more refactors
sasurobert Aug 5, 2025
29de47b
hardening endpoint with fail execution.
sasurobert Aug 5, 2025
0178e07
hardening endpoint with fail execution.
sasurobert Aug 6, 2025
1e817e2
hardening endpoint with fail execution.
sasurobert Aug 6, 2025
9e21c98
tests things alone.
sasurobert Aug 6, 2025
f07bc54
storage refactor
sasurobert Aug 6, 2025
df55ec3
simplify
sasurobert Aug 6, 2025
5015248
mandos test update (out of bounds protection)
andrei-marinica Aug 8, 2025
ba325de
Merge branch 'rc/after-supernova' into start-resolving-todos
sasurobert Aug 12, 2025
e93a93a
fix after merge
sasurobert Aug 12, 2025
76213b3
fix after merge
sasurobert Aug 12, 2025
e58dd12
fixes after merge or something.
sasurobert Aug 12, 2025
f814b1f
add missing file
sasurobert Aug 12, 2025
d55c62a
Merge branch 'rc/after-supernova' into start-resolving-todos
andrei-marinica Aug 13, 2025
7a363e0
Merge branch 'rc/after-supernova' into start-resolving-todos
sasurobert Aug 14, 2025
1433dce
timelock refactor fix
andrei-marinica Aug 19, 2025
8a24232
error message fix
andrei-marinica Aug 19, 2025
7914cc6
mandos - contract upgrade (hardened managed slices in framework)
andrei-marinica Aug 19, 2025
bc84e5b
Merge branch 'start-resolving-todos' into todos-test-fix
andrei-marinica Aug 19, 2025
fff1b08
Merge pull request #966 from multiversx/todos-test-fix
andrei-marinica Aug 19, 2025
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
8 changes: 8 additions & 0 deletions integrationTests/json/scenariosFeatures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,11 @@ func TestBalanceAfterGet(t *testing.T) {
Run().
CheckNoError()
}

func TestNFTDecode(t *testing.T) {
ScenariosTest(t).
Folder("features/composability/scenarios").
File("forwarder_nft_decode_complex_attributes.scen.json").
Run().
CheckNoError()
}
14 changes: 4 additions & 10 deletions mock/context/runtimeContextMock.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *RuntimeContextMock) GetVMExecutor() executor.Executor {
}

// ReplaceVMExecutor mocked method
func (context *RuntimeContextMock) ReplaceVMExecutor(vmExecutor executor.Executor) {
func (context *RuntimeContextMock) ReplaceVMExecutor(_ executor.Executor) {
}

// GetInstanceTracker mocked method
Expand Down Expand Up @@ -196,14 +196,8 @@ func (r *RuntimeContextMock) GetOriginalTxHash() []byte {
return r.OriginalTxHash
}

// ExtractCodeUpgradeFromArgs mocked method
func (r *RuntimeContextMock) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error) {
arguments := r.VMInput.Arguments
if len(arguments) < 2 {
panic("ExtractCodeUpgradeFromArgs: bad test setup")
}

return r.VMInput.Arguments[0], r.VMInput.Arguments[1], nil
// RemoveCodeUpgradeFromArgs mocked method
func (r *RuntimeContextMock) RemoveCodeUpgradeFromArgs() {
}

// SignalExit mocked method
Expand Down Expand Up @@ -259,7 +253,7 @@ func (r *RuntimeContextMock) GetInstance() executor.Instance {
}

// GetWarmInstance mocked method
func (r *RuntimeContextMock) GetWarmInstance(codeHash []byte) (executor.Instance, bool) {
func (r *RuntimeContextMock) GetWarmInstance(_ []byte) (executor.Instance, bool) {
return nil, false
}

Expand Down
12 changes: 6 additions & 6 deletions mock/context/runtimeContextWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type RuntimeContextWrapper struct {
// function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function)
GetOriginalTxHashFunc func() []byte
// function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function)
ExtractCodeUpgradeFromArgsFunc func() ([]byte, []byte, error)
RemoveCodeUpgradeFromArgsFunc func()
// function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function)
SignalUserErrorFunc func(message string)
// function that will be called by the corresponding RuntimeContext function implementation (by default this will call the same wrapped context function)
Expand Down Expand Up @@ -184,8 +184,8 @@ func NewRuntimeContextWrapper(inputRuntimeContext *vmhost.RuntimeContext) *Runti
return runtimeWrapper.runtimeContext.GetOriginalTxHash()
}

runtimeWrapper.ExtractCodeUpgradeFromArgsFunc = func() ([]byte, []byte, error) {
return runtimeWrapper.runtimeContext.ExtractCodeUpgradeFromArgs()
runtimeWrapper.RemoveCodeUpgradeFromArgsFunc = func() {
runtimeWrapper.runtimeContext.RemoveCodeUpgradeFromArgs()
}

runtimeWrapper.SignalUserErrorFunc = func(message string) {
Expand Down Expand Up @@ -374,9 +374,9 @@ func (contextWrapper *RuntimeContextWrapper) GetOriginalTxHash() []byte {
return contextWrapper.GetOriginalTxHashFunc()
}

// ExtractCodeUpgradeFromArgs calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (contextWrapper *RuntimeContextWrapper) ExtractCodeUpgradeFromArgs() ([]byte, []byte, error) {
return contextWrapper.ExtractCodeUpgradeFromArgsFunc()
// RemoveCodeUpgradeFromArgs calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
func (contextWrapper *RuntimeContextWrapper) RemoveCodeUpgradeFromArgs() {
contextWrapper.RemoveCodeUpgradeFromArgsFunc()
}

// SignalUserError calls corresponding xxxFunc function, that by default in turn calls the original method of the wrapped RuntimeContext
Expand Down
6 changes: 5 additions & 1 deletion mock/context/vmHostStub.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package mock

import (
"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/data/vm"
"github.com/multiversx/mx-chain-scenario-go/worldmock"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
"github.com/multiversx/mx-chain-vm-go/config"
"github.com/multiversx/mx-chain-vm-go/crypto"
Expand Down Expand Up @@ -165,7 +167,9 @@ func (vhs *VMHostStub) EnableEpochsHandler() vmhost.EnableEpochsHandler {
if vhs.EnableEpochsHandlerCalled != nil {
return vhs.EnableEpochsHandlerCalled()
}
return nil
return &worldmock.EnableEpochsHandlerStub{IsFlagEnabledCalled: func(flag core.EnableEpochFlag) bool {
return true
}}
}

// Async mocked method
Expand Down
10 changes: 9 additions & 1 deletion mock/contracts/deployerSimpleSC.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package contracts

import (
"errors"
vmcommon "github.com/multiversx/mx-chain-vm-common-go"
"github.com/multiversx/mx-chain-vm-go/vmhost"
"math/big"

mock "github.com/multiversx/mx-chain-vm-go/mock/context"
Expand Down Expand Up @@ -39,7 +42,12 @@ func DeployContractFromSourceMock(instanceMock *mock.InstanceMock, _ interface{}
)

if err != nil {
host.Runtime().FailExecution(err)
if errors.Is(err, vmhost.ErrNotEnoughGas) {
host.Output().SetReturnCode(vmcommon.OutOfGas)
} else {
host.Runtime().FailExecution(err)
}

return instance
}

Expand Down
18 changes: 9 additions & 9 deletions mock/mockery/AsnycContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,27 @@ func (_m *MockAsyncContext) Execute() error {
return r0
}

// ExecuteSyncCallbackAndFinishOutput provides a mock function with given fields: asyncCall, vmOutput, destinationCallInput, gasAccumulated, err
func (_m *MockAsyncContext) ExecuteSyncCallbackAndFinishOutput(asyncCall *vmhost.AsyncCall, vmOutput *vmcommon.VMOutput, destinationCallInput *vmcommon.ContractCallInput, gasAccumulated uint64, err error) (bool, *vmcommon.VMOutput) {
ret := _m.Called(asyncCall, vmOutput, destinationCallInput, gasAccumulated, err)
// ExecuteLocalCallbackAndFinishOutput provides a mock function with given fields: asyncCall, vmOutput, destinationCallInput, gasAccumulated, err
func (_m *MockAsyncContext) ExecuteLocalCallbackAndFinishOutput(asyncCall *vmhost.AsyncCall, vmOutput *vmcommon.VMOutput, gasAccumulated uint64, err error) (bool, *vmcommon.VMOutput) {
ret := _m.Called(asyncCall, vmOutput, gasAccumulated, err)

if len(ret) == 0 {
return true, &vmcommon.VMOutput{}
}

var r0 bool
var r1 *vmcommon.VMOutput
if rf, ok := ret.Get(0).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, *vmcommon.ContractCallInput, uint64, error) (bool, *vmcommon.VMOutput)); ok {
return rf(asyncCall, vmOutput, destinationCallInput, gasAccumulated, err)
if rf, ok := ret.Get(0).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, uint64, error) (bool, *vmcommon.VMOutput)); ok {
return rf(asyncCall, vmOutput, gasAccumulated, err)
}
if rf, ok := ret.Get(0).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, *vmcommon.ContractCallInput, uint64, error) bool); ok {
r0 = rf(asyncCall, vmOutput, destinationCallInput, gasAccumulated, err)
if rf, ok := ret.Get(0).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, uint64, error) bool); ok {
r0 = rf(asyncCall, vmOutput, gasAccumulated, err)
} else {
r0 = ret.Get(0).(bool)
}

if rf, ok := ret.Get(1).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, *vmcommon.ContractCallInput, uint64, error) *vmcommon.VMOutput); ok {
r1 = rf(asyncCall, vmOutput, destinationCallInput, gasAccumulated, err)
if rf, ok := ret.Get(1).(func(*vmhost.AsyncCall, *vmcommon.VMOutput, uint64, error) *vmcommon.VMOutput); ok {
r1 = rf(asyncCall, vmOutput, gasAccumulated, err)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*vmcommon.VMOutput)
Expand Down
4 changes: 4 additions & 0 deletions mock/mockery/RuntimeContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ type MockRuntimeContext struct {
mock.Mock
}

// RemoveCodeUpgradeFromArgs -
func (_m *MockRuntimeContext) RemoveCodeUpgradeFromArgs() {
}

// AddError provides a mock function with given fields: err, otherInfo
func (_m *MockRuntimeContext) AddError(err error, otherInfo ...string) {
_va := make([]interface{}, len(otherInfo))
Expand Down
12 changes: 0 additions & 12 deletions scenario/gasSchedules/gasSchedules.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package gasschedules

// TODO: go:embed can be used after we upgrade to go 1.16
// import _ "embed"

// //go:embed gasScheduleV1.toml
// var gasScheduleV1 string

// //go:embed gasScheduleV2.toml
// var gasScheduleV2 string

// //go:embed gasScheduleV3.toml
// var gasScheduleV3 string

//go:generate go run scripts/includetoml.go

// GetV3 yields the schedule V3
Expand Down
Loading
Loading