native: implement management.getContractById
Follow neo-project/neo#2807. Notice that this data is not cached, our previous implementation wasn't too and it shouldn't be a problem (not on the hot path).
This commit is contained in:
parent
6c68da7a52
commit
970862765d
6 changed files with 143 additions and 19 deletions
|
@ -27,6 +27,7 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/core"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/interop/runtime"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/native"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/storage"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
|
||||
|
@ -856,8 +857,7 @@ func handleLoadDeployed(c *cli.Context) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed to parse contract hash, address or ID: %w", err)
|
||||
}
|
||||
bc := getChainFromContext(c.App)
|
||||
h, err = bc.GetContractScriptHash(int32(i)) // @fixme: can be improved after #2702 to retrieve historic state of destroyed contract by ID.
|
||||
h, err = native.GetContractScriptHash(ic.DAO, int32(i))
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to retrieve contract hash by ID: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue