mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
1bd46089e9
* Starting process of rearranging RPC code * First version of automated testing * Putting RPC docs in their own folder * Fixing build * Making varible names more consistent * Adding deprecated RPC commands for db_ * Adding deprecated RPC commands for shh_ * Adding deprecated RPC commands for eth_
47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// 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) (string, error)
|
|
GetHex(_ context.Context, _ string, _ string) (string, error)
|
|
PutHex(_ context.Context, _ string, _ string, _ string) (string, 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 Returns string from the local database. (deprecated)
|
|
func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error) {
|
|
return "", fmt.Errorf(NotAvailableDeprecated, "db_getString")
|
|
}
|
|
|
|
// PutString Stores a string in the local database. (deprecated)
|
|
func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (string, error) {
|
|
return "", fmt.Errorf(NotAvailableDeprecated, "db_putString")
|
|
}
|
|
|
|
// GetHex Returns binary data from the local database. (deprecated)
|
|
func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (string, error) {
|
|
return "", fmt.Errorf(NotAvailableDeprecated, "db_getHex")
|
|
}
|
|
|
|
// PutHex Stores binary data in the local database. (deprecated)
|
|
func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ string) (string, error) {
|
|
return "", fmt.Errorf(NotAvailableDeprecated, "db_putHex")
|
|
}
|