Skip to content

Commit

Permalink
Merge pull request #783 from hubiinetwork/feature/1.2.4
Browse files Browse the repository at this point in the history
1.2.4
  • Loading branch information
katat committed Sep 17, 2019
2 parents d59a6e0 + 686cc5d commit 56c8b74
Show file tree
Hide file tree
Showing 18 changed files with 310 additions and 31,133 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "hubii-core",
"version": "1.2.3",
"version": "1.2.4",
"author": {
"name": "hubii",
"email": "info@hubii.com",
Expand Down
7,244 changes: 22 additions & 7,222 deletions src/components/TransferForm/tests/__snapshots__/index.test.js.snap

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2,200 changes: 0 additions & 2,200 deletions src/containers/NahmiiDeposit/tests/__snapshots__/index.test.js.snap

Large diffs are not rendered by default.

15 changes: 1 addition & 14 deletions src/containers/NahmiiHoc/combined-selectors.js
Expand Up @@ -150,23 +150,10 @@ const makeSelectWalletsWithInfo = () => createSelector(
makeSelectNahmiiBalances(),
makeSelectPrices(),
makeSelectSupportedAssets(),
makeSelectCombinedTransactions(),
(wallets, baseLayerBalances, nahmiiBalances, prices, supportedAssets, transactions) => {
(wallets, baseLayerBalances, nahmiiBalances, prices, supportedAssets) => {
const walletsWithInfo = wallets.map((wallet) => {
let walletWithInfo = wallet;
const walletAddress = wallet.get('address');
let walletBalances;
let walletTransactions;

// Add wallet transactions
if (!transactions.get(walletAddress) || transactions.getIn([walletAddress, 'loading'])) {
walletTransactions = fromJS({ loading: true, error: null, transactions: [] });
} else if (transactions.getIn([walletAddress, 'error'])) {
walletTransactions = fromJS({ loading: false, error: true, transactions: transactions.getIn([walletAddress, 'transactions']) || [] });
} else {
walletTransactions = fromJS({ loading: false, error: null, transactions: transactions.getIn([walletAddress, 'transactions']) });
}
walletWithInfo = walletWithInfo.set('transactions', walletTransactions);

balanceTypes(baseLayerBalances, nahmiiBalances).forEach(({ label, key, balances }) => {
// Have all information needed to construct walletWithInfo balance
Expand Down
4 changes: 2 additions & 2 deletions src/containers/NahmiiHoc/selectors.js
Expand Up @@ -26,8 +26,8 @@ export const createReceiptsSelector = createSelectorCreator(
const previousReceipts = previousArray.getIn([address, 'receipts']) || fromJS([]);
const currentReceipts = currentArray.getIn([address, 'receipts']) || fromJS([]);

const previousLastCreated = previousReceipts.getIn([previousReceipts.size - 1, 'created']);
const currentLastCreated = currentReceipts.getIn([currentReceipts.size - 1, 'created']);
const previousLastCreated = previousReceipts.getIn([0, 'created']);
const currentLastCreated = currentReceipts.getIn([0, 'created']);

if (previousLastCreated !== currentLastCreated) {
changed = true;
Expand Down
6 changes: 3 additions & 3 deletions src/containers/NahmiiHoc/tests/selectors.test.js
Expand Up @@ -93,14 +93,14 @@ describe('makeSelectReceipts', () => {
describe('should update the cache', () => {
it('when the size of receipts array is different from previous state', () => {
expect(receiptsSelector(
store.updateIn(['nahmiiHoc', 'receipts', address, 'receipts'], (arr) => arr.push(fromJS({ created: '2019' })))
)).toEqual(txs.updateIn([address, 'receipts'], (arr) => arr.push(fromJS({ created: '2019' }))));
store.updateIn(['nahmiiHoc', 'receipts', address, 'receipts'], (arr) => arr.unshift(fromJS({ created: '2019' })))
)).toEqual(txs.updateIn([address, 'receipts'], (arr) => arr.unshift(fromJS({ created: '2019' }))));
});
});
describe('should not update the cache', () => {
it('when the last created property is the same', () => {
expect(receiptsSelector(
store.updateIn(['nahmiiHoc', 'receipts', address, 'receipts'], (arr) => arr.push(fromJS({ created: '2018' })))
store.updateIn(['nahmiiHoc', 'receipts', address, 'receipts'], (arr) => arr.unshift(fromJS({ created: '2018' })))
)).toEqual(txs);
});
it('even when the loading state is changed', () => {
Expand Down
200 changes: 0 additions & 200 deletions src/containers/NahmiiWithdraw/tests/__snapshots__/index.test.js.snap
Expand Up @@ -121,206 +121,6 @@ ShallowWrapper {
type: "lns",
name: "lns",
derivationPath: "m/44'/60'/0'/0",
transactions: Immutable.Map {
loading: false,
error: null,
transactions: Immutable.List [
Immutable.Map {
transfers: Immutable.Map {
single: "2111000000",
total: "3111000000",
},
created: "2018-12-17T01:59:03.718Z",
decimalAmount: "0.000000002111",
counterpartyAddress: "0x4231676a35483638796e2af8ed2af0a41b097524",
nonce: 21,
currency: "0x0000000000000000000000000000000000000000",
layer: "nahmii",
sender: Immutable.Map {
fees: Immutable.Map {
total: Immutable.List [
Immutable.Map {
originId: "0",
figure: Immutable.Map {
currency: Immutable.Map {
ct: "0x0000000000000000000000000000000000000000",
id: "0",
},
amount: "4121100",
},
},
],
single: Immutable.Map {
currency: Immutable.Map {
ct: "0x0000000000000000000000000000000000000000",
id: "0",
},
amount: "2111000",
},
},
wallet: "0x4231676a35483638796e2af8ed2af0a41b097524",
nonce: 7,
balances: Immutable.Map {
current: "999995875778900",
previous: "999997988889900",
},
},
timestamp: "2018-12-17T01:59:03.776Z",
seals: Immutable.Map {
wallet: Immutable.Map {
hash: "0x57d9cf4ffc4b2aecce23d2e56083c7b437f5e105be74c1cd17d8522999b5d0be",
signature: Immutable.Map {
s: "0x395b632dab03b34321c1aed7dcbac4a1b87582904d2898645b3ec90505c44348",
r: "0x01cda7bddbc7c2194dd395aac73eaf1ca6760bfef83689c5a1240f936f0200d4",
v: 28,
},
},
operator: Immutable.Map {
hash: "0x99c1a3a1cd8b15cdb969270f6e8f7fdce5b9c8377a00c38d800b9982c98eec5a",
signature: Immutable.Map {
s: "0x129c9e071467ee98ddd799fa1ed7b3cbda11486955b9360afd22ce0ff4d91aab",
r: "0x4d22165ff7382f998107a87e800a11581e7b99fa67ab613656706105157e5ab9",
v: 28,
},
},
},
blockNumber: 4643058,
amount: "2111000000",
symbol: "ETH",
recipient: Immutable.Map {
fees: Immutable.Map {
total: Immutable.List [
],
},
wallet: "0x1c7429f62595097315289cebac1fdbda587ad512",
nonce: 4,
balances: Immutable.Map {
current: "10013111000000",
previous: "10011000000000",
},
},
type: "received",
updated: "2018-12-17T01:59:03.776Z",
id: "5c1702e78d9ea3000ea459d9",
operatorId: "0",
confirmed: true,
},
Immutable.Map {
decimalAmount: "0.0000000001",
counterpartyAddress: "0x910c4ba923b2243dc13e00a066eefb8ffd905eb0",
block: Immutable.Map {
number: 3780091,
timestamp: "2018-08-06T02:32:00.000Z",
},
hash: "0x84db5d53f1b5e82bdae027408989cf5451191d76b8b021710cfa0d95bbd5d34c",
currency: "0x0000000000000000000000000000000000000000",
layer: "baseLayer",
sender: "0x910c4ba923b2243dc13e00a066eefb8ffd905eb0",
timestamp: "2018-08-06T02:32:00.000Z",
amount: "100000000",
symbol: "ETH",
recipient: "0x1c7429f62595097315289ceBaC1fDbdA587Ad512",
type: "received",
},
Immutable.Map {
transfers: Immutable.Map {
single: "10000000000000000",
total: "10000000000000000",
},
created: "2018-11-16T22:40:54.951Z",
decimalAmount: "0.01",
counterpartyAddress: "0xc5768cdeda275fe5536147a3fbc8cfb6b0d8ac48",
nonce: 18,
currency: "0x583cbbb8a8443b38abcc0c956bece47340ea1367",
layer: "nahmii",
sender: Immutable.Map {
fees: Immutable.Map {
total: Immutable.List [
Immutable.Map {
originId: "0",
figure: Immutable.Map {
currency: Immutable.Map {
ct: "0x583cbbb8a8443b38abcc0c956bece47340ea1367",
id: "0",
},
amount: "10000000000000",
},
},
],
single: Immutable.Map {
currency: Immutable.Map {
ct: "0x583cbbb8a8443b38abcc0c956bece47340ea1367",
id: "0",
},
amount: "10000000000000",
},
},
wallet: "0x1c7429f62595097315289cebac1fdbda587ad512",
nonce: 3,
balances: Immutable.Map {
current: "89990000000000000",
previous: "100000000000000000",
},
},
timestamp: "2018-11-16T22:40:55.049Z",
seals: Immutable.Map {
wallet: Immutable.Map {
hash: "0x0b7d6d30e9665016246e6370e82579a35bc4d9c0cf88c65b38d538f7ad8ee828",
signature: Immutable.Map {
s: "0x7d60c93b9037be6d880bbe86f258d0e371ad4015fc2528cf1312d924f9e76245",
r: "0x9c11c2a5244a741f67837eb6efc1f12396c19d2490ff2bd872dbd9643a7c1013",
v: 27,
},
},
operator: Immutable.Map {
hash: "0x92b0e8b3c705449eea1bce2e517468cec521e6451d4a7e6c4fe4c4efe7df6ab4",
signature: Immutable.Map {
s: "0x09ad154d886899b36f15a2be68ddb61c15afe185acd498a9b6bb2577f317a942",
r: "0x80d8f5e899f16c9a4abcc72d23399d4ddd3c08a29dae8233a46179ef54cc189c",
v: 27,
},
},
},
blockNumber: 3780090,
amount: "10000000000000000",
symbol: "BOKKY",
recipient: Immutable.Map {
fees: Immutable.Map {
total: Immutable.List [
],
},
wallet: "0xc5768cdeda275fe5536147a3fbc8cfb6b0d8ac48",
nonce: 2,
balances: Immutable.Map {
current: "10000000000000000",
previous: "0",
},
},
type: "sent",
updated: "2018-11-16T22:40:55.049Z",
id: "5c16d4768d9ea3000ea45690",
operatorId: "0",
confirmed: true,
},
Immutable.Map {
decimalAmount: "0.000000000000000005",
counterpartyAddress: "0x910c4ba923b2243dc13e00a066eefb8ffd905eb0",
block: Immutable.Map {
number: 3780089,
timestamp: "2018-08-06T02:32:00.000Z",
},
hash: "0x84db5d53f1b5e82bdae027408989cf5451191d76b8b021710cfa0d95bbd5d34c",
currency: "0x583cbbb8a8443b38abcc0c956bece47340ea1367",
layer: "baseLayer",
sender: "0x1c7429f62595097315289ceBaC1fDbdA587Ad512",
timestamp: "2018-08-06T02:32:00.000Z",
amount: "5",
symbol: "BOKKY",
recipient: "0x910c4ba923b2243dc13e00a066eefb8ffd905eb0",
type: "sent",
},
],
},
balances: Immutable.Map {
baseLayer: Immutable.Map {
loading: false,
Expand Down
5 changes: 1 addition & 4 deletions src/containers/WalletDetails/index.js
Expand Up @@ -37,10 +37,7 @@ export class WalletDetails extends React.PureComponent {
super(props);
this.onHomeClick = this.onHomeClick.bind(this);
this.onTabsChange = this.onTabsChange.bind(this);
}

componentDidMount() {
this.props.setCurrentWallet(this.props.match.params.address);
this.props.setCurrentWallet(props.match.params.address);
}

onHomeClick() {
Expand Down

0 comments on commit 56c8b74

Please sign in to comment.