Skip to content

Commit

Permalink
fix for account processor and sbt (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkosecki authored Feb 14, 2022
1 parent 889dbe6 commit 0947172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,20 @@ class AccountsProcessor(
*/
def extractBakersInfo(
taggedAccounts: Seq[BlockTagged[AccountsIndex]]
): (List[BlockTagged[AccountsIndex]], List[BlockTagged[DelegateKeys]]) =
): (List[BlockTagged[AccountsIndex]], List[BlockTagged[DelegateKeys]]) = {
val taggedList = taggedAccounts.toList
if (enabledFeatures.bakerFeaturesAreOn) {
val taggedList = taggedAccounts.toList

def extractBakerKey(account: Account): Option[PublicKeyHash] =
PartialFunction.condOpt(account.delegate) {
case Some(Right(pkh)) => pkh
case Some(Left(Protocol4Delegate(_, Some(pkh)))) => pkh
}

val taggedBakersKeys = taggedList.map(taggedIndex =>
taggedIndex.map(accountsIndex => accountsIndex.values.toList.mapFilter(extractBakerKey))
)
(taggedList, taggedBakersKeys)
} else (List.empty, List.empty)

} else (taggedList, List.empty)
}
/** Starting from accounts grouped by block, and the correspoding delegates,
* we compute extra information and store everything in the database.
* All of this is done on a "page" of those values, which represents a chunk
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.1
sbt.version=1.5.8

0 comments on commit 0947172

Please sign in to comment.