2023-02-23 22:50:30 +00:00
|
|
|
package ipld_eth_statedb
|
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
var _ Database = &DB{}
|
2023-02-27 22:17:24 +00:00
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
// NewPostgresDB returns a postgres.DB using the provided driver
|
|
|
|
func NewPostgresDB(driver Driver) *DB {
|
|
|
|
return &DB{driver}
|
2023-03-05 07:33:51 +00:00
|
|
|
}
|
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
// DB implements sql.Database using a configured driver and Postgres statement syntax
|
|
|
|
type DB struct {
|
|
|
|
Driver
|
2023-02-23 22:50:30 +00:00
|
|
|
}
|
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
// GetContractCodeStmt satisfies the Statements interface
|
|
|
|
func (db *DB) GetContractCodeStmt() string {
|
|
|
|
return GetContractCodePgStr
|
2023-02-23 22:50:30 +00:00
|
|
|
}
|
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
// GetStateAccountStmt satisfies the Statements interface
|
|
|
|
func (db *DB) GetStateAccountStmt() string {
|
|
|
|
return GetStateAccount
|
2023-02-23 22:50:30 +00:00
|
|
|
}
|
|
|
|
|
2023-03-13 19:06:45 +00:00
|
|
|
// GetStorageSlotStmt satisfies the Statements interface
|
|
|
|
func (db *DB) GetStorageSlotStmt() string {
|
|
|
|
return GetStorageSlot
|
2023-02-23 22:50:30 +00:00
|
|
|
}
|