Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #396 from rhinofi/dev
Browse files Browse the repository at this point in the history
bump version to 5.1.1
  • Loading branch information
arijoon authored Apr 26, 2023
2 parents 0666da7 + 3c0506c commit 5e9c4d6
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 41 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/test-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@ jobs:

- name: Run deploy-step
run: |
set -euo pipefail
run_nix () {
nix run --impure -f nix/pkgs-private.nix "${@}"
}
if [[ ${{ github.ref }} == refs/heads/master || ${{ github.ref }} == refs/heads/dev ]]
then
extra_args=""
if [[ ${{ github.ref }} == refs/heads/dev ]]
is_dev_release=true
if [[ ${{ github.ref }} == refs/heads/master ]]
then
# On dev we pudlish with -dev appended to version
nix run --impure -f nix/pkgs-private.nix append-dev-to-node-package-version
extra_args="--tag next"
is_dev_release=false
fi
# NOTE: if this fails with a 403 it's most likely due to not bumping
# version in package.json
nix run --impure -f nix/pkgs-private.nix ci.deploy-step -- $extra_args
run_nix ci.deploy-step -- "$is_dev_release"
else
echo skipping
fi
2 changes: 1 addition & 1 deletion nix/overlays.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ sources ? import ./sources.nix }:
[
(self: super: {
yarn-berry-source = sources.yarn-berry-cjs;
yarn-berry-source = sources.yarn-berry-cjs-rhinofi;
yarn-berry = super.callPackage (import ./packages/yarn-berry.nix) {};
})
(self: super: {
Expand Down
52 changes: 51 additions & 1 deletion nix/pkgs-private.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,57 @@ let
)
{}
;
deploy-step = self.npm-publish;
deploy-step = self.callPackage
({
append-dev-to-node-package-version,
bash-logging-helpers,
coreutils,
gh-with-ci-creds,
jq,
lib,
nodejs,
npm-publish,
utils,
name ? "deploy-step"
}: utils.writeBashBin
"deploy-step"
''
set -ueo pipefail
source ${bash-logging-helpers.defaultBinPath}
is_dev_release=''${1:-true}
gh_relase_extra_args=
npm_publish_extra_args=
log "is_dev_release: $is_dev_release"
if [[ $is_dev_release == true ]]; then
${lib.getExe append-dev-to-node-package-version}
gh_relase_extra_args=--prerelease
npm_publish_extra_args="--tag next"
fi
version=$(${lib.getExe jq} -r .version package.json)
log
log_separator
log_bold "publishig to npm, version: $version"
log
${lib.getExe npm-publish} $npm_publish_extra_args
title=$(${coreutils}/bin/cat release-info/latest-release-title)
log
log_separator
log_bold "creating a GitHub release"
log "with title: $title"
log
${lib.getExe gh-with-ci-creds} dev release create -t "$title" "$version" $gh_relase_extra_args
''
)
{}
;
};
})
# TODO: format all code and resolve linter errors before enabling this
Expand Down
38 changes: 19 additions & 19 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "fix-yarn2nix-for-nix-2.5-6_29769d2a1390d294469bcc6518f17931953545e1",
"branch": "master",
"description": "Nix Packages collection",
"homepage": "",
"owner": "rhinofi",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "41b5736e8a7584ddf096a05b8b3afaf2a75e66fe",
"sha256": "0jg0jvc1acw9f71v0c7yyp13c37wjz2slnb3jd1d066g5vz3b3qi",
"rev": "8e3fad82be64c06fbfb9fd43993aec9ef4623936",
"sha256": "0x4yzsrrzq2q1ah77yydjg35niirx7yxvpzdryfnw0cr5bkszd3d",
"type": "tarball",
"url": "https://github.com/rhinofi/nixpkgs/archive/41b5736e8a7584ddf096a05b8b3afaf2a75e66fe.tar.gz",
"url": "https://github.com/nixos/nixpkgs/archive/8e3fad82be64c06fbfb9fd43993aec9ef4623936.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"yarn-berry-cjs": {
"branch": "master",
"description": null,
"rhino-core": {
"branch": "dev",
"description": "Instructions to deploy the required services for DeversiFi Exchange",
"homepage": "",
"owner": "rhinofi",
"repo": "yarn-berry-cjs",
"rev": "75a5282d9606586d7c2f9e38b07f352cdeab46e3",
"sha256": "1hwxlglh02b2h6778dd24hfdhs765s6fg55lhy6ll730n75wxvyp",
"repo": "rhino-core",
"rev": "c2183a731421203e076c7dba37d339fa15e70b1d",
"sha256": "0ygx4q7pna7qr8d8wx42ynk7ygz3cpz8zjd7hz1nz3wx39d4ps9h",
"type": "tarball",
"url": "https://github.com/rhinofi/yarn-berry-cjs/archive/75a5282d9606586d7c2f9e38b07f352cdeab46e3.tar.gz",
"url": "https://github.com/rhinofi/rhino-core/archive/c2183a731421203e076c7dba37d339fa15e70b1d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rhino-core": {
"branch": "dev",
"description": "Instructions to deploy the required services for DeversiFi Exchange",
"yarn-berry-cjs-rhinofi": {
"branch": "rhinofi-fork-3.4.1",
"description": null,
"homepage": "",
"owner": "rhinofi",
"repo": "rhino-core",
"rev": "b7c78d58697a7e8048ecc13b16fdf5a8e91edafe",
"sha256": "17mgv2gnsv6ix3ypab8qmpwma60wp6jbdvz39s6sycavsslp1ddj",
"repo": "yarn-berry-cjs",
"rev": "4d14f0f36378091fcff3a4c4c8de4d5b7c3ca9e0",
"sha256": "106a4hsfln2hdw17vlgjb40bnx6y9iqib8awlbjlkivxya039wzd",
"type": "tarball",
"url": "https://github.com/rhinofi/rhino-core/archive/b7c78d58697a7e8048ecc13b16fdf5a8e91edafe.tar.gz",
"url": "https://github.com/rhinofi/yarn-berry-cjs/archive/4d14f0f36378091fcff3a4c4c8de4d5b7c3ca9e0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rhino.fi/client-js",
"version": "5.0.1",
"version": "5.1.1",
"main": "src/index.js",
"files": [
"src",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@ledgerhq/hw-app-eth": "6.23.0",
"@ledgerhq/hw-transport-webhid": "6.20.0",
"@rhino.fi/dvf-utils": "^1.4.5",
"@rhino.fi/starkware-crypto": "rhinofi/starkware-crypto#504edca95842796908e74dad09518d092fca4e1b",
"@rhino.fi/starkware-crypto": "^0.1.7",
"aigle": "suguru03/aigle#8739846ba9d4cfc116e1546da1181c73564cae0b",
"aware": "^0.3.1",
"bignumber.js": "^9.0.0",
Expand Down
1 change: 1 addition & 0 deletions release-info/latest-release-title
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Major release for cross-chain
11 changes: 7 additions & 4 deletions src/api/bridgedWithdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ const schema = Joi.object({
nonce: Joi.number().integer()
.min(0)
// Will be auto-generated if not provided.
.optional()
.optional(),
// Temporary - to be removed after bridge withdrawal fees update (CHAIN-586)
isFeeUsd: Joi.boolean().optional()
})

const validateArg0 = validateWithJoi(schema)('INVALID_METHOD_ARGUMENT')({
context: `bridgedWithdrawal`
context: 'bridgedWithdrawal'
})

const endpoint = '/v1/trading/bridgedWithdrawals'

module.exports = async (dvf, data, authNonce, signature) => {
const { chain, token, amount, nonce } = validateArg0(data)
const { chain, token, amount, nonce, isFeeUsd } = validateArg0(data)

const tokenInfo = dvf.token.getTokenInfoOrThrow(token)
// To make it fail if token is not supported
Expand All @@ -48,7 +50,8 @@ module.exports = async (dvf, data, authNonce, signature) => {
token,
amount: quantisedAmount,
tx,
nonce: nonce || generateRandomNonceV2()
nonce: nonce || generateRandomNonceV2(),
...(isFeeUsd ? { isFeeUsd: true } : {})
}

// Force the use of header (instead of payload) for authentication.
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ __metadata:
"@ledgerhq/hw-transport-mocker": ^5.25.0
"@ledgerhq/hw-transport-webhid": 6.20.0
"@rhino.fi/dvf-utils": ^1.4.5
"@rhino.fi/starkware-crypto": "rhinofi/starkware-crypto#504edca95842796908e74dad09518d092fca4e1b"
"@rhino.fi/starkware-crypto": ^0.1.7
"@truffle/hdwallet-provider": ^2.0.13
aigle: "suguru03/aigle#8739846ba9d4cfc116e1546da1181c73564cae0b"
aware: ^0.3.1
Expand Down Expand Up @@ -1433,9 +1433,9 @@ __metadata:
languageName: node
linkType: hard

"@rhino.fi/starkware-crypto@rhinofi/starkware-crypto#504edca95842796908e74dad09518d092fca4e1b":
version: 0.1.4
resolution: "@rhino.fi/starkware-crypto@https://github.com/rhinofi/starkware-crypto.git#commit=504edca95842796908e74dad09518d092fca4e1b"
"@rhino.fi/starkware-crypto@npm:^0.1.7":
version: 0.1.7
resolution: "@rhino.fi/starkware-crypto@npm:0.1.7"
dependencies:
bn.js: ^4.4.0
brorand: ^1.0.1
Expand All @@ -1445,7 +1445,7 @@ __metadata:
inherits: ^2.0.1
minimalistic-assert: ^1.0.0
minimalistic-crypto-utils: ^1.0.0
checksum: 9af5dac8d8f9e601c3abd2c17b9612af1b69548e92fa6549b05e62b08149b26c62e86d3be064a02ea3c6eed8b875cd08911084b9b4d2601ae3fbb4cb6ac6623b
checksum: 5671d75df05f61998460e264ebde790dd854b2b80d187cc02291a7b80a5f85ab4412e3ade9da26abd2ceae4bd0600579cdc6a4598b422f2cd15b422f226936d0
languageName: node
linkType: hard

Expand Down Expand Up @@ -1903,7 +1903,7 @@ __metadata:
resolution: "aigle@https://github.com/suguru03/aigle.git#commit=8739846ba9d4cfc116e1546da1181c73564cae0b"
dependencies:
aigle-core: ^1.0.0
checksum: 13e64b4c53be4cab5a6a3323cebfb92165786f6c099f0b056643f26ced0cb882ffd49fbba4a2c81d4115a940f51429851d4325af4cb0a7464146b96ba057566c
checksum: 35c493511d9697428da7b7ce57d9069f8c562b5857777cb00824c2bb62f7c373e58293f6b44a94de65c47ee05bd87664bbfc6fa2a652751f75d9089ce1053cc0
languageName: node
linkType: hard

Expand Down Expand Up @@ -4668,7 +4668,7 @@ __metadata:

"fsevents@patch:fsevents@^2.1.2#~builtin<compat/fsevents>":
version: 2.3.2
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7"
resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=df0bf1"
dependencies:
node-gyp: latest
conditions: os=darwin
Expand Down Expand Up @@ -8531,7 +8531,7 @@ __metadata:

"resolve@patch:resolve@^1.10.0#~builtin<compat/resolve>, resolve@patch:resolve@^1.14.2#~builtin<compat/resolve>, resolve@patch:resolve@^1.18.1#~builtin<compat/resolve>":
version: 1.22.1
resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin<compat/resolve>::version=1.22.1&hash=07638b"
resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin<compat/resolve>::version=1.22.1&hash=c3c19d"
dependencies:
is-core-module: ^2.9.0
path-parse: ^1.0.7
Expand Down

0 comments on commit 5e9c4d6

Please sign in to comment.