Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bitshares' into bitshares
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkmaster committed Aug 31, 2017
2 parents 3c0c8f6 + 03897df commit 3df0286
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 87 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ web/stats*
web/hash-history
docs/_build/
*.swp
*.python-version
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
---------------------------------------------------------------------
Release 2.0.170327
Release 2.0.170829
---------------------------------------------------------------------
New features
--------
- Add memo fee estimation to WithdrawModalBlockTrades and Transfer
- Show status of all API servers
- Add WanCloud API servers
- Allow Modal Close with Keyboard Control
- Transwiser: add bankwire withdraw option
- Force very strong generated password on account creation

Bug fixes
--------
- Fix #188: Total calculation (BTS) is not displayed correctly
- Add localStorage fallback to BlockTradesDepositAddressCache, fix #327
- Update BindToChainState for getAccount autosubscribe option, fix #202
- Ensure proxy props changing updates component state
- Ensure that vesting balances are updated when hot switching accounts
- Improve exchange fee calc with pool and balance checks, prevent placing orders when fees are not payable
- Add balance and fee pool checks to withdrawals
- Ensure primary asset shows up in balance calculations
- Add balance and fee pool checks to withdrawals, remove dead code
- Fix 'unknown value' displayed for 0 amount
- Fix error message for expired transactions
- Fix broken telegram chat room link
- Disable the trollbox, remove password change entry in settings for password logins
- Fix a rounding issue when estimating non-BTS fees in the exchange
- Fix Header not showing unlock state properly after wallet/account creation
- Add a worker creation form
- Fix depth chart for markets with extreme spreads

---------------------------------------------------------------------
Release 2.0.170410
---------------------------------------------------------------------
New features
--------
Expand Down
2 changes: 1 addition & 1 deletion electron/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "BitShares2-light",
"identifier": "org.bitshares.graphene",
"description": "BitShares - cryptocurrency and decentralized exchange",
"version": "2.0.170522",
"version": "2.0.170830",
"author": "community@bitshares.org",
"main": "electron.js",
"config": {
Expand Down
4 changes: 4 additions & 0 deletions web/app/actions/SettingsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class SettingsActions {
});
};
}

updateLatencies(latencies) {
return latencies;
}
}

export default alt.createActions(SettingsActions);
4 changes: 4 additions & 0 deletions web/app/assets/stylesheets/layout/_page_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ div.bordered-header {
font-size: 1.125rem;
}
}

.table-cell{
display: table-cell;
}
12 changes: 6 additions & 6 deletions web/app/assets/stylesheets/utils/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
}

//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
}
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
}
3 changes: 2 additions & 1 deletion web/app/components/Blockchain/Operation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class Row extends React.Component {
};

static defaultProps = {
dynGlobalObject: "2.1.0"
dynGlobalObject: "2.1.0",
tempComponent: "tr"
};

constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class ButtonConversion extends React.Component {
this._checkFeeStatus();
}

componentWillUnmount() {
this.unMounted = true;
}

componentWillReceiveProps(np) {
if (!np.amount.equals(this.props.amount) || np.account_id !== this.props.account_id) {
this._updateFee();
Expand All @@ -74,6 +78,8 @@ class ButtonConversion extends React.Component {
}
})
.then(({fee, hasBalance, hasPoolBalance}) => {
if (this.unMounted) return;

this.setState({
feeAmount: fee,
hasBalance,
Expand Down Expand Up @@ -104,6 +110,8 @@ class ButtonConversion extends React.Component {
}));
});
Promise.all(p).then(status => {
if (this.unMounted) return;

assets.forEach((a, idx) => {
feeStatus[a] = status[idx];
});
Expand Down Expand Up @@ -566,6 +574,8 @@ class BlockTradesBridgeDepositRequest extends React.Component {
let conversion_estimated_output_amount = this.getAndUpdateOutputEstimate("conversion", conversion_input_coin_type, conversion_output_coin_type, this.state.conversion_estimated_input_amount);
let conversion_limit = this.getCachedOrFreshDepositLimit("conversion", conversion_input_coin_type, conversion_output_coin_type);

if (this.unMounted) return;

this.setState({
coin_info_request_state: this.coin_info_request_states.request_complete,
coins_by_type: coins_by_type,
Expand Down Expand Up @@ -703,6 +713,7 @@ class BlockTradesBridgeDepositRequest extends React.Component {
componentWillUnmount()
{
clearInterval(this.update_timer);
this.unMounted = true;
}

// functions for managing input addresses
Expand Down Expand Up @@ -809,6 +820,7 @@ class BlockTradesBridgeDepositRequest extends React.Component {
{method: 'get', headers: new Headers({"Accept": "application/json"})})
.then(response => response.json());
deposit_limit_promise.then(reply => {
if (this.unMounted) return;
console.assert(reply.inputCoinType == input_coin_type &&
reply.outputCoinType == output_coin_type,
"unexpected reply from deposit-limits");
Expand All @@ -832,6 +844,7 @@ class BlockTradesBridgeDepositRequest extends React.Component {

getAndUpdateOutputEstimate(deposit_withdraw_or_convert, input_coin_type, output_coin_type, input_amount)
{
if (this.unMounted) return;
if (deposit_withdraw_or_convert == 'deposit') {
this.setState({failed_calculate_deposit: null});
}
Expand All @@ -850,6 +863,7 @@ class BlockTradesBridgeDepositRequest extends React.Component {
{method: 'get', headers: new Headers({"Accept": "application/json"})})
.then(response => response.json());
estimate_output_promise.then(reply => {
if (this.unMounted) return;
// console.log("Reply: ", reply);
if (reply.error)
{
Expand Down Expand Up @@ -901,6 +915,7 @@ class BlockTradesBridgeDepositRequest extends React.Component {

getAndUpdateInputEstimate(deposit_withdraw_or_convert, input_coin_type, output_coin_type, output_amount)
{
if (this.unMounted) return;
if (deposit_withdraw_or_convert == 'deposit') {
this.setState({failed_calculate_deposit: null});
}
Expand All @@ -919,6 +934,8 @@ class BlockTradesBridgeDepositRequest extends React.Component {
{method: 'get', headers: new Headers({"Accept": "application/json"})})
.then(response => response.json());
estimate_input_promise.then(reply => {
if (this.unMounted) return;

console.assert(reply.inputCoinType == input_coin_type &&
reply.outputCoinType == output_coin_type &&
reply.outputAmount == output_amount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class WithdrawModalBlocktrades extends React.Component {
this._updateFee();
}

componentWillUnmount() {
this.unMounted = true;
}

_updateFee(fee_asset_id = this.state.fee_asset_id) {
checkFeeStatusAsync({
accountID: this.props.account.get("id"),
Expand All @@ -73,6 +77,8 @@ class WithdrawModalBlocktrades extends React.Component {
}
})
.then(({fee, hasBalance, hasPoolBalance}) => {
if (this.unMounted) return;

this.setState({
feeAmount: fee,
hasBalance,
Expand Down
83 changes: 43 additions & 40 deletions web/app/components/Exchange/MyMarkets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MarketGroup extends React.Component {
return {
open: open !== undefined ? open : true,
inverseSort: props.viewSettings.get("myMarketsInvert", true),
sortBy: props.viewSettings.get("myMarketsSort", "volume")
sortBy: props.viewSettings.get("myMarketsSort", "volume"),
inputValue: ""
};
}

Expand Down Expand Up @@ -258,19 +259,19 @@ class MyMarkets extends React.Component {
constructor(props) {
super();

let inputValue = null; // props.viewSettings.get("marketLookupInput", null);
let symbols = inputValue ? inputValue.split(":") : [null];
let quote = symbols[0];
let base = symbols.length === 2 ? symbols[1] : null;
// let inputValue = null; // props.viewSettings.get("marketLookupInput", null);
// let symbols = inputValue ? inputValue.split(":") : [null];
// let quote = symbols[0];
// let base = symbols.length === 2 ? symbols[1] : null;

this.state = {
inverseSort: props.viewSettings.get("myMarketsInvert", true),
sortBy: props.viewSettings.get("myMarketsSort", "volume"),
activeTab: props.viewSettings.get("favMarketTab", "my-market"),
activeMarketTab: props.viewSettings.get("activeMarketTab", 0),
lookupQuote: quote,
lookupBase: base,
inputValue: inputValue,
lookupQuote: null,
lookupBase: null,
inputValue: "",
minWidth: "100%",
findBaseInput: "USD",
activeFindBase: "USD"
Expand Down Expand Up @@ -392,7 +393,7 @@ class MyMarkets extends React.Component {
}

_lookupAssets(value, force = false) {
console.log("__lookupAssets", value, force);
// console.log("__lookupAssets", value, force);
if (!value && value !== "") {
return;
}
Expand Down Expand Up @@ -644,7 +645,7 @@ class MyMarkets extends React.Component {
{myMarketTab ?
<div className="grid-block shrink" style={{width: "100%", textAlign: "left", padding: "0.75rem 0.5rem"}}>
<label className="no-margin">
<input style={{position: "relative", top: 3}} className="no-margin" type="checkbox" checked={this.props.onlyStars} onClick={() => {MarketsActions.toggleStars();}}/>
<input style={{position: "relative", top: 3}} className="no-margin" type="checkbox" checked={this.props.onlyStars} onChange={() => {MarketsActions.toggleStars();}}/>
<span>&nbsp;<Translate content="exchange.show_star_1" /><Icon className="gold-star" name="fi-star"/> <Translate content="exchange.show_star_2" /></span>
</label>
<div className="float-right" style={{paddingLeft: 20}}>
Expand All @@ -663,36 +664,38 @@ class MyMarkets extends React.Component {

<div style={{width: "100%", textAlign: "left", padding: "0.75rem 0.5rem"}}>
<table>
<tr style={{width: "100%"}}>
<td>
<AssetSelector
onAssetSelect={this._onFoundBaseAsset.bind(this)}
assets={defaultBases}
onChange={this._onInputBaseAsset.bind(this)}
asset={this.state.findBaseInput}
assetInput={this.state.findBaseInput}
tabIndex={1}
style={{width: "100%", paddingBottom: "1.5rem"}}
onFound={this._onFoundBaseAsset.bind(this)}
label="exchange.base"
noLabel
inputStyle={{fontSize: "0.9rem"}}
/>
</td>
</tr>
<tr style={{width: "100%"}}>
<td>
<label><Translate content="account.user_issued_assets.name" />:</label>
<input
style={{fontSize: "0.9rem", position: "relative", top: 1}}
type="text"
value={this.state.inputValue}
onChange={this._onInputName.bind(this)}
placeholder={counterpart.translate("exchange.search")}
maxLength="16"
/>
</td>
</tr>
<tbody>
<tr style={{width: "100%"}}>
<td>
<AssetSelector
onAssetSelect={this._onFoundBaseAsset.bind(this)}
assets={defaultBases}
onChange={this._onInputBaseAsset.bind(this)}
asset={this.state.findBaseInput}
assetInput={this.state.findBaseInput}
tabIndex={1}
style={{width: "100%", paddingBottom: "1.5rem"}}
onFound={this._onFoundBaseAsset.bind(this)}
label="exchange.base"
noLabel
inputStyle={{fontSize: "0.9rem"}}
/>
</td>
</tr>
<tr style={{width: "100%"}}>
<td>
<label><Translate content="account.user_issued_assets.name" />:</label>
<input
style={{fontSize: "0.9rem", position: "relative", top: 1}}
type="text"
value={this.state.inputValue}
onChange={this._onInputName.bind(this)}
placeholder={counterpart.translate("exchange.search")}
maxLength="16"
/>
</td>
</tr>
</tbody>
</table>
</div>
}
Expand Down
16 changes: 8 additions & 8 deletions web/app/components/Layout/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class Header extends React.Component {
return (
<li className={name === account_display_name ? "current-account" : ""} key={name}>
<a href onClick={this._accountClickHandler.bind(this, name)}>
<td><AccountImage style={{position: "relative", top: 5}} size={{height: 20, width: 20}} account={name}/></td>
<td style={{paddingLeft: 10}}><span>{name}</span></td>
<div className="table-cell"><AccountImage style={{position: "relative", top: 5}} size={{height: 20, width: 20}} account={name}/></div>
<div className="table-cell" style={{paddingLeft: 10}}><span>{name}</span></div>
</a>
</li>
);
Expand All @@ -227,16 +227,16 @@ class Header extends React.Component {
tradingAccounts.length === 1 ?
(<ActionSheet.Button title="" setActiveState={() => {}}>
<a onClick={this._accountClickHandler.bind(this, account_display_name)} style={{cursor: "default", padding: "1rem", border: "none"}} className="button">
<td><AccountImage style={{display: "inline-block"}} size={{height: 20, width: 20}} account={account_display_name}/></td>
<td style={{paddingLeft: 5}}><div className="inline-block"><span>{account_display_name}</span></div></td>
<div className="table-cell"><AccountImage style={{display: "inline-block"}} size={{height: 20, width: 20}} account={account_display_name}/></div>
<div className="table-cell" style={{paddingLeft: 5}}><div className="inline-block"><span>{account_display_name}</span></div></div>
</a>
</ActionSheet.Button>) :

(<ActionSheet>
<ActionSheet.Button title="">
<a style={{padding: "1rem", border: "none"}} className="button">
<td><AccountImage style={{display: "inline-block"}} size={{height: 20, width: 20}} account={account_display_name}/></td>
<td style={{paddingLeft: 5}}><div className="inline-block"><span>{account_display_name}</span></div></td>
<div className="table-cell"><AccountImage style={{display: "inline-block"}} size={{height: 20, width: 20}} account={account_display_name}/></div>
<div className="table-cell" style={{paddingLeft: 5}}><div className="inline-block"><span>{account_display_name}</span></div></div>
</a>
</ActionSheet.Button>
{tradingAccounts.length > 1 ?
Expand Down Expand Up @@ -286,8 +286,8 @@ class Header extends React.Component {
return (
<li key={locale}>
<a href onClick={(e) => {e.preventDefault(); IntlActions.switchLocale(locale);}}>
<td><FlagImage flag={locale} /></td>
<td style={{paddingLeft: 10}}><Translate content={"languages." + locale} /></td>
<div className="table-cell"><FlagImage flag={locale} /></div>
<div className="table-cell" style={{paddingLeft: 10}}><Translate content={"languages." + locale} /></div>

</a>
</li>
Expand Down
Loading

0 comments on commit 3df0286

Please sign in to comment.