@@ -1885,6 +1885,12 @@ where
1885
1885
netuid,
1886
1886
amount_staked,
1887
1887
} ) => {
1888
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
1889
+ return InvalidTransaction :: Custom (
1890
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
1891
+ )
1892
+ . into ( ) ;
1893
+ }
1888
1894
// Fully validate the user input
1889
1895
Self :: result_to_validity ( Pallet :: < T > :: validate_add_stake (
1890
1896
who,
@@ -1902,6 +1908,13 @@ where
1902
1908
limit_price,
1903
1909
allow_partial,
1904
1910
} ) => {
1911
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
1912
+ return InvalidTransaction :: Custom (
1913
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
1914
+ )
1915
+ . into ( ) ;
1916
+ }
1917
+
1905
1918
// Calcaulate the maximum amount that can be executed with price limit
1906
1919
let max_amount = Pallet :: < T > :: get_max_amount_add ( * netuid, * limit_price) ;
1907
1920
@@ -1957,6 +1970,13 @@ where
1957
1970
destination_netuid,
1958
1971
alpha_amount,
1959
1972
} ) => {
1973
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
1974
+ return InvalidTransaction :: Custom (
1975
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
1976
+ )
1977
+ . into ( ) ;
1978
+ }
1979
+
1960
1980
// Fully validate the user input
1961
1981
Self :: result_to_validity ( Pallet :: < T > :: validate_stake_transition (
1962
1982
who,
@@ -1978,6 +1998,13 @@ where
1978
1998
destination_netuid,
1979
1999
alpha_amount,
1980
2000
} ) => {
2001
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
2002
+ return InvalidTransaction :: Custom (
2003
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
2004
+ )
2005
+ . into ( ) ;
2006
+ }
2007
+
1981
2008
// Fully validate the user input
1982
2009
Self :: result_to_validity ( Pallet :: < T > :: validate_stake_transition (
1983
2010
who,
@@ -1998,6 +2025,13 @@ where
1998
2025
destination_netuid,
1999
2026
alpha_amount,
2000
2027
} ) => {
2028
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
2029
+ return InvalidTransaction :: Custom (
2030
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
2031
+ )
2032
+ . into ( ) ;
2033
+ }
2034
+
2001
2035
// Fully validate the user input
2002
2036
Self :: result_to_validity ( Pallet :: < T > :: validate_stake_transition (
2003
2037
who,
@@ -2020,6 +2054,13 @@ where
2020
2054
limit_price,
2021
2055
allow_partial,
2022
2056
} ) => {
2057
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
2058
+ return InvalidTransaction :: Custom (
2059
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
2060
+ )
2061
+ . into ( ) ;
2062
+ }
2063
+
2023
2064
// Get the max amount possible to exchange
2024
2065
let max_amount = Pallet :: < T > :: get_max_amount_move (
2025
2066
* origin_netuid,
@@ -2042,6 +2083,13 @@ where
2042
2083
) )
2043
2084
}
2044
2085
Some ( Call :: register { netuid, .. } | Call :: burned_register { netuid, .. } ) => {
2086
+ if ColdkeySwapScheduled :: < T > :: contains_key ( who) {
2087
+ return InvalidTransaction :: Custom (
2088
+ CustomTransactionError :: ColdkeyInSwapSchedule . into ( ) ,
2089
+ )
2090
+ . into ( ) ;
2091
+ }
2092
+
2045
2093
let registrations_this_interval =
2046
2094
Pallet :: < T > :: get_registrations_this_interval ( * netuid) ;
2047
2095
let max_registrations_per_interval =
0 commit comments