Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
sschiessl-bcp committed Mar 1, 2021
2 parents a200d34 + 964496a commit bea5479
Show file tree
Hide file tree
Showing 86 changed files with 5,623 additions and 2,562 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/npm-build-and-deploy-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean install of node dependencies, build the source code and push the binaries to the deployment repository.
name: Continuous Delivery and Deployment

on:
push:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- name: Create CNAME file
uses: finnp/create-file-action@master
env:
FILE_NAME: build/dist/CNAME
FILE_DATA: develop.bitshares.org
- name: Deploy
uses: s0/git-publish-subdir-action@master
env:
REPO: [email protected]:bitshares/develop.bitshares.org.git
BRANCH: master
FOLDER: build/dist
SSH_PRIVATE_KEY: ${{ secrets.AUTOMATION_UI_DEPLOYMENT_KEY }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ app/stats-dev.json
app/stats-prod.json
app/test/MarketClasses.js
yarn.lock
charting_library/charting_library.zip

charting_library/*
!charting_library/scss
!charting_library/charting_library.17.025.02b61a1c.zip.md5
!charting_library/package-charting-library.js
!charting_library/install-charting-library.js
4 changes: 3 additions & 1 deletion app/actions/TransactionConfirmActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class TransactionConfirmActions {
// try to break down the error in human readable pieces
let splitError = error.message.split("\n");
let data, code;
if (splitError.length > 1) {
if (splitError.length == 1) {
message = splitError[0];
} else if (splitError.length > 1) {
try {
jsonError = JSON.parse(splitError[1]);
data = jsonError.data;
Expand Down
88 changes: 87 additions & 1 deletion app/api/ApplicationApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
TransactionBuilder,
TransactionHelper,
FetchChain,
ChainStore
ChainStore,
ChainTypes
} from "bitsharesjs";
import counterpart from "counterpart";
import {Notification} from "bitshares-ui-style-guide";
Expand Down Expand Up @@ -761,6 +762,91 @@ const ApplicationApi = {
}
);

transactionBuilder.add_operation(op);
await WalletDb.process_transaction(transactionBuilder, null, broadcast);
if (!transactionBuilder.tr_buffer) {
throw "Something went finalization the transaction, this should not happen";
}
},

async createVestingBalance(
creator,
owner,
asset,
amount,
policy,
feeAsset = "1.3.0",
broadcast = true
) {
// account must be unlocked
await WalletUnlockActions.unlock();

// ensure all arguments are chain objects
let objects = {
creator: await this._ensureAccount(creator),
owner: await this._ensureAccount(owner),
asset: await this._ensureAsset(asset),
feeAsset: await this._ensureAsset(feeAsset)
};

let transactionBuilder = new TransactionBuilder();
let op = transactionBuilder.get_type_operation(
"vesting_balance_create",
{
fee: {
amount: 0,
asset_id: objects.feeAsset.get("id")
},
creator: objects.creator.get("id"),
owner: objects.owner.get("id"),
amount: {
amount: amount,
asset_id: objects.asset.get("id")
},
policy: policy
}
);

transactionBuilder.add_operation(op);
await WalletDb.process_transaction(transactionBuilder, null, broadcast);
if (!transactionBuilder.tr_buffer) {
throw "Something went finalization the transaction, this should not happen";
}
},

async createTicket(
account,
asset,
amount,
targetType = ChainTypes.ticket_type.lock_forever,
feeAsset = "1.3.0",
broadcast = true
) {
// account must be unlocked
await WalletUnlockActions.unlock();

// ensure all arguments are chain objects
let objects = {
account: await this._ensureAccount(account),
asset: await this._ensureAsset(asset),
feeAsset: await this._ensureAsset(feeAsset)
};

let transactionBuilder = new TransactionBuilder();
let op = transactionBuilder.get_type_operation("ticket_create", {
fee: {
amount: 0,
asset_id: objects.feeAsset.get("id")
},
account: objects.account.get("id"),
target_type: targetType,
amount: {
amount: amount,
asset_id: objects.asset.get("id")
},
extensions: {}
});

transactionBuilder.add_operation(op);
await WalletDb.process_transaction(transactionBuilder, null, broadcast);
if (!transactionBuilder.tr_buffer) {
Expand Down
2 changes: 1 addition & 1 deletion app/api/accountApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Api {
// direct query, circumventing subscription system of ChainStore
return Apis.instance()
.db_api()
.exec("lookup_accounts", [startChar, limit]);
.exec("lookup_accounts", [startChar, limit], false);
}
lookupAccountByPublicKey(pubKey) {
// direct query, circumventing subscription system of ChainStore
Expand Down
Loading

0 comments on commit bea5479

Please sign in to comment.