2021-03-31 14:51:13 +00:00
|
|
|
# Nimbus
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
|
|
|
|
# http://opensource.org/licenses/MIT)
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except
|
|
|
|
# according to those terms.
|
|
|
|
|
2021-03-31 17:08:31 +00:00
|
|
|
# At the moment, this header file interface is only used for testing.
|
|
|
|
|
2021-04-08 14:52:10 +00:00
|
|
|
when defined(evmc_enabled) or not defined(vm2_enabled):
|
|
|
|
import
|
|
|
|
./vm/memory as vmm
|
|
|
|
else:
|
|
|
|
import
|
2021-04-08 17:45:34 +00:00
|
|
|
./vm2/v2memory as vmm
|
2021-04-08 14:52:10 +00:00
|
|
|
|
2021-03-31 17:08:31 +00:00
|
|
|
export
|
|
|
|
vmm.Memory,
|
|
|
|
vmm.extend,
|
|
|
|
vmm.len,
|
|
|
|
vmm.newMemory,
|
|
|
|
vmm.read,
|
|
|
|
vmm.write
|
2021-03-31 14:51:13 +00:00
|
|
|
|
2021-03-31 17:08:31 +00:00
|
|
|
when defined(evmc_enabled):
|
|
|
|
export
|
|
|
|
vmm.readPtr
|
|
|
|
|
|
|
|
|
2021-04-08 14:52:10 +00:00
|
|
|
when defined(evmc_enabled) or not defined(vm2_enabled):
|
|
|
|
import
|
|
|
|
./vm/interpreter/utils/utils_numeric as vmn
|
|
|
|
else:
|
|
|
|
import
|
2021-04-08 17:45:34 +00:00
|
|
|
./vm2/interpreter/utils/v2utils_numeric as vmn
|
2021-04-08 14:52:10 +00:00
|
|
|
|
|
|
|
|
2021-03-31 14:51:13 +00:00
|
|
|
export
|
|
|
|
vmn.GasNatural,
|
|
|
|
vmn.calcMemSize,
|
|
|
|
vmn.ceil32,
|
|
|
|
vmn.cleanMemRef,
|
|
|
|
vmn.log2,
|
|
|
|
vmn.log256,
|
|
|
|
vmn.rangeToPadded,
|
|
|
|
vmn.rangeToPadded2,
|
|
|
|
vmn.safeInt,
|
|
|
|
vmn.setSign,
|
|
|
|
vmn.toInt,
|
|
|
|
vmn.wordCount
|
2021-03-31 17:08:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Wrapping the wrapper -- lol
|
2021-04-08 14:52:10 +00:00
|
|
|
when defined(evmc_enabled) or not defined(vm2_enabled):
|
|
|
|
import
|
|
|
|
./vm/interpreter as vmi
|
|
|
|
else:
|
|
|
|
import
|
2021-04-08 17:45:34 +00:00
|
|
|
./vm2/v2interpreter as vmi
|
2021-04-08 14:52:10 +00:00
|
|
|
|
2021-03-31 17:08:31 +00:00
|
|
|
export
|
|
|
|
vmi
|
|
|
|
|
2021-03-31 14:51:13 +00:00
|
|
|
# End
|