Documentation ¶
Index ¶
- Variables
- func AddGethAddressToMockRows(mock pgxmock.PgxPoolIface, dataList []GethAddress) *pgxmock.Rows
- func GetTotalGethAddressCount(dbConnPgx utils.PgxIface) (*int, error)
- func InsertGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (int, error)
- func InsertGethAddressList(dbConnPgx utils.PgxIface, gethAddressList []GethAddress) error
- func RemoveGethAddress(dbConnPgx utils.PgxIface, gethAddressID *int) error
- func UpdateGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) error
- type GethAddress
- func CreateEOAOrContractAddress(dbConnPgx utils.PgxIface, addressStr string, cl *ethclient.Client) (*GethAddress, error)
- func CreateGethAddress(addressStr string, isEOA bool) (*GethAddress, error)
- func CreateOrGetAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (*GethAddress, error)
- func CreateOrGetContractAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
- func CreateOrGetContractAddressFromAsset(dbConnPgx utils.PgxIface, asset *asset.Asset) (*GethAddress, error)
- func CreateOrGetEOAAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
- func GetGethAddress(dbConnPgx utils.PgxIface, gethAddressID *int) (*GethAddress, error)
- func GetGethAddressByAddressStr(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
- func GetGethAddressList(dbConnPgx utils.PgxIface) ([]GethAddress, error)
- func GetGethAddressListByAddressStr(dbConnPgx utils.PgxIface, addressStrList []string) ([]GethAddress, error)
- func GetGethAddressListByIds(dbConnPgx utils.PgxIface, addressIDs []int) ([]GethAddress, error)
- func GetGethAddressListByPagination(dbConnPgx utils.PgxIface, _start, _end *int, _order, _sort string, ...) ([]GethAddress, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DBColumns = []string{
"id",
"uuid",
"name",
"alternate_name",
"description",
"address_str",
"address_type_id",
"created_by",
"created_at",
"updated_by",
"updated_at",
}
View Source
var DBColumnsInsertGethAddressList = []string{
"uuid",
"name",
"alternate_name",
"description",
"address_str",
"address_type_id",
"created_by",
"created_at",
"updated_by",
"updated_at",
}
View Source
var TestAllData = []GethAddress{TestData1, TestData2}
View Source
var TestData1 = GethAddress{ ID: utils.Ptr[int](1), UUID: "880607ab-2833-4ad7-a231-b983a61c7b39", Name: "EOA: 0xFC3d170c29581E60861Ac2b500b098722d9861e9", AlternateName: "EOA: 0xFC3d170c29581E60861Ac2b500b098722d9861e9", Description: "", AddressStr: "0xFC3d170c29581E60861Ac2b500b098722d9861e9", AddressTypeID: utils.Ptr[int](utils.EOA_ADDRESS_TYPE_STRUCTURED_VALUE_ID), CreatedBy: "SYSTEM", CreatedAt: utils.SampleCreatedAtTime, UpdatedBy: "SYSTEM", UpdatedAt: utils.SampleCreatedAtTime, }
View Source
var TestData2 = GethAddress{ ID: utils.Ptr[int](2), UUID: "880607ab-2833-4ad7-a231-b983a61cad34", Name: "Contract: 0x40762e9b87aa6457f069925a86352d13339cb68f", AlternateName: "Contract: 0x40762e9b87aa6457f069925a86352d13339cb68f", Description: "", AddressStr: "0x40762e9b87aa6457f069925a86352d13339cb68f", AddressTypeID: utils.Ptr[int](utils.CONTRACT_ADDRESS_TYPE_STRUCTURED_VALUE_ID), CreatedBy: "SYSTEM", CreatedAt: utils.SampleCreatedAtTime, UpdatedBy: "SYSTEM", UpdatedAt: utils.SampleCreatedAtTime, }
Functions ¶
func AddGethAddressToMockRows ¶
func AddGethAddressToMockRows(mock pgxmock.PgxPoolIface, dataList []GethAddress) *pgxmock.Rows
func InsertGethAddress ¶
func InsertGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (int, error)
func InsertGethAddressList ¶
func InsertGethAddressList(dbConnPgx utils.PgxIface, gethAddressList []GethAddress) error
func UpdateGethAddress ¶
func UpdateGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) error
Types ¶
type GethAddress ¶
type GethAddress struct { ID *int `json:"id" db:"id"` //1 UUID string `json:"uuid" db:"uuid"` //2 Name string `json:"name" db:"name" db:"name"` //3 AlternateName string `json:"alternateName" db:"alternate_name"` //4 Description string `json:"description" db:"description"` //5 AddressStr string `json:"addressStr" db:"address_str"` //6 AddressTypeID *int `json:"addressTypeId" db:"address_type_id"` //7 CreatedBy string `json:"createdBy" db:"created_by"` //8 CreatedAt time.Time `json:"createdAt" db:"created_at"` //9 UpdatedBy string `json:"updatedBy" db:"updated_by"` //10 UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` //11 }
func CreateEOAOrContractAddress ¶
func CreateEOAOrContractAddress(dbConnPgx utils.PgxIface, addressStr string, cl *ethclient.Client) (*GethAddress, error)
TODO: skip test (need to mock ethclient)
func CreateGethAddress ¶
func CreateGethAddress(addressStr string, isEOA bool) (*GethAddress, error)
func CreateOrGetAddress ¶
func CreateOrGetAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (*GethAddress, error)
func CreateOrGetContractAddress ¶
func CreateOrGetContractAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
func CreateOrGetEOAAddress ¶
func CreateOrGetEOAAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
func GetGethAddress ¶
func GetGethAddress(dbConnPgx utils.PgxIface, gethAddressID *int) (*GethAddress, error)
func GetGethAddressByAddressStr ¶
func GetGethAddressByAddressStr(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)
func GetGethAddressList ¶
func GetGethAddressList(dbConnPgx utils.PgxIface) ([]GethAddress, error)
func GetGethAddressListByAddressStr ¶
func GetGethAddressListByAddressStr(dbConnPgx utils.PgxIface, addressStrList []string) ([]GethAddress, error)
func GetGethAddressListByIds ¶
func GetGethAddressListByIds(dbConnPgx utils.PgxIface, addressIDs []int) ([]GethAddress, error)
func GetGethAddressListByPagination ¶
func GetGethAddressListByPagination(dbConnPgx utils.PgxIface, _start, _end *int, _order, _sort string, _filters []string) ([]GethAddress, error)
for refinedev
Click to show internal directories.
Click to hide internal directories.