@@ -1897,6 +1897,65 @@ pub fn actions_fixtures() -> Vec<TestGroup> {
1897
1897
} ,
1898
1898
] ) ,
1899
1899
} ,
1900
+ TestCase {
1901
+ modifications: Some ( vec![ TestCaseModification {
1902
+ start_pat: Some ( "<-#[ink::contract]" ) ,
1903
+ end_pat: Some ( "#[ink::contract]" ) ,
1904
+ replacement: "#[ink::contract]\n #[ink(env=crate::Environment)]" ,
1905
+ } ] ) ,
1906
+ params: Some ( TestCaseParams :: Action ( TestParamsOffsetOnly {
1907
+ pat: Some ( "<-mod erc20" ) ,
1908
+ } ) ) ,
1909
+ results: TestCaseResults :: Action ( vec![
1910
+ TestResultAction {
1911
+ label: "Add" ,
1912
+ edits: vec![ TestResultTextRange {
1913
+ text: r#"(keep_attr = "")"# ,
1914
+ start_pat: Some ( "#[ink::contract" ) ,
1915
+ end_pat: Some ( "#[ink::contract" ) ,
1916
+ } ] ,
1917
+ } ,
1918
+ TestResultAction {
1919
+ label: "Flatten" ,
1920
+ edits: vec![
1921
+ TestResultTextRange {
1922
+ text: "#[ink::contract(env = crate::Environment)]" ,
1923
+ start_pat: Some ( "<-#[ink::contract]" ) ,
1924
+ end_pat: Some ( "#[ink::contract]" ) ,
1925
+ } ,
1926
+ TestResultTextRange {
1927
+ text: "" ,
1928
+ start_pat: Some ( "<-#[ink(env=crate::Environment)]" ) ,
1929
+ end_pat: Some ( "#[ink(env=crate::Environment)]\n " ) ,
1930
+ } ,
1931
+ ] ,
1932
+ } ,
1933
+ TestResultAction {
1934
+ label: "Add" ,
1935
+ edits: vec![ TestResultTextRange {
1936
+ text: "#[ink(event)]" ,
1937
+ start_pat: Some ( "<-\n \n /// The ERC-20 error types." ) ,
1938
+ end_pat: Some ( "<-\n \n /// The ERC-20 error types." ) ,
1939
+ } ] ,
1940
+ } ,
1941
+ TestResultAction {
1942
+ label: "Add" ,
1943
+ edits: vec![ TestResultTextRange {
1944
+ text: "#[ink(constructor)]" ,
1945
+ start_pat: Some ( "<-\n }\n \n #[cfg(test)]" ) ,
1946
+ end_pat: Some ( "<-\n }\n \n #[cfg(test)]" ) ,
1947
+ } ] ,
1948
+ } ,
1949
+ TestResultAction {
1950
+ label: "Add" ,
1951
+ edits: vec![ TestResultTextRange {
1952
+ text: "#[ink(message)]" ,
1953
+ start_pat: Some ( "<-\n }\n \n #[cfg(test)]" ) ,
1954
+ end_pat: Some ( "<-\n }\n \n #[cfg(test)]" ) ,
1955
+ } ] ,
1956
+ } ,
1957
+ ] ) ,
1958
+ } ,
1900
1959
TestCase {
1901
1960
modifications: Some ( vec![ TestCaseModification {
1902
1961
start_pat: Some ( "<-#[ink(storage)]" ) ,
@@ -2006,6 +2065,41 @@ pub fn actions_fixtures() -> Vec<TestGroup> {
2006
2065
} ] ,
2007
2066
} ] ) ,
2008
2067
} ,
2068
+ TestCase {
2069
+ modifications: Some ( vec![ TestCaseModification {
2070
+ start_pat: Some ( "<-#[ink(event)]" ) ,
2071
+ end_pat: Some ( "#[ink(event)]" ) ,
2072
+ replacement: "#[ink(event)]\n #[ink(anonymous)]" ,
2073
+ } ] ) ,
2074
+ params: Some ( TestCaseParams :: Action ( TestParamsOffsetOnly {
2075
+ pat: Some ( "<-pub struct Transfer" ) ,
2076
+ } ) ) ,
2077
+ results: TestCaseResults :: Action ( vec![
2078
+ TestResultAction {
2079
+ label: "Flatten" ,
2080
+ edits: vec![
2081
+ TestResultTextRange {
2082
+ text: "#[ink(event, anonymous)]" ,
2083
+ start_pat: Some ( "<-#[ink(event)]" ) ,
2084
+ end_pat: Some ( "#[ink(event)]" ) ,
2085
+ } ,
2086
+ TestResultTextRange {
2087
+ text: "" ,
2088
+ start_pat: Some ( "<-#[ink(anonymous)]" ) ,
2089
+ end_pat: Some ( "<-pub struct Transfer" ) ,
2090
+ } ,
2091
+ ] ,
2092
+ } ,
2093
+ TestResultAction {
2094
+ label: "Add" ,
2095
+ edits: vec![ TestResultTextRange {
2096
+ text: "#[ink(topic)]" ,
2097
+ start_pat: Some ( "value: Balance," ) ,
2098
+ end_pat: Some ( "value: Balance," ) ,
2099
+ } ] ,
2100
+ } ,
2101
+ ] ) ,
2102
+ } ,
2009
2103
TestCase {
2010
2104
modifications: None ,
2011
2105
params: Some ( TestCaseParams :: Action ( TestParamsOffsetOnly {
0 commit comments