Skip to content

Commit

Permalink
Update stellar-base
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Jan 31, 2017
1 parent e9e13b6 commit c89bb96
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
32 changes: 15 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
language: node_js
sudo: required # to install newer g++ and use docker
dist: trusty # https://github.com/travis-ci/travis-ci/issues/5448
sudo: required
dist: trusty
services:
- docker
- docker
matrix:
include:
- node_js: "4.2"
- node_js: "0.12"
- node_js: "6.9.1"
env: SAUCE=true
- node_js: "6.9.1"
env: INTEGRATION=true
- node_js: '4.2'
- node_js: 6.9.4
env: SAUCE=true
- node_js: 6.9.4
env: INTEGRATION=true
before_install:
- npm install -g npm@'>=2.13.5'
script:
Expand Down Expand Up @@ -40,9 +39,8 @@ after_success:
fi
env:
global:
# GITHUB_TOKEN
- secure: Pc3DwkXywnOGAhUdBZiUCKjyljzrQzPoqm9EEr+UL2BaeaDniFLCLEkuU+ViiuJBo8oPyOIl7I+d86Mi5q06fQx55+xH7DmiW/aj4qKVB2U6Ghn6A3QWkQuvRB1o8SP7iTYRCX480ULZs6AGrMd9y1PFRx/L93fBrO+J/bOtEmg=
- CXX=g++-4.8 # node bindings in 4.0.0
- secure: Pc3DwkXywnOGAhUdBZiUCKjyljzrQzPoqm9EEr+UL2BaeaDniFLCLEkuU+ViiuJBo8oPyOIl7I+d86Mi5q06fQx55+xH7DmiW/aj4qKVB2U6Ghn6A3QWkQuvRB1o8SP7iTYRCX480ULZs6AGrMd9y1PFRx/L93fBrO+J/bOtEmg=
- CXX=g++-4.8
addons:
apt:
sources:
Expand All @@ -54,22 +52,22 @@ notifications:
slack:
secure: CgXxNEQrQ82EatyF/wSdF0P5rXcWPL+fFZ1lb1aBb8RbVt5gwddJ6xWVD/nYSr6tIJvIYHYhoYsIDPENwezIPsesG7kWXerQhydsEcA34JKxzsStd/TmU6Moxuwy6KTN7yzmL6586nSvoAw9TNPgvRkJFkH07asjGIc9Rlaq7/Y=
before_deploy: gulp build
after_deploy: ./after_deploy.sh
after_deploy: "./after_deploy.sh"
deploy:
- provider: npm
email: [email protected]
api_key: $NPM_TOKEN
api_key: "$NPM_TOKEN"
skip_cleanup: true
on:
tags: true
repo: stellar/js-stellar-sdk
node: "6.9.1"
node: 6.9.4
condition: "$INTEGRATION = true"
- provider: script
script: ./bower_publish.sh
script: "./bower_publish.sh"
skip_cleanup: true
on:
tags: true
repo: stellar/js-stellar-sdk
node: "6.9.1"
node: 6.9.4
condition: "$INTEGRATION = true"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"eventsource": "^0.2.1",
"jsdoc": "^3.4.1",
"lodash": "^4.0.1",
"stellar-base": "^0.6.0",
"stellar-base": "^0.7.1",
"toml": "^2.3.0"
}
}
4 changes: 2 additions & 2 deletions src/federation_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Promise from 'bluebird';
import isString from "lodash/isString";
import pick from "lodash/pick";
import {Config} from "./config";
import {Account, Keypair} from 'stellar-base';
import {Account, StrKey} from 'stellar-base';
import {StellarTomlResolver} from "./stellar_toml_resolver";

export class FederationServer {
Expand Down Expand Up @@ -72,7 +72,7 @@ export class FederationServer {
static resolve(value, opts = {}) {
// Check if `value` is in account ID format
if (value.indexOf('*') < 0) {
if (!Keypair.isValidPublicKey(value)) {
if (!StrKey.isValidEd25519PublicKey(value)) {
return Promise.reject(new Error('Invalid Account ID'));
} else {
return Promise.resolve({account_id: value});
Expand Down
3 changes: 2 additions & 1 deletion test/unit/server_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ describe("server.js tests", function () {
this.server = new StellarSdk.Server('https://horizon-live.stellar.org:1337');
this.axiosMock = sinon.mock(axios);
StellarSdk.Config.setDefault();
StellarSdk.Network.useTestNetwork();
});

afterEach(function () {
Expand Down Expand Up @@ -467,7 +468,7 @@ describe("server.js tests", function () {
describe('Server.submitTransaction', function() {
it("sends a transaction", function(done) {
let keypair = StellarSdk.Keypair.random();
let account = new StellarSdk.Account(keypair.accountId(), "56199647068161");
let account = new StellarSdk.Account(keypair.publicKey(), "56199647068161");
let transaction = new StellarSdk.TransactionBuilder(account)
.addOperation(StellarSdk.Operation.payment({
destination: "GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW",
Expand Down

0 comments on commit c89bb96

Please sign in to comment.