Skip to content

Commit

Permalink
📦 v1.1.8 fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tari404 committed May 20, 2019
1 parent f5c20d5 commit 3bcfd30
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"namespace": "truechain",
"name": "web3t",
"version": "1.1.7",
"version": "1.1.8",
"description": "Truechain JavaScript API",
"license": "LGPL-3.0",
"main": [
Expand Down
2 changes: 1 addition & 1 deletion dist/web3t.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* jshint ignore:start */
Package.describe({
name: 'truechain:web3t',
version: '1.1.7',
version: '1.1.8',
summary: 'Truechain JavaScript API wrapper repository',
git: 'https://github.com/truechain/web3true.js',
// By default, Meteor will default to using README.md for documentation.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "web3true",
"private": false,
"namespace": "truechain",
"version": "1.1.7",
"version": "1.1.8",
"description": "Truechain JavaScript API wrapper repository",
"license": "LGPL-3.0",
"main": "./packages/web3/index.js",
Expand Down
20 changes: 10 additions & 10 deletions packages/web3-eth-accounts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,19 @@ Accounts.prototype.signTransaction = async function signTransaction(tx, privateK
return signed(tx)
}

let from = ''
if (privateKey.isMetaMask) {
const greenbelt = privateKey
from = greenbelt.selectedAddress
} else {
from = _this.privateKeyToAccount(privateKey).address
}

// Otherwise, get the missing info from the Ethereum Node
return Promise.all([
isNot(tx.chainId) ? _this._ethereumCall.getId() : tx.chainId,
isNot(tx.gasPrice) ? _this._ethereumCall.getGasPrice() : tx.gasPrice,
isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(_this.privateKeyToAccount(privateKey).address) : tx.nonce
isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(from) : tx.nonce
]).then(function (args) {
if (isNot(args[0]) || isNot(args[1]) || isNot(args[2])) {
throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+ JSON.stringify(args));
Expand Down Expand Up @@ -392,19 +400,11 @@ Accounts.prototype.signPrePaymentTransaction = async function signPrePaymentTran
return signed(tx)
}

let from = ''
if (privateKey.isMetaMask) {
const greenbelt = privateKey
from = greenbelt.selectedAddress
} else {
from = _this.privateKeyToAccount(privateKey).address
}

// Otherwise, get the missing info from the Ethereum Node
return Promise.all([
isNot(tx.chainId) ? _this._ethereumCall.getId() : tx.chainId,
isNot(tx.gasPrice) ? _this._ethereumCall.getGasPrice() : tx.gasPrice,
isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(from) : tx.nonce
isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(_this.privateKeyToAccount(privateKey).address) : tx.nonce
]).then(function (args) {
if (isNot(args[0]) || isNot(args[1]) || isNot(args[2])) {
throw new Error('One of the values "chainId", "gasPrice", or "nonce" couldn\'t be fetched: '+ JSON.stringify(args));
Expand Down

0 comments on commit 3bcfd30

Please sign in to comment.