@@ -85,17 +85,17 @@ where
8585}
8686
8787/// Consumes imputed amount of gas.
88- fn charge_gas < S : GlobalStateReader , E : Executor > (
89- caller : & mut impl Caller < Context = Context < S , E > > ,
88+ fn charge_gas < S : GlobalStateReader > (
89+ caller : & mut impl Caller < Context = Context < S > > ,
9090 imputed : u64 ,
9191) -> VMResult < ( ) > {
9292 caller. consume_gas ( imputed) ?;
9393 Ok ( ( ) )
9494}
9595
9696/// Consumes a set amount of gas for the specified storage value.
97- fn charge_gas_storage < S : GlobalStateReader , E : Executor > (
98- caller : & mut impl Caller < Context = Context < S , E > > ,
97+ fn charge_gas_storage < S : GlobalStateReader > (
98+ caller : & mut impl Caller < Context = Context < S > > ,
9999 size_bytes : usize ,
100100) -> VMResult < ( ) > {
101101 let storage_costs = & caller. context ( ) . storage_costs ;
@@ -106,14 +106,13 @@ fn charge_gas_storage<S: GlobalStateReader, E: Executor>(
106106}
107107
108108/// Consumes a set amount of gas for the specified host function and weights
109- fn charge_host_function_call < S , E , const N : usize > (
110- caller : & mut impl Caller < Context = Context < S , E > > ,
109+ fn charge_host_function_call < S , const N : usize > (
110+ caller : & mut impl Caller < Context = Context < S > > ,
111111 host_function : & HostFunctionV2 < [ u64 ; N ] > ,
112112 weights : [ u64 ; N ] ,
113113) -> VMResult < ( ) >
114114where
115115 S : GlobalStateReader ,
116- E : Executor ,
117116{
118117 let Some ( cost) = host_function. calculate_gas_cost ( weights) else {
119118 // Overflowing gas calculation means gas limit was exceeded
@@ -125,8 +124,8 @@ where
125124}
126125
127126/// Writes a message to the global state and charges for storage used.
128- fn metered_write < S : GlobalStateReader , E : Executor > (
129- caller : & mut impl Caller < Context = Context < S , E > > ,
127+ fn metered_write < S : GlobalStateReader > (
128+ caller : & mut impl Caller < Context = Context < S > > ,
130129 key : Key ,
131130 value : StoredValue ,
132131) -> VMResult < ( ) > {
@@ -140,8 +139,8 @@ fn metered_write<S: GlobalStateReader, E: Executor>(
140139}
141140
142141/// Write value under a key.
143- pub fn casper_write < S : GlobalStateReader , E : Executor > (
144- mut caller : impl Caller < Context = Context < S , E > > ,
142+ pub fn casper_write < S : GlobalStateReader > (
143+ mut caller : impl Caller < Context = Context < S > > ,
145144 key_space : u64 ,
146145 key_ptr : u32 ,
147146 key_size : u32 ,
@@ -312,8 +311,8 @@ pub fn casper_write<S: GlobalStateReader, E: Executor>(
312311///
313312/// The name for this host function is `remove` to keep it simple and consistent with read/write
314313/// verbs, and also consistent with the rust stdlib vocabulary i.e. `V`
315- pub fn casper_remove < S : GlobalStateReader , E : Executor > (
316- mut caller : impl Caller < Context = Context < S , E > > ,
314+ pub fn casper_remove < S : GlobalStateReader > (
315+ mut caller : impl Caller < Context = Context < S > > ,
317316 key_space : u64 ,
318317 key_ptr : u32 ,
319318 key_size : u32 ,
@@ -400,8 +399,8 @@ pub fn casper_remove<S: GlobalStateReader, E: Executor>(
400399 Ok ( HOST_ERROR_SUCCESS )
401400}
402401
403- pub fn casper_print < S : GlobalStateReader , E : Executor > (
404- mut caller : impl Caller < Context = Context < S , E > > ,
402+ pub fn casper_print < S : GlobalStateReader > (
403+ mut caller : impl Caller < Context = Context < S > > ,
405404 message_ptr : u32 ,
406405 message_size : u32 ,
407406) -> VMResult < ( ) > {
@@ -422,8 +421,8 @@ pub fn casper_print<S: GlobalStateReader, E: Executor>(
422421}
423422
424423/// Write value under a key.
425- pub fn casper_read < S : GlobalStateReader , E : Executor > (
426- mut caller : impl Caller < Context = Context < S , E > > ,
424+ pub fn casper_read < S : GlobalStateReader > (
425+ mut caller : impl Caller < Context = Context < S > > ,
427426 key_tag : u64 ,
428427 key_ptr : u32 ,
429428 key_size : u32 ,
@@ -616,8 +615,8 @@ pub fn casper_read<S: GlobalStateReader, E: Executor>(
616615 Ok ( HOST_ERROR_SUCCESS )
617616}
618617
619- fn keyspace_to_global_state_key < S : GlobalStateReader , E : Executor > (
620- context : & Context < S , E > ,
618+ fn keyspace_to_global_state_key < S : GlobalStateReader > (
619+ context : & Context < S > ,
621620 keyspace : Keyspace < ' _ > ,
622621) -> Option < Key > {
623622 let entity_addr = context_to_entity_addr ( context) ;
@@ -655,9 +654,7 @@ fn keyspace_to_global_state_key<S: GlobalStateReader, E: Executor>(
655654 }
656655}
657656
658- fn context_to_entity_addr < S : GlobalStateReader , E : Executor > (
659- context : & Context < S , E > ,
660- ) -> EntityAddr {
657+ fn context_to_entity_addr < S : GlobalStateReader > ( context : & Context < S > ) -> EntityAddr {
661658 match context. callee {
662659 Key :: Account ( account_hash) => EntityAddr :: new_account ( account_hash. value ( ) ) ,
663660 Key :: Hash ( hash_addr) => EntityAddr :: SmartContract ( hash_addr) ,
@@ -669,8 +666,8 @@ fn context_to_entity_addr<S: GlobalStateReader, E: Executor>(
669666 }
670667}
671668
672- pub fn casper_copy_input < S : GlobalStateReader , E : Executor > (
673- mut caller : impl Caller < Context = Context < S , E > > ,
669+ pub fn casper_copy_input < S : GlobalStateReader > (
670+ mut caller : impl Caller < Context = Context < S > > ,
674671 cb_alloc : u32 ,
675672 alloc_ctx : u32 ,
676673) -> VMResult < u32 > {
@@ -705,8 +702,8 @@ pub fn casper_copy_input<S: GlobalStateReader, E: Executor>(
705702}
706703
707704/// Returns from the execution of a smart contract with an optional flags.
708- pub fn casper_return < S : GlobalStateReader , E : Executor > (
709- mut caller : impl Caller < Context = Context < S , E > > ,
705+ pub fn casper_return < S : GlobalStateReader > (
706+ mut caller : impl Caller < Context = Context < S > > ,
710707 flags : u32 ,
711708 data_ptr : u32 ,
712709 data_len : u32 ,
@@ -747,8 +744,8 @@ pub fn casper_return<S: GlobalStateReader, E: Executor>(
747744}
748745
749746#[ allow( clippy:: too_many_arguments) ]
750- pub fn casper_create < S : GlobalStateReader + ' static , E : Executor + ' static > (
751- mut caller : impl Caller < Context = Context < S , E > > ,
747+ pub fn casper_create < S : GlobalStateReader + ' static > (
748+ mut caller : impl Caller < Context = Context < S > > ,
752749 code_ptr : u32 ,
753750 code_len : u32 ,
754751 transferred_value : u64 ,
@@ -1037,8 +1034,7 @@ pub fn casper_create<S: GlobalStateReader + 'static, E: Executor + 'static>(
10371034 let tracking_copy_for_ctor = caller. context ( ) . tracking_copy . fork2 ( ) ;
10381035
10391036 match caller
1040- . context ( )
1041- . executor
1037+ . executor ( )
10421038 . execute ( tracking_copy_for_ctor, execute_request)
10431039 {
10441040 Ok ( ExecuteResult {
@@ -1087,8 +1083,8 @@ pub fn casper_create<S: GlobalStateReader + 'static, E: Executor + 'static>(
10871083}
10881084
10891085#[ allow( clippy:: too_many_arguments) ]
1090- pub fn casper_system < S : GlobalStateReader + ' static , E : Executor + ' static > (
1091- mut caller : impl Caller < Context = Context < S , E > > ,
1086+ pub fn casper_system < S : GlobalStateReader + ' static > (
1087+ mut caller : impl Caller < Context = Context < S > > ,
10921088 system_contract_opt : u32 ,
10931089 input_ptr : u32 ,
10941090 input_len : u32 ,
@@ -1189,8 +1185,8 @@ pub fn casper_system<S: GlobalStateReader + 'static, E: Executor + 'static>(
11891185}
11901186
11911187#[ allow( clippy:: too_many_arguments) ]
1192- pub fn casper_call < S : GlobalStateReader + ' static , E : Executor + ' static > (
1193- mut caller : impl Caller < Context = Context < S , E > > ,
1188+ pub fn casper_call < S : GlobalStateReader + ' static > (
1189+ mut caller : impl Caller < Context = Context < S > > ,
11941190 address_ptr : u32 ,
11951191 address_len : u32 ,
11961192 transferred_value : u64 ,
@@ -1294,19 +1290,15 @@ pub fn casper_call<S: GlobalStateReader + 'static, E: Executor + 'static>(
12941290 ret
12951291}
12961292
1297- fn exec < S : GlobalStateReader + ' static , E : Executor + ' static > (
1298- mut caller : impl Caller < Context = Context < S , E > > ,
1293+ fn exec < S : GlobalStateReader + ' static > (
1294+ mut caller : impl Caller < Context = Context < S > > ,
12991295 execute_request : ExecuteRequest ,
13001296 cb_alloc : u32 ,
13011297 cb_ctx : u32 ,
13021298) -> VMResult < u32 > {
13031299 let tracking_copy = caller. context ( ) . tracking_copy . fork2 ( ) ;
13041300
1305- let ( gas_usage, host_result) = match caller
1306- . context ( )
1307- . executor
1308- . execute ( tracking_copy, execute_request)
1309- {
1301+ let ( gas_usage, host_result) = match caller. executor ( ) . execute ( tracking_copy, execute_request) {
13101302 Ok ( ExecuteResult {
13111303 host_error,
13121304 output,
@@ -1360,8 +1352,8 @@ fn exec<S: GlobalStateReader + 'static, E: Executor + 'static>(
13601352 Ok ( u32_from_host_result ( host_result) )
13611353}
13621354
1363- pub fn casper_env_balance < S : GlobalStateReader , E : Executor > (
1364- mut caller : impl Caller < Context = Context < S , E > > ,
1355+ pub fn casper_env_balance < S : GlobalStateReader > (
1356+ mut caller : impl Caller < Context = Context < S > > ,
13651357 entity_kind : u32 ,
13661358 entity_addr_ptr : u32 ,
13671359 entity_addr_len : u32 ,
@@ -1525,8 +1517,8 @@ pub fn casper_env_balance<S: GlobalStateReader, E: Executor>(
15251517 Ok ( HOST_ERROR_NOT_FOUND )
15261518}
15271519
1528- pub fn casper_upgrade < S : GlobalStateReader + ' static , E : Executor > (
1529- mut caller : impl Caller < Context = Context < S , E > > ,
1520+ pub fn casper_upgrade < S : GlobalStateReader + ' static > (
1521+ mut caller : impl Caller < Context = Context < S > > ,
15301522 code_ptr : u32 ,
15311523 code_size : u32 ,
15321524 entry_point_ptr : u32 ,
@@ -1874,8 +1866,7 @@ pub fn casper_upgrade<S: GlobalStateReader + 'static, E: Executor>(
18741866 let tracking_copy_for_ctor = caller. context ( ) . tracking_copy . fork2 ( ) ;
18751867
18761868 match caller
1877- . context ( )
1878- . executor
1869+ . executor ( )
18791870 . execute ( tracking_copy_for_ctor, execute_request)
18801871 {
18811872 Ok ( ExecuteResult {
@@ -1924,8 +1915,8 @@ pub fn casper_upgrade<S: GlobalStateReader + 'static, E: Executor>(
19241915 Ok ( CALLEE_SUCCEEDED )
19251916}
19261917
1927- pub fn casper_env_info < S : GlobalStateReader , E : Executor > (
1928- mut caller : impl Caller < Context = Context < S , E > > ,
1918+ pub fn casper_env_info < S : GlobalStateReader > (
1919+ mut caller : impl Caller < Context = Context < S > > ,
19291920 info_ptr : u32 ,
19301921 info_size : u32 ,
19311922) -> VMResult < u32 > {
@@ -1982,8 +1973,8 @@ pub fn casper_env_info<S: GlobalStateReader, E: Executor>(
19821973 Ok ( HOST_ERROR_SUCCESS )
19831974}
19841975
1985- pub fn casper_emit < S : GlobalStateReader , E : Executor > (
1986- mut caller : impl Caller < Context = Context < S , E > > ,
1976+ pub fn casper_emit < S : GlobalStateReader > (
1977+ mut caller : impl Caller < Context = Context < S > > ,
19871978 topic_name_ptr : u32 ,
19881979 topic_name_size : u32 ,
19891980 payload_ptr : u32 ,
@@ -2199,8 +2190,8 @@ pub fn casper_emit<S: GlobalStateReader, E: Executor>(
21992190/// * `in_size` - size of output pointer
22002191/// * `hash_algo_type` - integer representation of HashAlgorithm enum variant
22012192/// * `out_ptr` - pointer to the location where argument bytes will be copied to the host side
2202- pub fn casper_generic_hash < S : GlobalStateReader , E : Executor > (
2203- mut caller : impl Caller < Context = Context < S , E > > ,
2193+ pub fn casper_generic_hash < S : GlobalStateReader > (
2194+ mut caller : impl Caller < Context = Context < S > > ,
22042195 in_ptr : u32 ,
22052196 in_size : u32 ,
22062197 hash_algorithm : u32 ,
@@ -2282,8 +2273,8 @@ pub fn casper_generic_hash<S: GlobalStateReader, E: Executor>(
22822273/// multiplication 𝑘×𝑮 odd?
22832274/// - Hi bit (3/4): did the affine x-coordinate of 𝑘×𝑮 overflow the order of the scalar field,
22842275/// requiring a reduction when computing r?
2285- pub fn casper_recover_secp256k1 < S : GlobalStateReader , E : Executor > (
2286- mut caller : impl Caller < Context = Context < S , E > > ,
2276+ pub fn casper_recover_secp256k1 < S : GlobalStateReader > (
2277+ mut caller : impl Caller < Context = Context < S > > ,
22872278 message_ptr : u32 ,
22882279 message_size : u32 ,
22892280 signature_ptr : u32 ,
0 commit comments