@@ -808,9 +808,17 @@ function swap:
808808 assert_eq ! ( function. inputs( ) . len( ) , 2 ) ;
809809 assert_eq ! ( function. input_types( ) . len( ) , 2 ) ;
810810
811+ // Declare the expected input types.
812+ let expected_input_type_1 = ValueType :: ExternalRecord ( Locator :: from_str ( "eth.aleo/eth" ) ?) ;
813+ let expected_input_type_2 = ValueType :: ExternalRecord ( Locator :: from_str ( "usdc.aleo/usdc" ) ?) ;
814+
811815 // Ensure the inputs are external records.
812- assert_eq ! ( function. input_types( ) [ 0 ] , ValueType :: ExternalRecord ( Locator :: from_str( "eth.aleo/eth" ) ?) ) ;
813- assert_eq ! ( function. input_types( ) [ 1 ] , ValueType :: ExternalRecord ( Locator :: from_str( "usdc.aleo/usdc" ) ?) ) ;
816+ assert_eq ! ( function. input_types( ) [ 0 ] , expected_input_type_1) ;
817+ assert_eq ! ( function. input_types( ) [ 1 ] , expected_input_type_2) ;
818+
819+ // Ensure the input variants are correct.
820+ assert_eq ! ( function. input_types( ) [ 0 ] . variant( ) , expected_input_type_1. variant( ) ) ;
821+ assert_eq ! ( function. input_types( ) [ 1 ] . variant( ) , expected_input_type_2. variant( ) ) ;
814822
815823 // Ensure there are two instructions.
816824 assert_eq ! ( function. instructions( ) . len( ) , 2 ) ;
@@ -823,9 +831,17 @@ function swap:
823831 assert_eq ! ( function. outputs( ) . len( ) , 2 ) ;
824832 assert_eq ! ( function. output_types( ) . len( ) , 2 ) ;
825833
834+ // Declare the expected output types.
835+ let expected_output_type_1 = ValueType :: ExternalRecord ( Locator :: from_str ( "eth.aleo/eth" ) ?) ;
836+ let expected_output_type_2 = ValueType :: ExternalRecord ( Locator :: from_str ( "usdc.aleo/usdc" ) ?) ;
837+
826838 // Ensure the outputs are external records.
827- assert_eq ! ( function. output_types( ) [ 0 ] , ValueType :: ExternalRecord ( Locator :: from_str( "eth.aleo/eth" ) ?) ) ;
828- assert_eq ! ( function. output_types( ) [ 1 ] , ValueType :: ExternalRecord ( Locator :: from_str( "usdc.aleo/usdc" ) ?) ) ;
839+ assert_eq ! ( function. output_types( ) [ 0 ] , expected_output_type_1) ;
840+ assert_eq ! ( function. output_types( ) [ 1 ] , expected_output_type_2) ;
841+
842+ // Ensure the output variants are correct.
843+ assert_eq ! ( function. output_types( ) [ 0 ] . variant( ) , expected_output_type_1. variant( ) ) ;
844+ assert_eq ! ( function. output_types( ) [ 1 ] . variant( ) , expected_output_type_2. variant( ) ) ;
829845
830846 Ok ( ( ) )
831847 }
0 commit comments