mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
fix all failing karma tests
This commit is contained in:
parent
1fd1a315bb
commit
3f631094af
11
dist/ethereum.js
vendored
11
dist/ethereum.js
vendored
@ -1110,18 +1110,17 @@ Formats the input of a transaction and converts all values to HEX
|
||||
var inputTransactionFormatter = function(options){
|
||||
|
||||
// make code -> data
|
||||
if(options.code) {
|
||||
if (options.code) {
|
||||
options.data = options.code;
|
||||
delete options.code;
|
||||
}
|
||||
|
||||
// make endowment -> value
|
||||
if(options.endowment) {
|
||||
if (options.endowment) {
|
||||
options.value = options.endowment;
|
||||
delete options.endowment;
|
||||
}
|
||||
|
||||
|
||||
// format the following options
|
||||
/*jshint maxcomplexity:5 */
|
||||
['gasPrice', 'gas', 'value'].forEach(function(key){
|
||||
@ -1130,15 +1129,15 @@ var inputTransactionFormatter = function(options){
|
||||
if(typeof options[key] === 'string') {
|
||||
|
||||
// if not hex assume its a number string
|
||||
if(options[key].indexOf('0x') === -1)
|
||||
if (options[key].indexOf('0x') === -1)
|
||||
options[key] = utils.fromDecimal(options[key]);
|
||||
|
||||
// if number
|
||||
} else if(typeof options[key] === 'number') {
|
||||
} else if (typeof options[key] === 'number') {
|
||||
options[key] = utils.fromDecimal(options[key]);
|
||||
|
||||
// if bignumber
|
||||
} else if(options[key] instanceof BigNumber) {
|
||||
} else if (utils.isBigNumber(options[key])) {
|
||||
options[key] = '0x'+ options[key].toString(16);
|
||||
}
|
||||
});
|
||||
|
4
dist/ethereum.js.map
vendored
4
dist/ethereum.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethereum.min.js
vendored
2
dist/ethereum.min.js
vendored
File diff suppressed because one or more lines are too long
@ -166,18 +166,17 @@ Formats the input of a transaction and converts all values to HEX
|
||||
var inputTransactionFormatter = function(options){
|
||||
|
||||
// make code -> data
|
||||
if(options.code) {
|
||||
if (options.code) {
|
||||
options.data = options.code;
|
||||
delete options.code;
|
||||
}
|
||||
|
||||
// make endowment -> value
|
||||
if(options.endowment) {
|
||||
if (options.endowment) {
|
||||
options.value = options.endowment;
|
||||
delete options.endowment;
|
||||
}
|
||||
|
||||
|
||||
// format the following options
|
||||
/*jshint maxcomplexity:5 */
|
||||
['gasPrice', 'gas', 'value'].forEach(function(key){
|
||||
@ -186,15 +185,15 @@ var inputTransactionFormatter = function(options){
|
||||
if(typeof options[key] === 'string') {
|
||||
|
||||
// if not hex assume its a number string
|
||||
if(options[key].indexOf('0x') === -1)
|
||||
if (options[key].indexOf('0x') === -1)
|
||||
options[key] = utils.fromDecimal(options[key]);
|
||||
|
||||
// if number
|
||||
} else if(typeof options[key] === 'number') {
|
||||
} else if (typeof options[key] === 'number') {
|
||||
options[key] = utils.fromDecimal(options[key]);
|
||||
|
||||
// if bignumber
|
||||
} else if(options[key] instanceof BigNumber) {
|
||||
} else if (utils.isBigNumber(options[key])) {
|
||||
options[key] = '0x'+ options[key].toString(16);
|
||||
}
|
||||
});
|
||||
|
@ -6,8 +6,8 @@ describe('utils', function () {
|
||||
describe('toBigNumber', function () {
|
||||
it('should return the correct value', function () {
|
||||
|
||||
assert.equal(utils.toBigNumber(100000) instanceof BigNumber, true);
|
||||
assert.equal(utils.isBigNumber(utils.toBigNumber(100000)), true);
|
||||
assert.equal(utils.toBigNumber(100000).toString(10), '100000');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user