MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / verify

Method verify

projects/JavaScript/proto/proto.js:2668–2680  ·  view source on GitHub ↗

* Check if the struct value is valid * @this {!BalanceFinalModel} * @returns {!boolean} Model valid state

()

Source from the content-addressed store, hash-verified

2666 * @returns {!boolean} Model valid state
2667 */
2668 verify () {
2669 if ((this.buffer.offset + this._model.fbeOffset) > this.buffer.size) {
2670 return false
2671 }
2672
2673 let fbeStructSize = this.readUInt32(this._model.fbeOffset - 8)
2674 let fbeStructType = this.readUInt32(this._model.fbeOffset - 4)
2675 if ((fbeStructSize <= 0) || (fbeStructType !== this.fbeType)) {
2676 return false
2677 }
2678
2679 return ((8 + this._model.verify()) === fbeStructSize)
2680 }
2681
2682 /**
2683 * Serialize the struct value

Callers

nothing calls this directly

Calls 2

readUInt32Method · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected