@@ -30,7 +30,7 @@ use mithril_persistence::sqlite::GetAllProvider;
30
30
/// This is a business oriented layer to perform actions on the database through
31
31
/// providers.
32
32
pub struct CardanoTransactionRepository {
33
- pub connection : Arc < SqliteConnection > ,
33
+ connection : Arc < SqliteConnection > ,
34
34
}
35
35
36
36
impl CardanoTransactionRepository {
@@ -116,21 +116,6 @@ impl CardanoTransactionRepository {
116
116
let records: Vec < CardanoTransactionRecord > =
117
117
transactions. into_iter ( ) . map ( |tx| tx. into ( ) ) . collect ( ) ;
118
118
119
- let provider = InsertCardanoTransactionProvider :: new ( & self . connection ) ;
120
- let filters = provider. get_insert_many_condition ( records) ?;
121
- provider. find ( filters) ?. next ( ) ;
122
-
123
- Ok ( vec ! [ ] )
124
- }
125
-
126
- /// Create new [CardanoTransactionRecord]s in the database.
127
- pub async fn create_transactions_and_collect < T : Into < CardanoTransactionRecord > > (
128
- & self ,
129
- transactions : Vec < T > ,
130
- ) -> StdResult < Vec < CardanoTransactionRecord > > {
131
- let records: Vec < CardanoTransactionRecord > =
132
- transactions. into_iter ( ) . map ( |tx| tx. into ( ) ) . collect ( ) ;
133
-
134
119
let provider = InsertCardanoTransactionProvider :: new ( & self . connection ) ;
135
120
let filters = provider. get_insert_many_condition ( records) ?;
136
121
let cursor = provider. find ( filters) ?;
@@ -153,34 +138,6 @@ impl CardanoTransactionRepository {
153
138
Ok ( cursor. collect ( ) )
154
139
}
155
140
156
- pub async fn store_transactions_with_chunks_size (
157
- & self ,
158
- transactions : Vec < CardanoTransaction > ,
159
- chunks_size : usize ,
160
- ) -> StdResult < ( ) > {
161
- // Chunk transactions to avoid an error when we exceed sqlite binding limitations
162
- for transactions_in_chunk in transactions. chunks ( chunks_size) {
163
- self . create_transactions ( transactions_in_chunk. to_vec ( ) )
164
- . await
165
- . with_context ( || "CardanoTransactionRepository can not store transactions" ) ?;
166
- }
167
- Ok ( ( ) )
168
- }
169
-
170
- pub async fn store_transactions_with_chunks_size_and_collect (
171
- & self ,
172
- transactions : Vec < CardanoTransaction > ,
173
- chunks_size : usize ,
174
- ) -> StdResult < ( ) > {
175
- // Chunk transactions to avoid an error when we exceed sqlite binding limitations
176
- for transactions_in_chunk in transactions. chunks ( chunks_size) {
177
- self . create_transactions_and_collect ( transactions_in_chunk. to_vec ( ) )
178
- . await
179
- . with_context ( || "CardanoTransactionRepository can not store transactions" ) ?;
180
- }
181
- Ok ( ( ) )
182
- }
183
-
184
141
// TODO: remove this function when the Cardano transaction signature is based on block number instead of immutable number
185
142
async fn get_highest_block_number_for_immutable_number (
186
143
& self ,
@@ -281,7 +238,7 @@ impl TransactionStore for CardanoTransactionRepository {
281
238
async fn store_transactions ( & self , transactions : Vec < CardanoTransaction > ) -> StdResult < ( ) > {
282
239
// Chunk transactions to avoid an error when we exceed sqlite binding limitations
283
240
for transactions_in_chunk in transactions. chunks ( 100 ) {
284
- self . create_transactions_and_collect ( transactions_in_chunk. to_vec ( ) )
241
+ self . create_transactions ( transactions_in_chunk. to_vec ( ) )
285
242
. await
286
243
. with_context ( || "CardanoTransactionRepository can not store transactions" ) ?;
287
244
}
0 commit comments