File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
2
println ! ( "cargo:rustc-link-search=../c/target" ) ;
3
- }
3
+ }
Original file line number Diff line number Diff line change 3
3
mod c_oracle_header;
4
4
mod time_machine_types;
5
5
6
- //do not link with C during unit tests (which are built in native architecture, unlike libpyth.o)
6
+ //do not link with C during unit tests (which are built in native architecture, unlike libpyth.o)
7
7
#[ cfg( target_arch = "bpf" ) ]
8
8
#[ link( name = "cpyth" ) ]
9
9
extern "C" {
@@ -12,18 +12,17 @@ extern "C" {
12
12
13
13
//make the C entrypoint a no-op when running cargo test
14
14
#[ cfg( not( target_arch = "bpf" ) ) ]
15
- pub extern "C" fn c_entrypoint ( input : * mut u8 ) -> u64 {
16
- 0 //SUCCESS value
15
+ pub extern "C" fn c_entrypoint ( input : * mut u8 ) -> u64 {
16
+ 0 //SUCCESS value
17
17
}
18
18
19
-
20
19
#[ no_mangle]
21
20
pub extern "C" fn entrypoint ( input : * mut u8 ) -> u64 {
22
- let c_ret_val = unsafe { c_entrypoint ( input) } ;
23
- if c_ret_val == c_oracle_header:: SUCCESSFULLY_UPDATED_AGGREGATE {
21
+ let c_ret_val = unsafe { c_entrypoint ( input) } ;
22
+ if c_ret_val == c_oracle_header:: SUCCESSFULLY_UPDATED_AGGREGATE {
24
23
//0 is the SUCCESS value for solana
25
24
return 0 ;
26
25
} else {
27
26
return c_ret_val;
28
27
}
29
- }
28
+ }
Original file line number Diff line number Diff line change 1
1
use super :: c_oracle_header;
2
2
#[ derive( Debug , Clone ) ]
3
3
#[ repr( C ) ]
4
- /// this wraps multiple SMA and tick trackers, and includes all the state
5
- /// used by the time machine
6
- pub struct TimeMachineWrapper {
4
+ /// this wraps multiple SMA and tick trackers, and includes all the state
5
+ /// used by the time machine
6
+ pub struct TimeMachineWrapper {
7
7
//Place holder with the size of the fields I am planning to add
8
- place_holder : [ u8 ; 1864 ] ,
8
+ place_holder : [ u8 ; 1864 ] ,
9
9
}
10
10
11
11
#[ test]
@@ -17,4 +17,4 @@ fn c_time_machine_size_is_correct() {
17
17
c_oracle_header:: TIME_MACHINE_STRUCT_SIZE . try_into( ) . unwrap( ) ,
18
18
"expected TIME_MACHINE_STRUCT_SIZE in oracle.h to the same as the size of TimeMachineWrapper"
19
19
) ;
20
- }
20
+ }
You can’t perform that action at this time.
0 commit comments