Skip to content

Commit a4b6370

Browse files
committed
chore: allow creating ClarityTransactionConnection
1 parent 9110eb1 commit a4b6370

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

stackslib/src/clarity_vm/clarity.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,31 @@ pub struct ClarityTransactionConnection<'a, 'b> {
141141
epoch: StacksEpochId,
142142
}
143143

144+
impl<'a, 'b> ClarityTransactionConnection<'a, 'b> {
145+
pub fn new(
146+
store: &'b mut dyn ClarityBackingStore,
147+
header_db: &'a dyn HeadersDB,
148+
burn_state_db: &'a dyn BurnStateDB,
149+
cost_track: &'a mut Option<LimitedCostTracker>,
150+
mainnet: bool,
151+
chain_id: u32,
152+
epoch: StacksEpochId,
153+
) -> ClarityTransactionConnection<'a, 'b> {
154+
let mut log = RollbackWrapperPersistedLog::new();
155+
log.nest();
156+
ClarityTransactionConnection {
157+
log: Some(log),
158+
store,
159+
header_db,
160+
burn_state_db,
161+
cost_track,
162+
mainnet,
163+
chain_id,
164+
epoch,
165+
}
166+
}
167+
}
168+
144169
pub struct ClarityReadOnlyConnection<'a> {
145170
datastore: ReadOnlyMarfStore<'a>,
146171
header_db: &'a dyn HeadersDB,

0 commit comments

Comments
 (0)