diff --git a/core/chains/evm/types/types.go b/core/chains/evm/types/types.go index 230d59c0cd5..2476f87064b 100644 --- a/core/chains/evm/types/types.go +++ b/core/chains/evm/types/types.go @@ -21,14 +21,8 @@ import ( ) type ORM interface { - Chain(id utils.Big, qopts ...pg.QOpt) (chain DBChain, err error) - Chains(offset, limit int, qopts ...pg.QOpt) ([]DBChain, int, error) - GetChainsByIDs(ids []utils.Big) (chains []DBChain, err error) - - GetNodesByChainIDs(chainIDs []utils.Big, qopts ...pg.QOpt) (nodes []Node, err error) - NodeNamed(string, ...pg.QOpt) (Node, error) - Nodes(offset, limit int, qopts ...pg.QOpt) ([]Node, int, error) - NodesForChain(chainID utils.Big, offset, limit int, qopts ...pg.QOpt) ([]Node, int, error) + chains.ChainsORM[utils.Big, *ChainCfg, DBChain] + chains.NodesORM[utils.Big, Node] EnsureChains([]utils.Big, ...pg.QOpt) error } diff --git a/core/chains/solana/orm.go b/core/chains/solana/orm.go index 205071ec438..b589dd9af87 100644 --- a/core/chains/solana/orm.go +++ b/core/chains/solana/orm.go @@ -14,14 +14,8 @@ type DBChain = chains.DBChain[string, *soldb.ChainCfg] // ORM manages solana chains and nodes. type ORM interface { - Chain(string, ...pg.QOpt) (DBChain, error) - Chains(offset, limit int, qopts ...pg.QOpt) ([]DBChain, int, error) - GetChainsByIDs(ids []string) (chains []DBChain, err error) - - GetNodesByChainIDs(chainIDs []string, qopts ...pg.QOpt) (nodes []soldb.Node, err error) - NodeNamed(string, ...pg.QOpt) (soldb.Node, error) - Nodes(offset, limit int, qopts ...pg.QOpt) (nodes []soldb.Node, count int, err error) - NodesForChain(chainID string, offset, limit int, qopts ...pg.QOpt) (nodes []soldb.Node, count int, err error) + chains.ChainsORM[string, *soldb.ChainCfg, DBChain] + chains.NodesORM[string, soldb.Node] EnsureChains([]string, ...pg.QOpt) error } diff --git a/core/chains/starknet/types/types.go b/core/chains/starknet/types/types.go index d87be3b57a1..3dbd8e0d665 100644 --- a/core/chains/starknet/types/types.go +++ b/core/chains/starknet/types/types.go @@ -8,14 +8,8 @@ import ( ) type ORM interface { - Chain(string, ...pg.QOpt) (DBChain, error) - Chains(offset, limit int, qopts ...pg.QOpt) ([]DBChain, int, error) - GetChainsByIDs(ids []string) (chains []DBChain, err error) - - GetNodesByChainIDs(chainIDs []string, qopts ...pg.QOpt) (nodes []db.Node, err error) - NodeNamed(string, ...pg.QOpt) (db.Node, error) - Nodes(offset, limit int, qopts ...pg.QOpt) (nodes []db.Node, count int, err error) - NodesForChain(chainID string, offset, limit int, qopts ...pg.QOpt) (nodes []db.Node, count int, err error) + chains.ChainsORM[string, *db.ChainCfg, DBChain] + chains.NodesORM[string, db.Node] EnsureChains([]string, ...pg.QOpt) error }