erigon-pulse/cmd/rpcdaemon22/commands/db_api_deprecated.go
ledgerwatch 8e3ac8a21c
Erigon2 upgrade 2 prototype (#4341)
* Erigon2 upgrade 2 prototype

* Latest erigon-lib

* Fixes

* Fix print

* Fix maxSpan

* Reduce maxSpan

* Remove duplicate joins

* TxNum

* Fix resuming

* first draft of history22

* Introduce historical reads

* Update to erigon-lib

* Update erigon-lib

* Update erigon-lib

* Fixes and tracing for checkChangeSets

* More trace

* Print account details

* fix getHeader

* Update to erigon-lib main

* Add tracer indices and event log indices

* Fix calltracer

* Fix calltracer

* Duplicate rpcdaemon into rpcdaemon22

* Fix tests

* Fix tests

* Fix tests

* Update to latest erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-10 16:18:43 +01:00

53 lines
1.9 KiB
Go

package commands
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon/common/hexutil"
)
// DBAPI the interface for the db_ RPC commands (deprecated)
type DBAPI interface {
GetString(_ context.Context, _ string, _ string) (string, error)
PutString(_ context.Context, _ string, _ string, _ string) (bool, error)
GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error)
PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error)
}
// DBAPIImpl data structure to store things needed for db_ commands
type DBAPIImpl struct {
unused uint64
}
// NewDBAPIImpl returns NetAPIImplImpl instance
func NewDBAPIImpl() *DBAPIImpl {
return &DBAPIImpl{
unused: uint64(0),
}
}
// GetString implements db_getString. Returns string from the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_getString")
}
// PutString implements db_putString. Stores a string in the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (bool, error) {
return false, fmt.Errorf(NotAvailableDeprecated, "db_putString")
}
// GetHex implements db_getHex. Returns binary data from the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error) {
return hexutil.Bytes(""), fmt.Errorf(NotAvailableDeprecated, "db_getHex")
}
// PutHex implements db_putHex. Stores binary data in the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error) {
return false, fmt.Errorf(NotAvailableDeprecated, "db_putHex")
}