Переглянути джерело

`Display` our compilation targets with capitalization (#1420)

Cyrill Leutwiler 2 роки тому
батько
коміт
c2c9e74ada

+ 3 - 3
src/lib.rs

@@ -36,9 +36,9 @@ pub enum Target {
 impl fmt::Display for Target {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
-            Target::Solana => write!(f, "solana"),
-            Target::Polkadot { .. } => write!(f, "polkadot"),
-            Target::EVM => write!(f, "evm"),
+            Target::Solana => write!(f, "Solana"),
+            Target::Polkadot { .. } => write!(f, "Polkadot"),
+            Target::EVM => write!(f, "EVM"),
         }
     }
 }

+ 1 - 1
src/sema/tests/mod.rs

@@ -619,6 +619,6 @@ contract Child {
     assert_eq!(errors.len(), 1);
     assert_eq!(
         errors[0].message,
-        "either 'address' or 'accounts' call argument is required on solana"
+        "either 'address' or 'accounts' call argument is required on Solana"
     );
 }

+ 3 - 3
src/sema/yul/tests/expression.rs

@@ -1589,7 +1589,7 @@ contract foo {
 
     let ns = parse_and_resolve(OsStr::new("test.sol"), &mut cache, Target::Solana);
 
-    assert!(ns.diagnostics.contains_message("builtin 'gaslimit' is not available for target solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
+    assert!(ns.diagnostics.contains_message("builtin 'gaslimit' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
 
     let file = r#"
 contract foo {
@@ -1613,7 +1613,7 @@ contract foo {
         },
     );
 
-    assert!(ns.diagnostics.contains_message("builtin 'coinbase' is not available for target polkadot. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
+    assert!(ns.diagnostics.contains_message("builtin 'coinbase' is not available for target Polkadot. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
 
     let file = r#"
     contract foo {
@@ -1630,5 +1630,5 @@ contract foo {
 
     let ns = parse_and_resolve(OsStr::new("test.sol"), &mut cache, Target::Solana);
 
-    assert!(ns.diagnostics.contains_message("builtin 'log0' is not available for target solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
+    assert!(ns.diagnostics.contains_message("builtin 'log0' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function"));
 }

+ 2 - 2
tests/contract_testcases/evm/comment_tests.sol

@@ -678,10 +678,10 @@ function _approve(
     //
 }/**//**//**//**//**//**//**///
 // ---- Expect: diagnostics ----
-// warning: 195:50-56: conversion truncates uint256 to uint128, as value is type uint128 on target evm
+// warning: 195:50-56: conversion truncates uint256 to uint128, as value is type uint128 on target EVM
 // warning: 268:17-25: function parameter 'weiValue' is unused
 // warning: 269:23-35: function parameter 'errorMessage' is unused
-// warning: 276:70-78: conversion truncates uint256 to uint128, as value is type uint128 on target evm
+// warning: 276:70-78: conversion truncates uint256 to uint128, as value is type uint128 on target EVM
 // warning: 321:9-17: 'internal': visibility for constructors is ignored
 // warning: 386:9-61: storage variable '_isExcluded' has never been used
 // warning: 390:9-51: storage variable 'MAX' has been assigned, but never read

+ 1 - 1
tests/contract_testcases/polkadot/functions/external_call_args.sol

@@ -68,4 +68,4 @@ contract Swap_ETH_TO_USDX {
     }
 }
 // ---- Expect: diagnostics ----
-// warning: 61:20-53: conversion truncates uint256 to uint128, as value is type uint128 on target polkadot
+// warning: 61:20-53: conversion truncates uint256 to uint128, as value is type uint128 on target Polkadot

+ 1 - 1
tests/contract_testcases/polkadot/primitives/address_09.sol

@@ -2,4 +2,4 @@ abstract contract test {
             address foo = 0x5b0Ddf2835f0A76c96D6113D47F6482e51a55487;
         }
 // ---- Expect: diagnostics ----
-// error: 2:27-69: ethereum address literal '0x5b0Ddf2835f0A76c96D6113D47F6482e51a55487' not supported on target polkadot
+// error: 2:27-69: ethereum address literal '0x5b0Ddf2835f0A76c96D6113D47F6482e51a55487' not supported on target Polkadot

+ 2 - 2
tests/contract_testcases/polkadot/primitives/units.sol

@@ -8,6 +8,6 @@
             }
         }
 // ---- Expect: diagnostics ----
-// warning: 4:27-34: ethereum currency unit used while targeting polkadot
-// warning: 5:29-34: solana currency unit used while targeting polkadot
+// warning: 4:27-34: ethereum currency unit used while targeting Polkadot
+// warning: 5:29-34: solana currency unit used while targeting Polkadot
 // error: 7:29-34: unknown unit 'dot'

+ 1 - 1
tests/contract_testcases/polkadot/storage/double_index_storage.sol

@@ -27,4 +27,4 @@ contract BeeeefRegistry {
     }
 }
 // ---- Expect: diagnostics ----
-// warning: 22:34-40: conversion truncates uint256 to uint32, as memory size is type uint32 on target polkadot
+// warning: 22:34-40: conversion truncates uint256 to uint32, as memory size is type uint32 on target Polkadot

+ 1 - 1
tests/contract_testcases/polkadot/value/external_call_value_09.sol

@@ -19,4 +19,4 @@
 // warning: 11:25-26: declaration of 'x' shadows state variable
 // 	note 8:13-18: previous declaration of state variable
 // warning: 11:25-26: local variable 'x' has been assigned, but never read
-// warning: 13:31-32: conversion truncates uint256 to uint128, as value is type uint128 on target polkadot
+// warning: 13:31-32: conversion truncates uint256 to uint128, as value is type uint128 on target Polkadot

+ 1 - 1
tests/contract_testcases/solana/call/call_args_three_ways.sol

@@ -20,7 +20,7 @@ contract D {
 }
 
 // ---- Expect: diagnostics ----
-// error: 4:9-28: either 'address' or 'accounts' call argument is required on solana
+// error: 4:9-28: either 'address' or 'accounts' call argument is required on Solana
 // error: 4:16-24: Solana Cross Program Invocation (CPI) cannot transfer native value. See https://solang.readthedocs.io/en/latest/language/functions.html#value_transfer
 // error: 10:10-18: Solana Cross Program Invocation (CPI) cannot transfer native value. See https://solang.readthedocs.io/en/latest/language/functions.html#value_transfer
 // error: 11:12-20: Solana Cross Program Invocation (CPI) cannot transfer native value. See https://solang.readthedocs.io/en/latest/language/functions.html#value_transfer

+ 1 - 1
tests/contract_testcases/solana/call/calltys_02.sol

@@ -7,4 +7,4 @@
             }
         }
 // ---- Expect: diagnostics ----
-// error: 6:51-57: 'gas' not permitted for external calls or constructors on solana
+// error: 6:51-57: 'gas' not permitted for external calls or constructors on Solana

+ 1 - 1
tests/contract_testcases/solana/create_contract/syntax.sol

@@ -7,4 +7,4 @@
         contract x {}
     
 // ---- Expect: diagnostics ----
-// error: 4:29-37: 'gas' not permitted for external calls or constructors on solana
+// error: 4:29-37: 'gas' not permitted for external calls or constructors on Solana

+ 1 - 1
tests/contract_testcases/solana/create_contract/syntax_01.sol

@@ -7,4 +7,4 @@
         contract x {}
     
 // ---- Expect: diagnostics ----
-// error: 4:29-38: 'salt' not permitted for external calls or constructors on solana
+// error: 4:29-38: 'salt' not permitted for external calls or constructors on Solana

+ 1 - 1
tests/contract_testcases/solana/destructure_assign_struct_member_2.sol

@@ -26,4 +26,4 @@ contract Contract {
 
 // ---- Expect: diagnostics ----
 // warning: 20:26-34: local variable 'struct_1' has been assigned, but never read
-// warning: 20:51-55: conversion truncates uint256 to uint32, as memory size is type uint32 on target solana
+// warning: 20:51-55: conversion truncates uint256 to uint32, as memory size is type uint32 on target Solana

+ 1 - 1
tests/contract_testcases/solana/expressions/contract_no_init.sol

@@ -15,4 +15,4 @@
             }
         }
 // ---- Expect: diagnostics ----
-// error: 11:25-36: either 'address' or 'accounts' call argument is required on solana
+// error: 11:25-36: either 'address' or 'accounts' call argument is required on Solana

+ 1 - 1
tests/contract_testcases/solana/expressions/units.sol

@@ -9,6 +9,6 @@
 // ---- Expect: diagnostics ----
 // warning: 3:13-35: function can be declared 'pure'
 // warning: 4:23-28: local variable 'ether' has been assigned, but never read
-// warning: 4:31-38: ethereum currency unit used while targeting solana
+// warning: 4:31-38: ethereum currency unit used while targeting Solana
 // warning: 5:23-26: local variable 'sol' has been assigned, but never read
 // warning: 6:23-31: local variable 'lamports' has been assigned, but never read

+ 1 - 1
tests/contract_testcases/solana/functions/selector_override.sol

@@ -29,7 +29,7 @@ contract TooLarge {
 // error: 2:2-25: overriding selector not permitted on constructor
 // error: 4:2-16: overriding selector not permitted on modifier
 // error: 6:2-16: overriding selector not permitted on receive
-// error: 7:2-28: target solana does not support receive() functions, see https://solang.readthedocs.io/en/latest/language/functions.html#fallback-and-receive-function
+// error: 7:2-28: target Solana does not support receive() functions, see https://solang.readthedocs.io/en/latest/language/functions.html#fallback-and-receive-function
 // error: 8:2-20: overriding selector not permitted on fallback
 // error: 10:2-25: overriding selector only permitted on 'public' or 'external' function, not 'internal'
 // error: 12:2-25: overriding selector only permitted on 'public' or 'external' function, not 'private'

+ 2 - 2
tests/contract_testcases/solana/import_contracts_via_object.sol

@@ -11,7 +11,7 @@ contract C is IMP.A {
 }
 
 // ---- Expect: diagnostics ----
-// error: 6:3-17: revert with custom errors not supported on solana
+// error: 6:3-17: revert with custom errors not supported on Solana
 // error: 6:10-15: error 'E' has 1 fields, 0 provided
 // 	note 3:7-8: definition of 'E'
-// error: 9:3-25: revert with custom errors not supported on solana
+// error: 9:3-25: revert with custom errors not supported on Solana

+ 1 - 1
tests/contract_testcases/solana/mapping_deletion.sol

@@ -39,4 +39,4 @@ contract DeleteTest {
 
 }
 // ---- Expect: diagnostics ----
-// error: 25:24-40: either 'address' or 'accounts' call argument is required on solana
+// error: 25:24-40: either 'address' or 'accounts' call argument is required on Solana

+ 1 - 1
tests/contract_testcases/solana/negative_exponent.sol

@@ -11,5 +11,5 @@ contract c {
 }
 
 // ---- Expect: diagnostics ----
-// warning: 6:16-26: ethereum currency unit used while targeting solana
+// warning: 6:16-26: ethereum currency unit used while targeting Solana
 // error: 9:2-20: conversion to uint256 from rational not allowed

+ 1 - 1
tests/contract_testcases/solana/yul/parse.sol

@@ -8,4 +8,4 @@
             }
         }
 // ---- Expect: diagnostics ----
-// error: 5:44-55: builtin 'mload' is not available for target solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function
+// error: 5:44-55: builtin 'mload' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function

+ 1 - 1
tests/contract_testcases/solana/yul/return_in_asm.sol

@@ -8,4 +8,4 @@ contract Contract {
 
 // ---- Expect: diagnostics ----
 // error: 3:19-32: flag 'memory-safe' not supported
-// error: 4:13-25: builtin 'return' is not available for target solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function
+// error: 4:13-25: builtin 'return' is not available for target Solana. Please, open a GitHub issue at https://github.com/hyperledger/solang/issues if there is need to support this function