File tree 1 file changed +8
-7
lines changed
sugondat-chain/pallets/blobs/src
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,17 @@ pub mod pallet {
117
117
#[ pallet:: hooks]
118
118
impl < T : Config > Hooks < BlockNumberFor < T > > for Pallet < T > {
119
119
fn on_initialize ( _: BlockNumberFor < T > ) -> Weight {
120
- let weight = T :: DbWeight :: get ( ) . reads_writes ( 1 , 0 ) ;
121
- TotalBlobsSize :: < T > :: kill ( ) ;
122
- TotalBlobs :: < T > :: kill ( ) ;
123
- BlobList :: < T > :: kill ( ) ;
124
- weight
120
+ // BlobList: 1r + 1w
121
+ // TotalBlobsSize: 1w
122
+ // TotalBlobs: 1w
123
+ // deposit_log: 1r + 1w
124
+ T :: DbWeight :: get ( ) . reads_writes ( 2 , 4 )
125
125
}
126
126
127
127
fn on_finalize ( _n : BlockNumberFor < T > ) {
128
- let blobs_metadata = BlobList :: < T > :: get ( ) ;
129
- let blobs = blobs_metadata
128
+ TotalBlobsSize :: < T > :: kill ( ) ;
129
+ TotalBlobs :: < T > :: kill ( ) ;
130
+ let blobs = BlobList :: < T > :: take ( )
130
131
. iter ( )
131
132
. map ( |blob| sugondat_nmt:: BlobMetadata {
132
133
namespace : sugondat_nmt:: Namespace :: from_u32_be ( blob. namespace_id ) ,
You can’t perform that action at this time.
0 commit comments