Skip to content

Commit

Permalink
v1.0.2-RC2 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
MButcho authored Jan 13, 2021
1 parent e23be9c commit 586f160
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 33 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ https://support.ledger.com/hc/en-us/articles/115005165269-Connection-issues-with
```
wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash
```

Any donation to ELA address EUSMsck3svNiacva9LfwrLfbvNnUU27z77 or mbutcho (CryptoName) is much appreciated.

### Thank you and enjoy!
16 changes: 8 additions & 8 deletions docs/build-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ npm run dist-linux;


## Checksum:
1.0.2-RC1
1.0.2-RC2

windows:

openssl dgst -sha512 -binary Elastos-Light-Wallet-Setup-1.0.2-RC1.exe | openssl base64 -A
openssl dgst -sha512 -binary Elastos-Light-Wallet-Setup-1.0.2-RC2.exe | openssl base64 -A

xxxx

Ubuntu 18:

openssl sha -sha512 Elastos-Light-Wallet-1.0.2-RC1.AppImage
openssl sha -sha512 Elastos-Light-Wallet-1.0.2-RC2.AppImage

xxxx

Mac:

openssl dgst -sha512 Elastos-Light-Wallet-1.0.2-RC1.dmg
openssl dgst -sha512 Elastos-Light-Wallet-1.0.2-RC2.dmg

xxxx

Expand All @@ -77,13 +77,13 @@ npm ls node-gyp


# to auto build a releases
git commit -am v1.0.2-RC1;
git tag v1.0.2-RC1;
git commit -am v1.0.2-RC2;
git tag v1.0.2-RC2;
git push;
git push --tags;

## to delete release tags
git push --delete origin v1.0.2-RC1;
git tag -d v1.0.2-RC1;
git push --delete origin v1.0.2-RC2;
git tag -d v1.0.2-RC2;
git pull;
git push;
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elastos-light-wallet",
"version": "v1.0.2-RC1",
"version": "v1.0.2-RC2",
"description": "elastos light wallet",
"productName": "Elastos Light Wallet",
"main": "index.js",
Expand Down
22 changes: 9 additions & 13 deletions scripts/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1439,11 +1439,6 @@ const clearSelection = () => {

const clearUTXOsSelection = () => {
//mainConsole.log('Before clearUTXOsSelection', selectedUTXOs);
selectedUTXOs.map(e => {
if (e.isSelected) {
e.isSelected = false;
}
});
selectedUTXOs.length = 0;
selectedUTXOs = [];
customUTXOs = false;
Expand Down Expand Up @@ -2909,7 +2904,7 @@ const getPasswordRegEx = () => {

const getTXDetails = (_txID) => {
let txDetail = parsedTransactionHistory.filter(tx => tx.txHash === _txID);
//console.log(JSON.stringify(txDetail));
//console.log(JSON.stringify(selectedUTXOs));
return txDetail;
}

Expand All @@ -2921,10 +2916,10 @@ const getMaxCandidates = () => {
return maxCandidates;
}

const toggleUTXOControl = (_item) => {
const selectUTXO = parsedUnspentTransactionOutputs[_item.index];
const toggleUTXOControl = (_utxoIx) => {
const selectUTXO = parsedUnspentTransactionOutputs.find(element => element.utxoIx === _utxoIx);
//console.log(_utxoIx, JSON.stringify(selectUTXO));
if (!checkUTXO(selectUTXO.utxoIx)) {
//console.log(JSON.stringify(selectUTXO));
selectedUTXOs.push(selectUTXO);
} else {
for(var i = 0; i < selectedUTXOs.length; i++) {
Expand Down Expand Up @@ -2960,21 +2955,22 @@ const validateUTXOsSelection = () => {
return true;
}

const checkUTXO = (_index) => {
const checkUTXO = (_utxoIx) => {
let matchUTXO = false;
if (selectedUTXOs.length > 0) {
selectedUTXOs.forEach((_utxo) => {
if (_utxo.utxoIx === _index) {
if (_utxo.utxoIx === _utxoIx) {
matchUTXO = true;
}
});
}
return matchUTXO;
}

const selectMaxUTXOs = () => {
const selectMaxUTXOs = (_sort, _direction) => {
clearUTXOsSelection();
selectedUTXOs = parsedUnspentTransactionOutputs.slice(0, getMaxUTXOsPerTX());
let tempUTXOs = parsedUnspentTransactionOutputs;
selectedUTXOs = tempUTXOs.sort(_sort === "index" ? (({utxoIx: previousutxoIx}, {utxoIx: currentutxoIx}) => _direction === "asc" ? previousutxoIx - currentutxoIx : currentutxoIx - previousutxoIx) : (({Value: previousValue}, {Value: currentValue}) => _direction === "asc" ? previousValue - currentValue : currentValue - previousValue)).slice(0, getMaxUTXOsPerTX());
}

const getSelectedUTXOs = () => {
Expand Down
30 changes: 30 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2842,4 +2842,34 @@ input:checked + .slider:before {
background: none;
color: #B2B4C3;
font-size: 14px;
}

.sort-arrow {
margin-left: 5px;
position: relative;
top: -2px;
border: solid;
border-width: 0 2px 2px 0;
display: inline-block;
padding: 2px;
}

.right {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}

.left {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}

.up {
transform: rotate(-135deg);
-webkit-transform: rotate(-135deg);
}

.down {
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
8 changes: 4 additions & 4 deletions views/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ module.exports = (props) => {
<button className="requestsButtons padding_5px display_inline dark-hover br10 cursor_def m15L" onClick={(e) => App.clearRequests()}>Clear requests</button>
</div>

<button tabIndex="6" style={(App.getCurrentAdvancedFeatures() || App.getCustomUTXOs()) ? {display: 'block'} : {display: 'none'}} className={App.getCustomUTXOs() ? "utxo-control-button utxo-custom-text-home utxo-custom-text dark-hover cursor_def" : "utxo-control-button utxo-custom-text-home utxo-custom-text-grey dark-hover cursor_def"} title="Update selected UTXOs by CTRL+u or CMD+u" onClick={(e) => UTXOControl()}>UTXO Control ({App.getCustomUTXOs() ? App.getSelectedUTXOs().length+"/"+App.getTotalUTXOs() : "ALL"} selected)</button>
{/*<div style={App.getCustomUTXOs() ? {display: 'block'} : {display: 'none'}} className="utxo-custom-text-home utxo-custom-text" title="Update selected UTXOs by CTRL+u or CMD+u"></div>*/}
<UTXOsSelection App={App} showUTXOs={showUTXOs} closeModal={closeModal} UTXOControl={UTXOControl} UTXOControlNext={UTXOControlNext}/>

<div id="txModal" style={showTxDetails ? {display: 'block', top: txModalTop} : {display: 'none', top: txModalTop}} className="txModal">
<span className="font_size20 gradient-font m15T">Transaction Details</span>
<div className="txModalTableDiv">
Expand Down Expand Up @@ -411,10 +415,6 @@ module.exports = (props) => {
</div>
</div>

<button tabIndex="6" style={(App.getCurrentAdvancedFeatures() || App.getCustomUTXOs()) ? {display: 'block'} : {display: 'none'}} className={App.getCustomUTXOs() ? "utxo-control-button utxo-custom-text-home utxo-custom-text dark-hover cursor_def" : "utxo-control-button utxo-custom-text-home utxo-custom-text-grey dark-hover cursor_def"} title="Update selected UTXOs by CTRL+u or CMD+u" onClick={(e) => UTXOControl()}>UTXO Control ({App.getCustomUTXOs() ? App.getSelectedUTXOs().length+"/"+App.getTotalUTXOs() : "ALL"} selected)</button>
{/*<div style={App.getCustomUTXOs() ? {display: 'block'} : {display: 'none'}} className="utxo-custom-text-home utxo-custom-text" title="Update selected UTXOs by CTRL+u or CMD+u"></div>*/}
<UTXOsSelection App={App} showUTXOs={showUTXOs} closeModal={closeModal} UTXOControl={UTXOControl} UTXOControlNext={UTXOControlNext}/>

<div className="bg-modal w400px h200px" style={showPasswordModal ? {display: 'flex'} : {display: 'none'}}>
<a onClick={(e) => closeModal()}></a>
<div className="modalContent w350px h180px">
Expand Down
36 changes: 31 additions & 5 deletions views/partial/utxos.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const React = require('react');

let showUTXOs = '';
let sort = "index";
let direction = "asc";

module.exports = (props) => {
const App = props.App;
Expand All @@ -18,6 +20,30 @@ module.exports = (props) => {
}
}

const sortIndex = () => {
if (sort === "value") {
direction = "asc" // default for Index
} else {
if (direction === "asc") {direction = "desc"}
else {direction = "asc"}
}
sort = "index";
App.renderApp();
//console.log("Sort index", direction);
}

const sortValue = () => {
if (sort === "index") {
direction = "desc" // default for Value
} else {
if (direction === "asc") {direction = "desc"}
else {direction = "asc"}
}
sort = "value";
App.renderApp();
//console.log("Sort value", direction);
}

return (
<div className="bg-modal" style={showUTXOs ? {display: 'flex'} : {display: 'none'}}>
<a onClick={(e) => closeModal()}></a>
Expand All @@ -33,14 +59,14 @@ module.exports = (props) => {
<table className="utxo-table">
<tbody>
<tr className="txtable-headrow">
<td className="w100px">Index</td>
<td className="w100px cursor_def" onClick={() => sortIndex()}>Index<span style={sort === "index" ? {display: 'inline-block'} : {display: 'none'}} className={direction === "asc" ? "sort-arrow down" : "sort-arrow up"}></span></td>
<td className="w175px">Tx ID</td>
<td className="w175px">Value</td>
<td className="w175px cursor_def" onClick={() => sortValue()}>Value<span style={sort === "value" ? {display: 'inline-block'} : {display: 'none'}} className={direction === "asc" ? "sort-arrow down" : "sort-arrow up"}></span></td>
<td className="w50px">Select</td>
</tr>
{
App.getAllUTXOs().slice(0, App.getAllUTXOs().count).map((item, index) => {
return (<tr className={App.checkUTXO(index) ? 'txtable-row voting-selected ': 'txtable-row voting-hover'} key={index} onClick={(e) => App.toggleUTXOControl({index})}>
App.getAllUTXOs().slice(0, App.getAllUTXOs().count).sort(sort === "index" ? (({utxoIx: previousutxoIx}, {utxoIx: currentutxoIx}) => direction === "asc" ? previousutxoIx - currentutxoIx : currentutxoIx - previousutxoIx) : (({Value: previousValue}, {Value: currentValue}) => direction === "asc" ? previousValue - currentValue : currentValue - previousValue)).map((item, index) => {
return (<tr className={App.checkUTXO(item.utxoIx) ? 'txtable-row voting-selected ': 'txtable-row voting-hover'} key={index} onClick={(e) => App.toggleUTXOControl(item.utxoIx)}>
<td>{item.utxoIx}</td>
<td>{item.Txid.substring(0, 15) + '...'}</td>
<td>{item.Value}</td>
Expand All @@ -55,7 +81,7 @@ module.exports = (props) => {
</div>
<div className="utxo-footer">
<button className='utxo-clear utxo-grey-button scale-hover' title='Clear Selection' onClick={() => App.clearUTXOsSelection()}>Clear Selection</button>
<button className='utxo-max-select utxo-grey-button scale-hover' title='Select Max UTXOs' onClick={() => App.selectMaxUTXOs()}>Select Max</button>
<button className='utxo-max-select utxo-grey-button scale-hover' title='Select Max UTXOs' onClick={() => App.selectMaxUTXOs(sort, direction)}>Select Max</button>
<button className="utxo-confirm submitModal scale-hover" onClick={() => UTXOControlNext()}>Save</button>
</div>
</div>
Expand Down

0 comments on commit 586f160

Please sign in to comment.