Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit fcedeff

Browse files
committed
save new trasition
1 parent dea78f4 commit fcedeff

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/bucketd/processor.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ impl Runtime {
262262
let node_id = transition.node_id();
263263
let transition_type = transition.transition_type();
264264
debug!("Processing state transition {}", node_id);
265-
trace!("State transition: {:?}", transition);
266265

267266
// TODO: refactoring this and move to rgb-core
267+
let new_transition: Transition;
268268
match reveal {
269269
Some(Reveal {
270270
blinding_factor,
@@ -321,7 +321,7 @@ impl Runtime {
321321
.insert(*owned_type, TypedAssignments::Value(revealed_assignment));
322322
}
323323

324-
let transition: Transition = Transition::with(
324+
let tmp: Transition = Transition::with(
325325
transition.transition_type().clone(),
326326
transition.metadata().clone(),
327327
transition.parent_public_rights().clone(),
@@ -330,15 +330,18 @@ impl Runtime {
330330
transition.parent_owned_rights().clone(),
331331
);
332332

333-
state.add_transition(witness_txid, &transition);
333+
new_transition = tmp;
334334
}
335-
_ => state.add_transition(witness_txid, transition),
335+
_ => new_transition = transition.clone()
336336
}
337+
338+
trace!("State transition: {:?}", new_transition);
339+
state.add_transition(witness_txid, &new_transition);
337340
trace!("Contract state now is {:?}", state);
338341

339342
trace!("Storing state transition data");
340343
data.push((node_id, inputs.clone()));
341-
self.store.store_merge(db::TRANSITIONS, node_id, transition.clone())?;
344+
self.store.store_merge(db::TRANSITIONS, node_id, new_transition.clone())?;
342345
self.store.store_sten(db::TRANSITION_WITNESS, node_id, &witness_txid)?;
343346

344347
trace!("Indexing transition");

0 commit comments

Comments
 (0)