web3.js/lib/solidity/dynamicbytes.js

26 lines
735 B
JavaScript

var f = require('./formatters');
var SolidityType = require('./type');
var SolidityTypeDynamicBytes = function () {
this._inputFormatter = f.formatInputDynamicBytes;
this._outputFormatter = f.formatOutputDynamicBytes;
};
SolidityTypeDynamicBytes.prototype = new SolidityType({});
SolidityTypeDynamicBytes.prototype.constructor = SolidityTypeDynamicBytes;
SolidityTypeDynamicBytes.prototype.isType = function (name) {
return !!name.match(/^bytes(\[([0-9]*)\])*$/);
};
SolidityTypeDynamicBytes.prototype.staticPartLength = function (name) {
return 32 * this.staticArrayLength(name);
};
SolidityTypeDynamicBytes.prototype.isDynamicType = function () {
return true;
};
module.exports = SolidityTypeDynamicBytes;