Skip to content

Commit

Permalink
change preimage size to data count (#66)
Browse files Browse the repository at this point in the history
* #update  ignore

* try to fix ExtrinsicPreimages issue

* fix fixedSizeData issue

* try to fix ExtrinsicPreimages issue

* #update Preimages serviceIndices

* delete ReportItem guarantors

* change  preimage size to data count

* Update Blockchain/Sources/Blockchain/Runtime.swift

---------

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
  • Loading branch information
MacOMNI and xlc authored Aug 19, 2024
1 parent 35d570d commit faf31d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Blockchain/Sources/Blockchain/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ public final class Runtime {
item.blocks += 1
item.tickets += UInt32(block.extrinsic.tickets.tickets.count)
item.preimages += UInt32(block.extrinsic.preimages.preimages.count)
// try to change preimage size to serviceIndices
item.preimagesBytes += UInt32(block.extrinsic.preimages.preimages.reduce(into: 0) { $0 += $1.serviceIndices })
item.preimagesBytes += UInt32(block.extrinsic.preimages.preimages.reduce(into: 0) { $0 += $1.data.count })
acc[block.header.authorIndex] = item

for report in block.extrinsic.reports.guarantees {
Expand Down

0 comments on commit faf31d8

Please sign in to comment.