File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use solana_sdk::{
12
12
13
13
crate :: declare_id!( "ComputeBudget111111111111111111111111111111" ) ;
14
14
15
- const MAX_UNITS : u64 = 1_000_000 ;
15
+ const MAX_UNITS : u32 = 1_000_000 ;
16
16
17
17
/// Compute Budget Instructions
18
18
#[ derive(
@@ -30,11 +30,11 @@ const MAX_UNITS: u64 = 1_000_000;
30
30
pub enum ComputeBudgetInstruction {
31
31
/// Request a specific maximum number of compute units the transaction is
32
32
/// allowed to consume.
33
- RequestUnits ( u64 ) ,
33
+ RequestUnits ( u32 ) ,
34
34
}
35
35
36
36
/// Create a `ComputeBudgetInstruction::RequestUnits` `Instruction`
37
- pub fn request_units ( units : u64 ) -> Instruction {
37
+ pub fn request_units ( units : u32 ) -> Instruction {
38
38
Instruction :: new_with_borsh ( id ( ) , & ComputeBudgetInstruction :: RequestUnits ( units) , vec ! [ ] )
39
39
}
40
40
@@ -52,7 +52,7 @@ pub fn process_request(
52
52
if units > MAX_UNITS {
53
53
return Err ( error) ;
54
54
}
55
- compute_budget. max_units = units;
55
+ compute_budget. max_units = units as u64 ;
56
56
}
57
57
}
58
58
Ok ( ( ) )
@@ -134,7 +134,7 @@ mod tests {
134
134
assert_eq ! (
135
135
compute_budget,
136
136
BpfComputeBudget {
137
- max_units: MAX_UNITS ,
137
+ max_units: MAX_UNITS as u64 ,
138
138
..BpfComputeBudget :: default ( )
139
139
}
140
140
) ;
You can’t perform that action at this time.
0 commit comments