@neo-one/node-protocol-esnext-esm
Version:
NEO•ONE NEO node and consensus protocol.
29 lines (27 loc) • 1.05 kB
JavaScript
import { common, createSerializeWire, } from '@neo-one/client-common-esnext-esm';
import { BinaryReader } from '@neo-one/node-core-esnext-esm';
export class GetBlocksPayload {
constructor({ hashStart, hashStop = common.ZERO_UINT256 }) {
this.serializeWire = createSerializeWire(this.serializeWireBase.bind(this));
this.hashStart = hashStart;
this.hashStop = hashStop;
}
static deserializeWireBase({ reader }) {
const hashStart = reader.readArray(() => reader.readUInt256());
const hashStop = reader.readUInt256();
return new this({ hashStart, hashStop });
}
static deserializeWire(options) {
return this.deserializeWireBase({
context: options.context,
reader: new BinaryReader(options.buffer),
});
}
serializeWireBase(writer) {
writer.writeArray(this.hashStart, (value) => {
writer.writeUInt256(value);
});
writer.writeUInt256(this.hashStop);
}
}
//# sourceMappingURL=GetBlocksPayload.js.map