Skip to content

Commit 843ecfa

Browse files
authored
Cleanup (#252)
* Format * Cleanup * Delete accidentaly pushed * Restore cargo * Add aggregation tests to CI * CI * Should work * Remove files * Remove files * Cleanup * Restore V flag * Restore comment * Update comment
1 parent 827d7fd commit 843ecfa

File tree

5 files changed

+16
-186
lines changed

5 files changed

+16
-186
lines changed

program/c/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ cpyth-bpf:
77
bash -c "ar rcs target/libcpyth-bpf.a target/**/*.o"
88
cpyth-native:
99
# Compile C code to system architecture for use by rust's cargo test
10-
gcc -c ./src/oracle/for_cargo_test/cpyth_test.c -o ./target/cpyth_test.o
10+
gcc -c ./src/oracle/native/upd_aggregate.c -o ./target/cpyth-native.o
1111
# Bundle C code compiled to system architecture for use by rust's cargo test
12-
ar rcs target/libcpyth-native.a ./target/cpyth_test.o
12+
ar rcs target/libcpyth-native.a ./target/cpyth-native.o

program/c/src/oracle/oracle.c

Lines changed: 0 additions & 177 deletions
This file was deleted.

program/c/src/oracle/upd_aggregate.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* BPF upd_aggregate binding
3+
*/
4+
#include <solana_sdk.h>
5+
#include "oracle.h"
6+
#include "upd_aggregate.h"
7+
8+
extern bool c_upd_aggregate( pc_price_t *ptr, uint64_t slot, int64_t timestamp ){
9+
return upd_aggregate(ptr, slot, timestamp );
10+
}

scripts/build-bpf.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/usr/bin/env bash
22
#
3-
# Build given bpf makefile dir (./program by default):
3+
# Build bpf oracle program :
44
# ~/pyth-client$ ./scripts/build-bpf.sh
5-
# ~/pyth-client/program$ ../scripts/build-bpf.sh .
6-
# ~/$ ./pyth-client/scripts/build-bpf.sh ./serum-pyth/program
7-
#
5+
# ~/pyth-client/program$ ../scripts/build-bpf.sh
86

97
set -eu
108

@@ -21,14 +19,13 @@ then
2119
source "${CARGO_HOME:-$HOME/.cargo}/env"
2220
fi
2321

24-
2522
set -x
2623

2724
#build the C code and make an archive file out of it
2825
cd "${C_DIR}"
29-
export V="${V:-1}"
26+
export V="${V:-1}" #verbose flag for solana
3027
make clean
31-
make "${@:2}"
28+
make
3229
make cpyth-bpf
3330
make cpyth-native
3431
rm ./target/*-keypair.json

0 commit comments

Comments
 (0)