-
Notifications
You must be signed in to change notification settings - Fork 119
Export upd_aggregate #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Export upd_aggregate #249
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| OUT_DIR := ./target | ||
| SOLANA := ../../../solana | ||
| include $(SOLANA)/sdk/bpf/c/bpf.mk | ||
|
|
||
| cpyth: | ||
| # Bundle C code compiled to bpf for use by rust | ||
| bash -c "ar rcs target/libcpyth.a target/**/*.o" | ||
| cpythtest: | ||
| # Compile C code to system architecture for use by rust's cargo test | ||
| $(CC) -c ./src/oracle/for_cargo_test/cpyth_test.c -o ./target/cpyth_test.o | ||
| # Bundle C code compiled to system architecture for use by rust's cargo test | ||
| ar rcs target/libcpythtest.a ./target/cpyth_test.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /// The goal of this file is to provide the upd_aggregate function to local rust tests | ||
|
|
||
| /// We need to allocate some heap space for upd_aggregate | ||
| /// When compiling for the solana runtime, the heap space is preallocated and PC_HEAP_START is provided by <solana.h> | ||
| char heap_start[8192]; | ||
| #define PC_HEAP_START (heap_start) | ||
| #define static_assert _Static_assert | ||
|
|
||
| typedef signed char int8_t; | ||
| typedef unsigned char uint8_t; | ||
| typedef signed short int16_t; | ||
| typedef unsigned short uint16_t; | ||
| typedef signed int int32_t; | ||
| typedef unsigned int uint32_t; | ||
| typedef signed long int int64_t; | ||
| typedef unsigned long int uint64_t; | ||
|
|
||
| #include "../upd_aggregate.h" | ||
|
|
||
| extern bool c_upd_aggregate( pc_price_t *ptr, uint64_t slot, int64_t timestamp ){ | ||
| return upd_aggregate(ptr, slot, timestamp ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.