UNPKG

@expanse/web3

Version:

Expanse and Ethereum JavaScript API, middleware to talk to an expanse or ethereum over RPC

31 lines (25 loc) 762 B
var f = require('./formatters'); var SolidityType = require('./type'); /** * SolidityTypeBool is a prootype that represents bool type * It matches: * bool * bool[] * bool[4] * bool[][] * bool[3][] * bool[][6][], ... */ var SolidityTypeBool = function () { this._inputFormatter = f.formatInputBool; this._outputFormatter = f.formatOutputBool; }; SolidityTypeBool.prototype = new SolidityType({}); SolidityTypeBool.prototype.constructor = SolidityTypeBool; SolidityTypeBool.prototype.isType = function (name) { return !!name.match(/^bool(\[([0-9]*)\])*$/); }; SolidityTypeBool.prototype.staticPartLength = function (name) { return 32 * this.staticArrayLength(name); }; module.exports = SolidityTypeBool;