code: function decompressScript(script, br) {
    // Decompress the script.
    switch (br.readU8()) {
      case 0: {
        const hash = br.readBytes(20, true);
        script.fromPubkeyhash(hash);
        break;
      }
      case 1: {
        const hash = br.readBytes(20, true);
        script.fromScripthash(hash);
        break;
      }
      case 2:
      case 3:
      case 4:
      case 5: {
        br.offset -= 1;
        const data = br.readBytes(33, true);
        // Decompress the key. If this fails,
        // we have database corruption!
        const key = decompressKey(data);
        script.fromPubkey(key);
        break;
      }
      default: {
        br.offset -= 1;
        const size = br.readVarint() - COMPRESS_TYPES;
        if (size > consensus.MAX_SCRIPT_SIZE) {
          // This violates consensus rules.
          // We don't need to read it.
          script.fromNulldata(EMPTY_BUFFER);
          br.seek(size);
        } else {
          const data = br.readBytes(size);
          script.fromRaw(data);
        }
        break;
      }
    }
  
    return script;
  }
docs: Decompress a script from buffer reader.
  @param {Script} script
  @param {BufferReader} br