Update Wallet to new Wallet Code (#4805)
* Update Wallet Version * Update Wallet Library * Update Wallets Bytecodes * Typo * Separate Deploy in Contract API * Use the new Wallet ABI // Update wallet code * WIP .// Deploy from Wallet * Update Wallet contract * Contract Deployment for Wallet * Working deployments for Single Owned Wallet contracts * Linting * Create a Wallet from a Wallet * Linting * Fix Signer transactions // Add Gas Used for transactions * Deploy wallet contract fix * Fix too high gas estimate for Wallet Contract Deploys * Final piece ; deploying from Wallet owned by wallet * Update Wallet Code * Updated the Wallet Codes * Fixing Wallet Deployments * Add Support for older wallets * Linting
This commit is contained in:
committed by
Jaco Greeff
parent
973bb63dca
commit
4d08e7b0ae
@@ -120,6 +120,18 @@ class MethodDecoding extends Component {
|
||||
<span className={ styles.highlight }>
|
||||
{ gas.toFormat(0) } gas ({ gasPrice.div(1000000).toFormat(0) }M/<small>ETH</small>)
|
||||
</span>
|
||||
{
|
||||
transaction.gasUsed
|
||||
? (
|
||||
<span>
|
||||
<span>used</span>
|
||||
<span className={ styles.highlight }>
|
||||
{ transaction.gasUsed.toFormat(0) } gas
|
||||
</span>
|
||||
</span>
|
||||
)
|
||||
: null
|
||||
}
|
||||
<span> for a total transaction value of </span>
|
||||
<span className={ styles.highlight }>{ this.renderEtherValue(gasValue) }</span>
|
||||
{ this.renderMinBlock() }
|
||||
|
||||
@@ -51,6 +51,7 @@ export default class Store {
|
||||
|
||||
return bnB.comparedTo(bnA);
|
||||
});
|
||||
|
||||
this._pendingHashes = this.sortedHashes.filter((hash) => this.transactions[hash].blockNumber.eq(0));
|
||||
});
|
||||
}
|
||||
@@ -85,26 +86,53 @@ export default class Store {
|
||||
this._subscriptionId = 0;
|
||||
}
|
||||
|
||||
loadTransactions (_txhashes) {
|
||||
const txhashes = _txhashes.filter((hash) => !this.transactions[hash] || this._pendingHashes.includes(hash));
|
||||
loadTransactions (_txhashes = []) {
|
||||
const promises = _txhashes
|
||||
.filter((txhash) => !this.transactions[txhash] || this._pendingHashes.includes(txhash))
|
||||
.map((txhash) => {
|
||||
return Promise
|
||||
.all([
|
||||
this._api.eth.getTransactionByHash(txhash),
|
||||
this._api.eth.getTransactionReceipt(txhash)
|
||||
])
|
||||
.then(([
|
||||
transaction = {},
|
||||
transactionReceipt = {}
|
||||
]) => {
|
||||
return {
|
||||
...transactionReceipt,
|
||||
...transaction
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
if (!txhashes || !txhashes.length) {
|
||||
if (!promises.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
Promise
|
||||
.all(txhashes.map((txhash) => this._api.eth.getTransactionByHash(txhash)))
|
||||
.all(promises)
|
||||
.then((_transactions) => {
|
||||
const transactions = _transactions.filter((tx) => tx);
|
||||
const blockNumbers = [];
|
||||
const transactions = _transactions
|
||||
.filter((tx) => tx && tx.hash)
|
||||
.reduce((txs, tx) => {
|
||||
txs[tx.hash] = tx;
|
||||
|
||||
this.addTransactions(
|
||||
transactions.reduce((transactions, tx, index) => {
|
||||
transactions[txhashes[index]] = tx;
|
||||
return transactions;
|
||||
}, {})
|
||||
);
|
||||
if (tx.blockNumber && tx.blockNumber.gt(0)) {
|
||||
blockNumbers.push(tx.blockNumber.toNumber());
|
||||
}
|
||||
|
||||
this.loadBlocks(transactions.map((tx) => tx.blockNumber ? tx.blockNumber.toNumber() : 0));
|
||||
return txs;
|
||||
}, {});
|
||||
|
||||
// No need to add transactions if there are none
|
||||
if (Object.keys(transactions).length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.addTransactions(transactions);
|
||||
this.loadBlocks(blockNumbers);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn('loadTransactions', error);
|
||||
|
||||
@@ -27,7 +27,7 @@ import styles from './txList.css';
|
||||
class TxList extends Component {
|
||||
static contextTypes = {
|
||||
api: PropTypes.object.isRequired
|
||||
}
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
address: PropTypes.string.isRequired,
|
||||
@@ -36,7 +36,7 @@ class TxList extends Component {
|
||||
PropTypes.object
|
||||
]).isRequired,
|
||||
netVersion: PropTypes.string.isRequired
|
||||
}
|
||||
};
|
||||
|
||||
store = new Store(this.context.api);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user