Skip to content

Commit 5275db1

Browse files
committed
port 4ee9875
1 parent 3cb0a39 commit 5275db1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

blockchain.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,7 @@ func NewBlockchain(opts ...Option) (*Blockchain, error) {
391391
}
392392

393393
func configureFVM(conf config, blocks *blocks) (*fvm.VirtualMachine, fvm.Context, error) {
394-
rt := runtime.NewInterpreterRuntime(runtime.Config{})
395-
396-
vm := fvm.NewVirtualMachine(rt)
394+
vm := fvm.NewVirtualMachine()
397395

398396
fvmOptions := []fvm.Option{
399397
fvm.WithLogger(conf.Logger),
@@ -1031,8 +1029,7 @@ func (b *Blockchain) GetAccountStorage(address sdk.Address) (*AccountStorage, er
10311029

10321030
env := fvm.NewTransactionEnvironment(
10331031
b.vmCtx,
1034-
b.vm,
1035-
state.NewStateTransaction(
1032+
state.NewTransactionState(
10361033
view,
10371034
stateParameters,
10381035
),
@@ -1042,11 +1039,13 @@ func (b *Blockchain) GetAccountStorage(address sdk.Address) (*AccountStorage, er
10421039
nil,
10431040
)
10441041

1042+
r := b.vmCtx.Borrow(env)
1043+
defer b.vmCtx.Return(r)
10451044
ctx := runtime.Context{
10461045
Interface: env,
10471046
}
10481047

1049-
store, inter, err := b.vm.Runtime.Storage(ctx)
1048+
store, inter, err := r.Storage(ctx)
10501049
if err != nil {
10511050
return nil, err
10521051
}

0 commit comments

Comments
 (0)