@@ -32,7 +32,7 @@ use trie::{self, Trie, TrieError, TrieFactory};
3232use unexpected:: Mismatch ;
3333
3434use self :: cache:: Cache ;
35- use super :: invoice:: { Invoice , TransactionOutcome } ;
35+ use super :: invoice:: Invoice ;
3636use super :: parcel:: ParcelError ;
3737use super :: state_db:: StateDB ;
3838use super :: { Transaction , TransactionError } ;
@@ -535,7 +535,7 @@ impl<B: Backend> State<B> {
535535 Ok ( _) => {
536536 cinfo ! ( TX , "Tx({}) is applied" , t. hash( ) ) ;
537537 self . discard_checkpoint ( TRANSACTION_CHECKPOINT ) ;
538- let invoice = Invoice :: new ( TransactionOutcome :: Success ) ;
538+ let invoice = Invoice :: Success ;
539539 let error = None ;
540540 ApplyOutcome {
541541 invoice,
@@ -545,7 +545,7 @@ impl<B: Backend> State<B> {
545545 Err ( Error :: Transaction ( err) ) => {
546546 cinfo ! ( TX , "Cannot apply Tx({}): {:?}" , t. hash( ) , err) ;
547547 self . revert_to_checkpoint ( TRANSACTION_CHECKPOINT ) ;
548- let invoice = Invoice :: new ( TransactionOutcome :: Failed ) ;
548+ let invoice = Invoice :: Failed ;
549549 let error = Some ( err) ;
550550 ApplyOutcome {
551551 invoice,
@@ -885,7 +885,7 @@ mod tests {
885885 let res = state. apply ( & signed_parcel) . unwrap ( ) ;
886886 assert_eq ! ( 1 , res. len( ) ) ;
887887 let res = & res[ 0 ] ;
888- assert_eq ! ( res. invoice. outcome , TransactionOutcome :: Success ) ;
888+ assert_eq ! ( res. invoice, Invoice :: Success ) ;
889889 assert ! ( res. error. is_none( ) ) ;
890890 assert_eq ! ( state. balance( & receiver) . unwrap( ) , 10 . into( ) ) ;
891891 assert_eq ! ( state. balance( & sender) . unwrap( ) , 5 . into( ) ) ;
@@ -918,7 +918,7 @@ mod tests {
918918 let res = state. apply ( & signed_parcel) . unwrap ( ) ;
919919 assert_eq ! ( 1 , res. len( ) ) ;
920920 let res = & res[ 0 ] ;
921- assert_eq ! ( res. invoice. outcome , TransactionOutcome :: Success ) ;
921+ assert_eq ! ( res. invoice, Invoice :: Success ) ;
922922 assert_eq ! ( state. regular_key( & sender) . unwrap( ) , Some ( key) ) ;
923923 }
924924
@@ -947,7 +947,7 @@ mod tests {
947947 let res = state. apply ( & signed_parcel) . unwrap ( ) ;
948948 assert_eq ! ( 1 , res. len( ) ) ;
949949 let res = & res[ 0 ] ;
950- assert_eq ! ( res. invoice. outcome , TransactionOutcome :: Failed ) ;
950+ assert_eq ! ( res. invoice, Invoice :: Failed ) ;
951951 assert_eq ! (
952952 res. error. as_ref( ) . unwrap( ) ,
953953 & TransactionError :: InsufficientBalance {
0 commit comments