const e = require("compact-encoding"),
{ KeetOperation: o } = require("./ops"),
n = e.array(o),
t = {
preencode(o, t) {
;(e.uint.preencode(o, 1),
e.uint.preencode(o, t.abi),
e.uint.preencode(o, t.timestamp),
n.preencode(o, t.ops))
},
encode(o, t) {
;(e.uint.encode(o, 1),
e.uint.encode(o, t.abi),
e.uint.encode(o, t.timestamp),
n.encode(o, t.ops))
},
decode(o) {
const t = e.uint.decode(o)
if (t > 1) throw new Error("Unsupported oplog message version")
return {
version: t,
abi: 1 === t ? e.uint.decode(o) : 0,
timestamp: e.uint.decode(o),
ops: n.decode(o),
}
},
}
module.exports = { KeetOplogMessage: t }