Code Monkey home page Code Monkey logo

oanda-rs's People

Contributors

blankenshipz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

oanda-rs's Issues

Update README with setup info

Per #7 update the README to address the needs for setting up the test environment:

  1. Create a .secrets file that is read by docker-compose.

The .secrets file should contain:

OANDA_API_KEY=<hex>
# Note that the OANDA_API_URL contains the version
OANDA_API_URL=https://api-fxpractice.oanda.com/v3
OANDA_TEST_ACCOUNT_ID=<the oanda account to use that the token has access to>
  1. Create a Oanda practice account and name it "TestV20"

ratelimit again

I have the same problem as reported previously. The old version 0.4.1 is correctly specified in Cargo.toml but when compiling it always pulls in the latest version, currently 0.4.4, which then causes compilation errors. I do not understand it. Maybe Cargo demands some override to insist on obsolete packages? So much for the fabled Cargo simplicity ...

Add CI

Setup CI with CircleCI - there are some tests

Tests All Fail

I can not get any of the tests to pass. I have read the issue "Error when running..." and I understand that I "have to name" the account Testv20. However, Oanda does not let me change the name of the primary account from Primary. I have created a sub account and given it this name and put in .secrets the new account number but all the tests still fail.

Error when running `docker-compose run --rm lib`

docker-compose run --rm lib

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
docker --version
Docker version 17.05.0-ce, build 89658be

After changing the version to 2.0 I can run the container. The tests fail though. I think it is because the environment variables might no be present. In the docker-compose.yml there is a reference to .secrets so I created that file and put the following inside:

OANDA_API_URL=https://api-fxpractice.oanda.com
OANDA_API_KEY=<key from the site in hex format>

Is that the right way?

The output after running the container:

running 5 tests
thread 'thread 'account::tests::it_can_read_account_detailsclient::tests::it_can_read_accounts' panicked at '' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresentcalled `Result::unwrap()` on an `Err` value: NotPresent', ', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs/buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs::thread '868868account::tests::it_can_read_account_instruments

note: Run with `RUST_BACKTRACE=1` for a backtrace.
' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rsthread ':instrument::pricing_query::tests::it_can_perform_a_query868' panicked at '
called `Result::unwrap()` on an `Err` value: NotPresent', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rsthread ':account::tests::it_can_read_account_summary868' panicked at '
called `Result::unwrap()` on an `Err` value: NotPresent', /buildslave/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcore/result.rs:868
test account::tests::it_can_read_account_details ... FAILED
test account::tests::it_can_read_account_instruments ... FAILED
test account::tests::it_can_read_account_summary ... FAILED
test instrument::pricing_query::tests::it_can_perform_a_query ... FAILED
test client::tests::it_can_read_accounts ... FAILED

failures:

failures:
    account::tests::it_can_read_account_details
    account::tests::it_can_read_account_instruments
    account::tests::it_can_read_account_summary
    client::tests::it_can_read_accounts
    instrument::pricing_query::tests::it_can_perform_a_query

test result: FAILED. 0 passed; 5 failed; 0 ignored; 0 measured

Could not find Ratelimit in ratelimit

Compilation fails due to no Ratelimit struct in ratelimit crate.
Checked ratelimit docs for version 0.4.3 but there is not a Ratelimit struct, they use a builder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.