Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Check PR"

on:
pull_request:
push:
branches:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Check_Build:
name: "Check Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config libudev-dev
- name: Install mise
uses: jdx/mise-action@v2
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.7.3
- name: "Install WASM Target"
run: rustup target add wasm32-unknown-unknown
- name: "Build Contract (Optimized)"
run: make build

Check_Tests:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config libudev-dev
- name: Install mise
uses: jdx/mise-action@v2
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.7.3
- name: "Install WASM Target"
run: rustup target add wasm32-unknown-unknown
- name: "Run All Tests"
run: make test
23 changes: 4 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,11 @@ test: build

build:
mkdir -p target/wasm32-unknown-unknown/optimized

cargo rustc --manifest-path=Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
cargo rustc --manifest-path=Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
stellar contract optimize \
--wasm target/wasm32-unknown-unknown/release/oracle_aggregator.wasm \
--wasm-out target/wasm32-unknown-unknown/optimized/oracle_aggregator.wasm

cd target/wasm32-unknown-unknown/optimized/ && \
for i in *.wasm ; do \
ls -l "$$i"; \
done

fmt:
cargo fmt --all

clean:
cargo clean

generate-js:
stellar contract bindings typescript --overwrite \
--contract-id CBWH54OKUK6U2J2A4J2REJEYB625NEFCHISWXLOPR2D2D6FTN63TJTWN \
--wasm ./target/wasm32-unknown-unknown/optimized/oracle_aggregator.wasm --output-dir ./js/aggregator/ \
--rpc-url http://localhost:8000 --network-passphrase "Standalone Network ; February 2017" --network Standalone

deploy-testnet: build
stellar contract deploy --network $$STELLAR_NETWORK --source $$STELLAR_SOURCE --wasm $$WASM -- --admin $$ADMIN --base $$BASE --decimals $$DECIMALS --max-age $$MAX_AGE

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ The aggregator attempts to fetch the price from the source oracle as defined by

Oracle Aggregator has not had an audit conducted. If an audit is conducted, it will appear here.

Oracle Aggregator is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including Script3. You acknowledge that you are solely responsible for any use of Oracle Aggregator and you assume all risks associated with any such use.
Oracle Aggregator is made available under the MIT License, which disclaims all warranties in relation to the project and which limits the liability of those that contribute and maintain the project, including Script3. You acknowledge that you are solely responsible for any use of Oracle Aggregator and you assume all risks associated with any such use.
12 changes: 12 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tools]
"cargo:stellar-cli" = "23.1.4"

[env]
STELLAR_NETWORK = "testnet"
STELLAR_SOURCE = "blend-test-net"
WASM = "target/wasm32-unknown-unknown/optimized/oracle_aggregator.wasm"
ADMIN = "GBH62ESUWAJGVIDWMQTIJ4T24IWIGMYM2LGGVCBZGAZY7EYHDYMMA7HX"
BASE = '{"Other":"USD"}'
DECIMALS = 14
MAX_AGE = 600
ORACLE_TESTNET_ID = "CCNAFGAGXRP4RURGW6ISNTT2H7EA5HMNC6VKFHPL3Q2ALEADEMPMPZZ3"
Loading