MCPcopy Create free account
hub / github.com/ccxt/ccxt / decode

Method decode

js/src/static_dependencies/ethers/coders/array.js:139–155  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

137 return pack(writer, coders, value);
138 }
139 decode(reader) {
140 let count = this.length;
141 if (count === -1) {
142 count = reader.readIndex();
143 // Check that there is *roughly* enough data to ensure
144 // stray random data is not being read as a length. Each
145 // slot requires at least 32 bytes for their value (or 32
146 // bytes as a link to the data). This could use a much
147 // tighter bound, but we are erroring on the side of safety.
148 assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength });
149 }
150 let coders = [];
151 for (let i = 0; i < count; i++) {
152 coders.push(new AnonymousCoder(this.coder));
153 }
154 return unpack(reader, coders);
155 }
156}

Callers 1

unpackFunction · 0.45

Calls 4

assertFunction · 0.90
pushMethod · 0.80
unpackFunction · 0.70
readIndexMethod · 0.45

Tested by

no test coverage detected