@@ -1326,16 +1326,6 @@ func (s *SupplyCommitMachine) ApplyStateTransition(
1326
1326
dbTransition := dbTransitionRow .SupplyCommitTransition
1327
1327
transitionID := dbTransition .TransitionID
1328
1328
1329
- // Next, we'll apply all the pending updates to the supply
1330
- // sub-trees, then use that to update the root tree.
1331
- _ , err = applySupplyUpdatesInternal (
1332
- ctx , db , assetSpec , transition .PendingUpdates ,
1333
- )
1334
- if err != nil {
1335
- return fmt .Errorf ("failed to apply SMT updates: " +
1336
- "%w" , err )
1337
- }
1338
-
1339
1329
// Next, we'll update the supply commitment data, before we do
1340
1330
// that, perform some basic sanity checks.
1341
1331
if ! dbTransition .NewCommitmentID .Valid {
@@ -1349,15 +1339,19 @@ func (s *SupplyCommitMachine) ApplyStateTransition(
1349
1339
}
1350
1340
chainTxnID := dbTransition .PendingCommitTxnID .Int64
1351
1341
1352
- // Update the commitment record with the calculated root hash
1353
- // and sum.
1342
+ // Next, we'll apply all the pending updates to the supply
1343
+ // sub-trees, then use that to update the root tree.
1344
+ //
1354
1345
finalRootSupplyRoot , err := applySupplyUpdatesInternal (
1355
1346
ctx , db , assetSpec , transition .PendingUpdates ,
1356
1347
)
1357
1348
if err != nil {
1358
1349
return fmt .Errorf ("failed to apply SMT updates: " +
1359
1350
"%w" , err )
1360
1351
}
1352
+
1353
+ // Update the commitment record with the calculated root hash
1354
+ // and sum.
1361
1355
finalRootHash := finalRootSupplyRoot .NodeHash ()
1362
1356
finalRootSum := finalRootSupplyRoot .NodeSum ()
1363
1357
err = db .UpdateSupplyCommitmentRoot (
0 commit comments