Skip to content

Commit

Permalink
removed unused formatOutputHash, renamed formatXXXString to formatXXX…
Browse files Browse the repository at this point in the history
…Bytes
  • Loading branch information
debris committed Apr 22, 2015
1 parent 888a970 commit f767a9a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 71 deletions.
28 changes: 8 additions & 20 deletions dist/web3-light.js

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

6 changes: 3 additions & 3 deletions dist/web3-light.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions dist/web3-light.min.js

Large diffs are not rendered by default.

28 changes: 8 additions & 20 deletions dist/web3.js

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

6 changes: 3 additions & 3 deletions dist/web3.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web3.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/solidity/coder.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ var coder = new SolidityCoder([
name: 'bytes',
match: 'prefix',
mode: 'bytes',
inputFormatter: f.formatInputString,
outputFormatter: f.formatOutputString
inputFormatter: f.formatInputBytes,
outputFormatter: f.formatOutputBytes
}),
new SolidityType({
name: 'real',
Expand Down
24 changes: 6 additions & 18 deletions lib/solidity/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ var formatInputInt = function (value) {
/**
* Formats input value to byte representation of string
*
* @method formatInputString
* @method formatInputBytes
* @param {String}
* @returns {SolidityParam}
*/
var formatInputString = function (value) {
var formatInputBytes = function (value) {
var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);
return new SolidityParam('', formatInputInt(value.length).value, result);
};
Expand Down Expand Up @@ -141,17 +141,6 @@ var formatOutputUReal = function (param) {
return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128));
};

/**
* Should be used to format output hash
*
* @method formatOutputHash
* @param {SolidityParam}
* @returns {String} right-aligned output bytes formatted to hex
*/
var formatOutputHash = function (param) {
return "0x" + param.value;
};

/**
* Should be used to format output bool
*
Expand All @@ -166,11 +155,11 @@ var formatOutputBool = function (param) {
/**
* Should be used to format output string
*
* @method formatOutputString
* @method formatOutputBytes
* @param {SolidityParam} left-aligned hex representation of string
* @returns {String} ascii string
*/
var formatOutputString = function (param) {
var formatOutputBytes = function (param) {
// length might also be important!
return utils.toAscii(param.suffix);
};
Expand All @@ -189,16 +178,15 @@ var formatOutputAddress = function (param) {

module.exports = {
formatInputInt: formatInputInt,
formatInputString: formatInputString,
formatInputBytes: formatInputBytes,
formatInputBool: formatInputBool,
formatInputReal: formatInputReal,
formatOutputInt: formatOutputInt,
formatOutputUInt: formatOutputUInt,
formatOutputReal: formatOutputReal,
formatOutputUReal: formatOutputUReal,
formatOutputHash: formatOutputHash,
formatOutputBool: formatOutputBool,
formatOutputString: formatOutputString,
formatOutputBytes: formatOutputBytes,
formatOutputAddress: formatOutputAddress
};

0 comments on commit f767a9a

Please sign in to comment.