@@ -10,8 +10,8 @@ use runtime_support::{StorageMap, StorageValue};
10
10
11
11
pub use self :: proposal:: { handle_proposal, Proposal } ;
12
12
use super :: {
13
- AccountMap , AddressMap , BlockHeaderFor , BlockTxids , CertCache , CandidateTx , DepositCache ,
14
- NetworkId , NumberForHash , RegInfoMaxIndex , RegInfoSet , ReceiveAddress , RedeemScript , Trait ,
13
+ AccountMap , AddressMap , BlockHeaderFor , BlockTxids , CandidateTx , CertCache , DepositCache ,
14
+ NetworkId , NumberForHash , ReceiveAddress , RedeemScript , RegInfoMaxIndex , RegInfoSet , Trait ,
15
15
TxProposal , TxSet , TxType , UTXOMaxIndex , UTXOSet ,
16
16
} ;
17
17
use b58:: from;
@@ -149,7 +149,10 @@ impl<T: Trait> TxStorage<T> {
149
149
// todo 检查block是否存在
150
150
<BlockTxids < T > >:: mutate ( block_hash. clone ( ) , |v| v. push ( hash. clone ( ) ) ) ;
151
151
152
- <TxSet < T > >:: insert ( hash, ( who. clone ( ) , address, tx_type, balance, block_hash, tx) ) ;
152
+ <TxSet < T > >:: insert (
153
+ hash,
154
+ ( who. clone ( ) , address, tx_type, balance, block_hash, tx) ,
155
+ ) ;
153
156
}
154
157
155
158
fn find_tx ( txid : & H256 ) -> Option < Transaction > {
@@ -220,7 +223,16 @@ impl<T: Trait> RollBack<T> for TxStorage<T> {
220
223
struct RegInfoStorage < T : Trait > ( PhantomData < T > ) ;
221
224
222
225
impl < T : Trait > RegInfoStorage < T > {
223
- fn add ( accounts : ( H256 , keys:: Address , T :: AccountId , T :: BlockNumber , Vec < u8 > , TxType ) ) {
226
+ fn add (
227
+ accounts : (
228
+ H256 ,
229
+ keys:: Address ,
230
+ T :: AccountId ,
231
+ T :: BlockNumber ,
232
+ Vec < u8 > ,
233
+ TxType ,
234
+ ) ,
235
+ ) {
224
236
let mut index = <RegInfoMaxIndex < T > >:: get ( ) ;
225
237
<RegInfoSet < T > >:: insert ( index, accounts. clone ( ) ) ;
226
238
index += 1 ;
@@ -499,8 +511,14 @@ pub fn handle_output<T: Trait>(
499
511
runtime_io:: print ( "----new account-------" ) ;
500
512
let time = <system:: Module < T > >:: block_number ( ) ;
501
513
let chainxaddr = <AddressMap < T > >:: get ( send_address. clone ( ) ) . unwrap ( ) ;
502
- let account = ( tx. hash ( ) , send_address. clone ( ) , chainxaddr, time,
503
- channel[ 2 ..] . to_vec ( ) , tx_type) ;
514
+ let account = (
515
+ tx. hash ( ) ,
516
+ send_address. clone ( ) ,
517
+ chainxaddr,
518
+ time,
519
+ channel[ 2 ..] . to_vec ( ) ,
520
+ tx_type,
521
+ ) ;
504
522
<RegInfoStorage < T > >:: add ( account) ;
505
523
runtime_io:: print ( "------insert new account in AccountsMap-----" ) ;
506
524
}
@@ -529,7 +547,7 @@ pub fn handle_cert<T: Trait>(
529
547
runtime_io:: print ( & account[ ..] ) ;
530
548
let id: T :: AccountId = Decode :: decode ( & mut account. as_slice ( ) ) . unwrap ( ) ;
531
549
532
- <CertCache < T > >:: put ( ( name[ 2 ..] . to_vec ( ) , id) ) ;
550
+ <CertCache < T > >:: put ( ( name[ 2 ..] . to_vec ( ) , id) ) ;
533
551
}
534
552
}
535
553
}
0 commit comments