code: function sizeScript(script) {
    if (script.isPubkeyhash(true))
      return 21;
  
    if (script.isScripthash())
      return 21;
  
    const pk = script.getPubkey(true);
    if (pk) {
      if (publicKeyVerify(pk))
        return 33;
    }
  
    let size = 0;
    size += encoding.sizeVarint(script.raw.length + COMPRESS_TYPES);
    size += script.raw.length;
  
    return size;
  }
docs: Calculate script size.
  @returns {Number}