Skip to content
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

update 'next' xdr to latest preview 9 version #599

Closed
wants to merge 8 commits into from
Closed
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
13 changes: 8 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"presets": [
["env", {
"targets": {
"ie": "11"
"@babel/preset-env"
],
"env": {
"development": {
"plugins": [
"istanbul"
]
}
}]
]
}
}
9 changes: 0 additions & 9 deletions .eslintrc.js

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node (14.x)
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '14.x'

- name: Install Dependencies
run: yarn install

- name: Build
run: gulp
- name: Build & Test
run: yarn preversion

- name: Checkout GH pages
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: stellar/js-stellar-base
ref: gh-pages
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ on:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Depencencies
run: yarn

- name: Build
run: gulp
- name: Test & Build
run: yarn preversion

- name: Publish npm package
run: yarn publish
run: yarn publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ jobs:
fail-fast: false
max-parallel: 2
matrix:
node-version: [14, 16]
node-version: [14, 16, 18]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: yarn install

- name: Build
run: gulp
- name: Build All
run: yarn build:prod

- name: Run Node Tests
run: yarn test
run: yarn test:node

- name: Run Browser Tests
run: gulp test:browser
run: yarn build:browser:prod && yarn test:browser

- name: Run Linter
run: yarn dtslint
run: yarn lint
25 changes: 25 additions & 0 deletions .github/workflows/update-completed-sprint-on-issue-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Update CompletedSprint on Issue Closed

on:
issues:
types: [closed]
pull_request:
types: [closed]

jobs:
update-completed-sprint:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_ID }}
private_key: ${{ secrets.GH_PROJECT_MANAGEMENT_APP_PEM }}
- name: Update CompletedSprint on Issue Closed
id: update_completedsprint_on_issue_closed
uses: stellar/actions/update-completed-sprint-on-issue-closed@main
with:
project_name: "Platform Scrum"
field_name: "CompletedSprint"
project_token: ${{ steps.generate_token.outputs.token }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.nvmrc
.nyc_output/
/node_modules/
/tmp/
/lib/
/dist/
/config/dist/
/coverage/
/jsdoc/
.DS_Store
4 changes: 0 additions & 4 deletions .jshintrc

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

29 changes: 24 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@

## Unreleased


## [v9.0.0-beta.1](https://github.com/stellar/js-stellar-base/compare/v9.0.0-beta.0..v9.0.0-beta.1)

### Fix

- Correct XDR type definition for raw `xdr.Operation`s ([#591](https://github.com/stellar/js-stellar-base/pull/591)).


## [v9.0.0-beta.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0-beta.0)

This version is marked by a major version bump because of the significant upgrades to underlying dependencies. While there should be no noticeable API changes from a downstream perspective, there may be breaking changes in the way that this library is bundled.

### Fix

- Build system has been overhauled to support Webpack 5 ([#585](https://github.com/stellar/js-stellar-base/pull/585)).

- Current and vNext XDR updated to latest versions ([#587](https://github.com/stellar/js-stellar-base/pull/587)).


## [v8.2.2](https://github.com/stellar/js-stellar-base/compare/v8.2.1..v8.2.2)

### Fix
Expand All @@ -25,7 +44,7 @@

## [v8.1.0](https://github.com/stellar/js-stellar-base/compare/v8.0.1..v8.1.0)

### Add
### Add

* `TransactionBase.addDecoratedSignature` is a clearer way to add signatures directly to a built transaction without fiddling with the underlying `signatures` array ([#535](https://github.com/stellar/js-stellar-base/pull/535)).

Expand Down Expand Up @@ -231,7 +250,7 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
## [v5.3.1](https://github.com/stellar/js-stellar-base/compare/v5.3.0..v5.3.1)

### Fix
- Creating operations with both muxed and unmuxed properties resulted in unintuitive XDR. Specifically, the unmuxed property would be transformed into the equivalent property with an ID of 0 ([#441](https://github.com/stellar/js-stellar-base/pull/441)).
- Creating operations with both muxed and unmuxed properties resulted in unintuitive XDR. Specifically, the unmuxed property would be transformed into the equivalent property with an ID of 0 ([#441](https://github.com/stellar/js-stellar-base/pull/441)).


## [v5.3.0](https://github.com/stellar/js-stellar-base/compare/v5.2.1..v5.3.0)
Expand Down Expand Up @@ -268,13 +287,13 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAD5DTGC 1000

const mux2 = ACC.createSubaccount('2000');
console.log("Parent relationship preserved:",
console.log("Parent relationship preserved:",
mux2.baseAccount().accountId() === mux1.baseAccount().accountId());
console.log(mux2.accountId(), mux2.id());
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAH2B4RU 2000

mux1.setID('3000');
console.log("Underlying account unchanged:",
console.log("Underlying account unchanged:",
ACC.accountId() === mux1.baseAccount().accountId());
console.log(mux1.accountId(), mux1.id());
// MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAALXC5LE 3000
Expand All @@ -293,7 +312,7 @@ Please refer to the [security advisory](https://github.com/advisories/GHSA-pjwm-

### Update

- The Typescript definitions have been updated to support CAP-35 ([#407](https://github.com/stellar/js-stellar-base/pull/407)).
- The Typescript definitions have been updated to support CAP-35 ([#407](https://github.com/stellar/js-stellar-base/pull/407)).

## [v5.0.0](https://github.com/stellar/js-stellar-base/compare/v4.0.3..v5.0.0)

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Then please [sign the Contributor License Agreement](https://docs.google.com/for


# Releasing
SDK maintainers should follow [semantic versioning](https://semver.org/) best practices for releasing the SDK.
SDK maintainers should follow [semantic versioning](https://semver.org/) best practices for releasing the SDK.

Use your best judgement when deciding on when to craft a release: maybe enough changes have accumulated to warrant a release, maybe there's a high-urgency fix that needs to be published immediately, or maybe you can put it off for a particular feature. It's all dependent on what else is going on.

Expand All @@ -22,9 +22,9 @@ Once all of the PRs for a particular release are in, it's time to actually publi

- [ ] Ensure that all of the PRs in this delta are accurately reflected in the [CHANGELOG](./CHANGELOG.md), broken down by impact and linking to the corresponding PRs. Update the file if necessary.

- [ ] Update the top-level `"version"` field in the [package.json](./package.json) file to reflect the new version.
- [ ] Run `yarn preversion` to build and test an optimized bundle and ensure Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS).

- [ ] Run the final sanity check to ensure the builds pass: `yarn dtslint && yarn test && yarn preversion`. The first command checks that you have Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS).
- [ ] Run `yarn version` to update the version number in the package.json (or modify the `"version"` field manually).

- [ ] Commit & push your branch, then [create a PR](https://github.com/stellar/js-stellar-base/compare).

Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XDR_BASE_URL_CURR=https://github.com/stellar/stellar-core/raw/master/src/protocol-curr/xdr
XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/curr
XDR_BASE_LOCAL_CURR=xdr/curr
XDR_FILES_CURR= \
Stellar-SCP.x \
Expand All @@ -9,7 +9,7 @@ XDR_FILES_CURR= \
Stellar-types.x
XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR))

XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr-next/raw/main
XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/next
XDR_BASE_LOCAL_NEXT=xdr/next
XDR_FILES_NEXT= \
Stellar-SCP.x \
Expand All @@ -20,7 +20,10 @@ XDR_FILES_NEXT= \
Stellar-types.x \
Stellar-contract.x \
Stellar-contract-env-meta.x \
Stellar-contract-spec.x
Stellar-contract-meta.x \
Stellar-contract-spec.x \
Stellar-contract-config-setting.x \

XDR_FILES_LOCAL_NEXT=$(addprefix xdr/next/,$(XDR_FILES_NEXT))

XDRGEN_COMMIT=master
Expand All @@ -33,17 +36,17 @@ generate: src/generated/curr_generated.js types/curr.d.ts src/generated/next_gen
src/generated/curr_generated.js: $(XDR_FILES_LOCAL_CURR)
mkdir -p $(dir $@)
> $@
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.7 && \
docker run -it --rm -v $$PWD:/wd -w /wd ruby:3.1 /bin/bash -c '\
gem install specific_install -v 0.3.8 && \
gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_COMMIT) && \
xdrgen --language javascript --namespace curr --output src/generated $^ \
'

src/generated/next_generated.js: $(XDR_FILES_LOCAL_NEXT)
mkdir -p $(dir $@)
> $@
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.7 && \
docker run -it --rm -v $$PWD:/wd -w /wd ruby:3.1 /bin/bash -c '\
gem install specific_install -v 0.3.8 && \
gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_COMMIT) && \
xdrgen --language javascript --namespace next --output src/generated $^ \
'
Expand Down
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ implementation in JavaScript that can be used on either Node.js or web browsers.

> **Warning!** The Node version of this package uses the [`sodium-native`](https://www.npmjs.com/package/sodium-native) package, a native implementation of [Ed25519](https://ed25519.cr.yp.to/) in Node.js, as an [optional dependency](https://docs.npmjs.com/files/package.json#optionaldependencies).
> This means that if for any reason installation of this package fails, `stellar-base` will fallback to the much slower implementation contained in [`tweetnacl`](https://www.npmjs.com/package/tweetnacl).
>
>
> If you'd explicitly prefer **not** to install the `sodium-native` package, pass the appropriate flag to skip optional dependencies when installing this package (e.g. `--no-optional` if using `npm install` or `--without-optional` using `yarn install`).
>
>
> If you are using `stellar-base` in a browser you can ignore this. However, for production backend deployments you should most likely be using `sodium-native`.
> If `sodium-native` is successfully installed and working,
> `StellarBase.FastSigning` variable will be equal `true`. Otherwise it will be
Expand Down Expand Up @@ -102,11 +102,11 @@ Make sure that you are using the latest version number. They can be found on the

We support the oldest LTS release of Node, which is [currently 14.x](https://nodejs.org/en/about/releases/). Please likewise install and develop on Node 14 so you don't get surprised when your code works locally but breaks in CI.

If you work on several projects that use different Node versions, you might find helpful to install a nodejs version manager.
If you work on several projects that use different Node versions, you might find helpful to install a NodeJS version manager:

- https://github.com/creationix/nvm
- https://github.com/wbyoung/avn
- https://github.com/asdf-vm/asdf
- https://github.com/creationix/nvm
- https://github.com/wbyoung/avn
- https://github.com/asdf-vm/asdf

2. Install Yarn

Expand All @@ -127,17 +127,22 @@ yarn

5. Observe the project's code style

While you're making changes, make sure to run the linter-watcher to catch any
While you're making changes, make sure to regularly run the linter to catch any
linting errors (in addition to making sure your text editor supports ESLint)

```shell
node_modules/.bin/gulp watch
yarn lint
```

as well as fixing any formatting errors with

```shell
yarn fmt
```

If you're working on a file not in `src`, limit your code to Node 6.16 ES! See
what's supported here: https://node.green/ (The reason is that our npm library
must support earlier versions of Node, so the tests need to run on those
versions.)
what's supported here: https://node.green/. (Our npm library must support
earlier versions of Node, so the tests need to run on those versions.)

#### Updating XDR definitions

Expand All @@ -154,18 +159,16 @@ For information on how to use js-stellar-base, take a look at the docs in the
To run all tests:

```shell
gulp test
yarn test
```

To run a specific set of tests:

```shell
gulp test:node
gulp test:browser
yarn test:node
yarn test:browser
```

You can also run `yarn test` for a simpler subset of the test cases.

Tests are also run automatically in Github Actions for every master commit and
pull request.

Expand Down
Loading