@mainsail/crypto-messages 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +623 -0
- package/distribution/deserializer.d.ts +11 -0
- package/distribution/deserializer.d.ts.map +1 -0
- package/distribution/deserializer.js +128 -0
- package/distribution/deserializer.js.map +1 -0
- package/distribution/factory.d.ts +20 -0
- package/distribution/factory.d.ts.map +1 -0
- package/distribution/factory.js +143 -0
- package/distribution/factory.js.map +1 -0
- package/distribution/index.d.ts +6 -0
- package/distribution/index.d.ts.map +1 -0
- package/distribution/index.js +38 -0
- package/distribution/index.js.map +1 -0
- package/distribution/keywords.d.ts +7 -0
- package/distribution/keywords.d.ts.map +1 -0
- package/distribution/keywords.js +84 -0
- package/distribution/keywords.js.map +1 -0
- package/distribution/precommit.d.ts +19 -0
- package/distribution/precommit.d.ts.map +1 -0
- package/distribution/precommit.js +83 -0
- package/distribution/precommit.js.map +1 -0
- package/distribution/prevote.d.ts +19 -0
- package/distribution/prevote.d.ts.map +1 -0
- package/distribution/prevote.js +83 -0
- package/distribution/prevote.js.map +1 -0
- package/distribution/proposal.d.ts +20 -0
- package/distribution/proposal.d.ts.map +1 -0
- package/distribution/proposal.js +82 -0
- package/distribution/proposal.js.map +1 -0
- package/distribution/schemas.d.ts +3 -0
- package/distribution/schemas.d.ts.map +1 -0
- package/distribution/schemas.js +70 -0
- package/distribution/schemas.js.map +1 -0
- package/distribution/serializer.d.ts +16 -0
- package/distribution/serializer.d.ts.map +1 -0
- package/distribution/serializer.js +215 -0
- package/distribution/serializer.js.map +1 -0
- package/package.json +42 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7
|
+
};
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12
|
+
};
|
13
|
+
var _Prevote_height, _Prevote_round, _Prevote_blockId, _Prevote_validatorIndex, _Prevote_signature, _Prevote_serialized;
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.Prevote = void 0;
|
16
|
+
const contracts_1 = require("@mainsail/contracts");
|
17
|
+
class Prevote {
|
18
|
+
constructor({ height, round, blockId, validatorIndex, signature, serialized, }) {
|
19
|
+
_Prevote_height.set(this, void 0);
|
20
|
+
_Prevote_round.set(this, void 0);
|
21
|
+
_Prevote_blockId.set(this, void 0);
|
22
|
+
_Prevote_validatorIndex.set(this, void 0);
|
23
|
+
_Prevote_signature.set(this, void 0);
|
24
|
+
_Prevote_serialized.set(this, void 0);
|
25
|
+
__classPrivateFieldSet(this, _Prevote_height, height, "f");
|
26
|
+
__classPrivateFieldSet(this, _Prevote_round, round, "f");
|
27
|
+
__classPrivateFieldSet(this, _Prevote_blockId, blockId, "f");
|
28
|
+
__classPrivateFieldSet(this, _Prevote_validatorIndex, validatorIndex, "f");
|
29
|
+
__classPrivateFieldSet(this, _Prevote_signature, signature, "f");
|
30
|
+
__classPrivateFieldSet(this, _Prevote_serialized, serialized, "f");
|
31
|
+
}
|
32
|
+
get type() {
|
33
|
+
return contracts_1.Contracts.Crypto.MessageType.Prevote;
|
34
|
+
}
|
35
|
+
get height() {
|
36
|
+
return __classPrivateFieldGet(this, _Prevote_height, "f");
|
37
|
+
}
|
38
|
+
get round() {
|
39
|
+
return __classPrivateFieldGet(this, _Prevote_round, "f");
|
40
|
+
}
|
41
|
+
get blockId() {
|
42
|
+
return __classPrivateFieldGet(this, _Prevote_blockId, "f");
|
43
|
+
}
|
44
|
+
get validatorIndex() {
|
45
|
+
return __classPrivateFieldGet(this, _Prevote_validatorIndex, "f");
|
46
|
+
}
|
47
|
+
get signature() {
|
48
|
+
return __classPrivateFieldGet(this, _Prevote_signature, "f");
|
49
|
+
}
|
50
|
+
get serialized() {
|
51
|
+
return __classPrivateFieldGet(this, _Prevote_serialized, "f");
|
52
|
+
}
|
53
|
+
toString() {
|
54
|
+
return JSON.stringify({
|
55
|
+
blockId: __classPrivateFieldGet(this, _Prevote_blockId, "f"),
|
56
|
+
height: __classPrivateFieldGet(this, _Prevote_height, "f"),
|
57
|
+
round: __classPrivateFieldGet(this, _Prevote_round, "f"),
|
58
|
+
signature: __classPrivateFieldGet(this, _Prevote_signature, "f"),
|
59
|
+
validatorIndex: __classPrivateFieldGet(this, _Prevote_validatorIndex, "f"),
|
60
|
+
});
|
61
|
+
}
|
62
|
+
toSignatureData() {
|
63
|
+
return {
|
64
|
+
blockId: __classPrivateFieldGet(this, _Prevote_blockId, "f"),
|
65
|
+
height: __classPrivateFieldGet(this, _Prevote_height, "f"),
|
66
|
+
round: __classPrivateFieldGet(this, _Prevote_round, "f"),
|
67
|
+
type: this.type,
|
68
|
+
};
|
69
|
+
}
|
70
|
+
toData() {
|
71
|
+
return {
|
72
|
+
blockId: __classPrivateFieldGet(this, _Prevote_blockId, "f"),
|
73
|
+
height: __classPrivateFieldGet(this, _Prevote_height, "f"),
|
74
|
+
round: __classPrivateFieldGet(this, _Prevote_round, "f"),
|
75
|
+
signature: __classPrivateFieldGet(this, _Prevote_signature, "f"),
|
76
|
+
type: this.type,
|
77
|
+
validatorIndex: __classPrivateFieldGet(this, _Prevote_validatorIndex, "f"),
|
78
|
+
};
|
79
|
+
}
|
80
|
+
}
|
81
|
+
exports.Prevote = Prevote;
|
82
|
+
_Prevote_height = new WeakMap(), _Prevote_round = new WeakMap(), _Prevote_blockId = new WeakMap(), _Prevote_validatorIndex = new WeakMap(), _Prevote_signature = new WeakMap(), _Prevote_serialized = new WeakMap();
|
83
|
+
//# sourceMappingURL=prevote.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"prevote.js","sourceRoot":"","sources":["../source/prevote.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAEhD,MAAa,OAAO;IAQnB,YAAY,EACX,MAAM,EACN,KAAK,EACL,OAAO,EACP,cAAc,EACd,SAAS,EACT,UAAU,GAC6C;QAdxD,kCAAgB;QAChB,iCAAe;QACf,mCAA6B;QAC7B,0CAAwB;QACxB,qCAAmB;QACnB,sCAAoB;QAUnB,uBAAA,IAAI,mBAAW,MAAM,MAAA,CAAC;QACtB,uBAAA,IAAI,kBAAU,KAAK,MAAA,CAAC;QACpB,uBAAA,IAAI,oBAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,2BAAmB,cAAc,MAAA,CAAC;QACtC,uBAAA,IAAI,sBAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,uBAAe,UAAU,MAAA,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI;QACP,OAAO,qBAAS,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;IAC7C,CAAC;IAED,IAAI,MAAM;QACT,OAAO,uBAAA,IAAI,uBAAQ,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACR,OAAO,uBAAA,IAAI,sBAAO,CAAC;IACpB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,uBAAA,IAAI,wBAAS,CAAC;IACtB,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,uBAAA,IAAI,+BAAgB,CAAC;IAC7B,CAAC;IAED,IAAI,SAAS;QACZ,OAAO,uBAAA,IAAI,0BAAW,CAAC;IACxB,CAAC;IAED,IAAI,UAAU;QACb,OAAO,uBAAA,IAAI,2BAAY,CAAC;IACzB,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,SAAS,CAAC;YACrB,OAAO,EAAE,uBAAA,IAAI,wBAAS;YACtB,MAAM,EAAE,uBAAA,IAAI,uBAAQ;YACpB,KAAK,EAAE,uBAAA,IAAI,sBAAO;YAClB,SAAS,EAAE,uBAAA,IAAI,0BAAW;YAC1B,cAAc,EAAE,uBAAA,IAAI,+BAAgB;SACpC,CAAC,CAAC;IACJ,CAAC;IAED,eAAe;QACd,OAAO;YACN,OAAO,EAAE,uBAAA,IAAI,wBAAS;YACtB,MAAM,EAAE,uBAAA,IAAI,uBAAQ;YACpB,KAAK,EAAE,uBAAA,IAAI,sBAAO;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC;IACH,CAAC;IAED,MAAM;QACL,OAAO;YACN,OAAO,EAAE,uBAAA,IAAI,wBAAS;YACtB,MAAM,EAAE,uBAAA,IAAI,uBAAQ;YACpB,KAAK,EAAE,uBAAA,IAAI,sBAAO;YAClB,SAAS,EAAE,uBAAA,IAAI,0BAAW;YAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,uBAAA,IAAI,+BAAgB;SACpC,CAAC;IACH,CAAC;CACD;AAjFD,0BAiFC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { Contracts } from "@mainsail/contracts";
|
3
|
+
export declare class Proposal implements Contracts.Crypto.Proposal {
|
4
|
+
#private;
|
5
|
+
constructor({ round, validatorIndex, block, validRound, signature, serialized, }: Contracts.Crypto.ProposalData & {
|
6
|
+
block: Contracts.Crypto.ProposedBlock;
|
7
|
+
serialized: Buffer;
|
8
|
+
});
|
9
|
+
get height(): number;
|
10
|
+
get round(): number;
|
11
|
+
get validRound(): number | undefined;
|
12
|
+
get block(): Contracts.Crypto.ProposedBlock;
|
13
|
+
get validatorIndex(): number;
|
14
|
+
get signature(): string;
|
15
|
+
get serialized(): Buffer;
|
16
|
+
toString(): string;
|
17
|
+
toSerializableData(): Contracts.Crypto.SerializableProposalData;
|
18
|
+
toData(): Contracts.Crypto.ProposalData;
|
19
|
+
}
|
20
|
+
//# sourceMappingURL=proposal.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"proposal.d.ts","sourceRoot":"","sources":["../source/proposal.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,qBAAa,QAAS,YAAW,SAAS,CAAC,MAAM,CAAC,QAAQ;;gBAQ7C,EACX,KAAK,EACL,cAAc,EACd,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,GACV,EAAE,SAAS,CAAC,MAAM,CAAC,YAAY,GAAG;QAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IAShG,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED,IAAI,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,aAAa,CAE1C;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,QAAQ,IAAI,MAAM;IASlB,kBAAkB,IAAI,SAAS,CAAC,MAAM,CAAC,wBAAwB;IAU/D,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,YAAY;CAUvC"}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7
|
+
};
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12
|
+
};
|
13
|
+
var _Proposal_round, _Proposal_validRound, _Proposal_block, _Proposal_validatorIndex, _Proposal_signature, _Proposal_serialized;
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.Proposal = void 0;
|
16
|
+
class Proposal {
|
17
|
+
constructor({ round, validatorIndex, block, validRound, signature, serialized, }) {
|
18
|
+
_Proposal_round.set(this, void 0);
|
19
|
+
_Proposal_validRound.set(this, void 0);
|
20
|
+
_Proposal_block.set(this, void 0);
|
21
|
+
_Proposal_validatorIndex.set(this, void 0);
|
22
|
+
_Proposal_signature.set(this, void 0);
|
23
|
+
_Proposal_serialized.set(this, void 0);
|
24
|
+
__classPrivateFieldSet(this, _Proposal_round, round, "f");
|
25
|
+
__classPrivateFieldSet(this, _Proposal_validRound, validRound, "f");
|
26
|
+
__classPrivateFieldSet(this, _Proposal_block, block, "f");
|
27
|
+
__classPrivateFieldSet(this, _Proposal_validatorIndex, validatorIndex, "f");
|
28
|
+
__classPrivateFieldSet(this, _Proposal_signature, signature, "f");
|
29
|
+
__classPrivateFieldSet(this, _Proposal_serialized, serialized, "f");
|
30
|
+
}
|
31
|
+
get height() {
|
32
|
+
return __classPrivateFieldGet(this, _Proposal_block, "f").block.header.height;
|
33
|
+
}
|
34
|
+
get round() {
|
35
|
+
return __classPrivateFieldGet(this, _Proposal_round, "f");
|
36
|
+
}
|
37
|
+
get validRound() {
|
38
|
+
return __classPrivateFieldGet(this, _Proposal_validRound, "f");
|
39
|
+
}
|
40
|
+
get block() {
|
41
|
+
return __classPrivateFieldGet(this, _Proposal_block, "f");
|
42
|
+
}
|
43
|
+
get validatorIndex() {
|
44
|
+
return __classPrivateFieldGet(this, _Proposal_validatorIndex, "f");
|
45
|
+
}
|
46
|
+
get signature() {
|
47
|
+
return __classPrivateFieldGet(this, _Proposal_signature, "f");
|
48
|
+
}
|
49
|
+
get serialized() {
|
50
|
+
return __classPrivateFieldGet(this, _Proposal_serialized, "f");
|
51
|
+
}
|
52
|
+
toString() {
|
53
|
+
return JSON.stringify({
|
54
|
+
block: __classPrivateFieldGet(this, _Proposal_block, "f").block.header.id,
|
55
|
+
height: __classPrivateFieldGet(this, _Proposal_block, "f").block.header.height,
|
56
|
+
round: __classPrivateFieldGet(this, _Proposal_round, "f"),
|
57
|
+
validatorIndex: __classPrivateFieldGet(this, _Proposal_validatorIndex, "f"),
|
58
|
+
});
|
59
|
+
}
|
60
|
+
toSerializableData() {
|
61
|
+
return {
|
62
|
+
block: __classPrivateFieldGet(this, _Proposal_block, "f"),
|
63
|
+
round: __classPrivateFieldGet(this, _Proposal_round, "f"),
|
64
|
+
signature: __classPrivateFieldGet(this, _Proposal_signature, "f"),
|
65
|
+
validRound: __classPrivateFieldGet(this, _Proposal_validRound, "f"),
|
66
|
+
validatorIndex: __classPrivateFieldGet(this, _Proposal_validatorIndex, "f"),
|
67
|
+
};
|
68
|
+
}
|
69
|
+
toData() {
|
70
|
+
return {
|
71
|
+
block: { serialized: __classPrivateFieldGet(this, _Proposal_block, "f").serialized },
|
72
|
+
height: __classPrivateFieldGet(this, _Proposal_block, "f").block.header.height,
|
73
|
+
round: __classPrivateFieldGet(this, _Proposal_round, "f"),
|
74
|
+
signature: __classPrivateFieldGet(this, _Proposal_signature, "f"),
|
75
|
+
validRound: __classPrivateFieldGet(this, _Proposal_validRound, "f"),
|
76
|
+
validatorIndex: __classPrivateFieldGet(this, _Proposal_validatorIndex, "f"),
|
77
|
+
};
|
78
|
+
}
|
79
|
+
}
|
80
|
+
exports.Proposal = Proposal;
|
81
|
+
_Proposal_round = new WeakMap(), _Proposal_validRound = new WeakMap(), _Proposal_block = new WeakMap(), _Proposal_validatorIndex = new WeakMap(), _Proposal_signature = new WeakMap(), _Proposal_serialized = new WeakMap();
|
82
|
+
//# sourceMappingURL=proposal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"proposal.js","sourceRoot":"","sources":["../source/proposal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,MAAa,QAAQ;IAQpB,YAAY,EACX,KAAK,EACL,cAAc,EACd,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,GACqF;QAdhG,kCAAe;QACf,uCAAqB;QACrB,kCAAuC;QACvC,2CAAwB;QACxB,sCAAmB;QACnB,uCAAoB;QAUnB,uBAAA,IAAI,mBAAU,KAAK,MAAA,CAAC;QACpB,uBAAA,IAAI,wBAAe,UAAU,MAAA,CAAC;QAC9B,uBAAA,IAAI,mBAAU,KAAK,MAAA,CAAC;QACpB,uBAAA,IAAI,4BAAmB,cAAc,MAAA,CAAC;QACtC,uBAAA,IAAI,uBAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,wBAAe,UAAU,MAAA,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM;QACT,OAAO,uBAAA,IAAI,uBAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,CAAC;IAED,IAAI,KAAK;QACR,OAAO,uBAAA,IAAI,uBAAO,CAAC;IACpB,CAAC;IAED,IAAI,UAAU;QACb,OAAO,uBAAA,IAAI,4BAAY,CAAC;IACzB,CAAC;IAED,IAAI,KAAK;QACR,OAAO,uBAAA,IAAI,uBAAO,CAAC;IACpB,CAAC;IAED,IAAI,cAAc;Q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MAAM,KAAK,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,MAAM,CAC3B,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,EAC9E,eAAe,CAiEf,CAAC"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.schemas = void 0;
|
4
|
+
const contracts_1 = require("@mainsail/contracts");
|
5
|
+
exports.schemas = {
|
6
|
+
precommit: {
|
7
|
+
$id: "precommit",
|
8
|
+
properties: {
|
9
|
+
blockId: { $ref: "blockId" },
|
10
|
+
height: { minimum: 1, type: "integer" },
|
11
|
+
round: { minimum: 0, type: "integer" },
|
12
|
+
signature: { $ref: "consensusSignature" },
|
13
|
+
type: { enum: [contracts_1.Contracts.Crypto.MessageType.Precommit] },
|
14
|
+
validatorIndex: { isValidatorIndex: {} },
|
15
|
+
},
|
16
|
+
required: ["type", "height", "round", "validatorIndex", "signature"],
|
17
|
+
type: "object",
|
18
|
+
},
|
19
|
+
prevote: {
|
20
|
+
$id: "prevote",
|
21
|
+
properties: {
|
22
|
+
blockId: { $ref: "blockId" },
|
23
|
+
height: { minimum: 1, type: "integer" },
|
24
|
+
round: { minimum: 0, type: "integer" },
|
25
|
+
signature: { $ref: "consensusSignature" },
|
26
|
+
type: { enum: [contracts_1.Contracts.Crypto.MessageType.Prevote] },
|
27
|
+
validatorIndex: { isValidatorIndex: {} },
|
28
|
+
},
|
29
|
+
required: ["type", "height", "round", "validatorIndex", "signature"],
|
30
|
+
type: "object",
|
31
|
+
},
|
32
|
+
proposal: {
|
33
|
+
$id: "proposal",
|
34
|
+
properties: {
|
35
|
+
block: {
|
36
|
+
properties: {
|
37
|
+
serialized: { $ref: "hex" },
|
38
|
+
},
|
39
|
+
required: ["serialized"],
|
40
|
+
type: "object",
|
41
|
+
},
|
42
|
+
round: { minimum: 0, type: "integer" },
|
43
|
+
signature: { $ref: "consensusSignature" },
|
44
|
+
validRound: { minimum: 0, type: "integer" },
|
45
|
+
validatorIndex: { isValidatorIndex: {} },
|
46
|
+
},
|
47
|
+
required: ["round", "block", "validatorIndex", "signature"],
|
48
|
+
type: "object",
|
49
|
+
},
|
50
|
+
proposalLockProof: {
|
51
|
+
$id: "lockProof",
|
52
|
+
properties: {
|
53
|
+
signature: { $ref: "consensusSignature" },
|
54
|
+
validators: {
|
55
|
+
$ref: "validatorBitmap",
|
56
|
+
},
|
57
|
+
},
|
58
|
+
required: ["signature", "validators"],
|
59
|
+
type: "object",
|
60
|
+
},
|
61
|
+
validatorBitmap: {
|
62
|
+
$id: "validatorBitmap",
|
63
|
+
items: {
|
64
|
+
buffer: {},
|
65
|
+
},
|
66
|
+
limitToActiveValidators: {},
|
67
|
+
type: "array",
|
68
|
+
},
|
69
|
+
};
|
70
|
+
//# sourceMappingURL=schemas.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../source/schemas.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAGnC,QAAA,OAAO,GAGhB;IACH,SAAS,EAAE;QACV,GAAG,EAAE,WAAW;QAChB,UAAU,EAAE;YACX,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5B,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;YACtC,SAAS,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;YACzC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,qBAAS,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;YACxD,cAAc,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;SACxC;QACD,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,CAAC;QACpE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;YACX,SAAS,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;YACzC,UAAU,EAAE;gBACX,IAAI,EAAE,iBAAiB;aACvB;SACD;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;QACrC,IAAI,EAAE,QAAQ;KACd;IACD,eAAe,EAAE;QAChB,GAAG,EAAE,iBAAiB;QACtB,KAAK,EAAE;YACN,MAAM,EAAE,EAAE;SACV;QACD,uBAAuB,EAAE,EAAE;QAC3B,IAAI,EAAE,OAAO;KACb;CACD,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { Contracts } from "@mainsail/contracts";
|
3
|
+
export declare class Serializer implements Contracts.Crypto.MessageSerializer {
|
4
|
+
private readonly serializer;
|
5
|
+
private readonly signatureSize;
|
6
|
+
private readonly hashSize;
|
7
|
+
lockProofSize(): number;
|
8
|
+
serializeProposal(proposal: Contracts.Crypto.SerializableProposalData, options: Contracts.Crypto.SerializeProposalOptions): Promise<Buffer>;
|
9
|
+
serializePrecommit(precommit: Contracts.Crypto.PrecommitData): Promise<Buffer>;
|
10
|
+
serializePrecommitForSignature(precommit: Contracts.Crypto.SignaturePrecommitData): Promise<Buffer>;
|
11
|
+
serializePrevoteForSignature(prevote: Contracts.Crypto.SignaturePrevoteData): Promise<Buffer>;
|
12
|
+
serializePrevote(prevote: Contracts.Crypto.PrevoteData): Promise<Buffer>;
|
13
|
+
serializeLockProof(lockProof: Contracts.Crypto.AggregatedSignature): Promise<Buffer>;
|
14
|
+
serializeProposed(proposedBlock: Contracts.Crypto.ProposedBlockSerializable): Promise<Buffer>;
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=serializer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../source/serializer.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAC;AAE7D,qBACa,UAAW,YAAW,SAAS,CAAC,MAAM,CAAC,iBAAiB;IAEpE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAI9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAGxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAE5B,aAAa,IAAI,MAAM;IAQjB,iBAAiB,CAC7B,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,wBAAwB,EACnD,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,wBAAwB,GAChD,OAAO,CAAC,MAAM,CAAC;IAmCL,kBAAkB,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAmC9E,8BAA8B,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BnG,4BAA4B,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B7F,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAmCxE,kBAAkB,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAepF,iBAAiB,CAAC,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;CAa1G"}
|
@@ -0,0 +1,215 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.Serializer = void 0;
|
13
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
14
|
+
const container_1 = require("@mainsail/container");
|
15
|
+
const contracts_1 = require("@mainsail/contracts");
|
16
|
+
let Serializer = class Serializer {
|
17
|
+
lockProofSize() {
|
18
|
+
return (this.signatureSize + // signature
|
19
|
+
1 +
|
20
|
+
8 // validator set bitmap
|
21
|
+
);
|
22
|
+
}
|
23
|
+
async serializeProposal(proposal, options) {
|
24
|
+
return this.serializer.serialize(proposal, {
|
25
|
+
length: 4 + // round
|
26
|
+
(proposal.validRound === undefined ? 1 : 5) + // validRound
|
27
|
+
4 + // serialized block length
|
28
|
+
proposal.block.serialized.length / 2 + // serialized block
|
29
|
+
1 + // validatorIndex
|
30
|
+
(options.includeSignature ? this.signatureSize : 0), // signature
|
31
|
+
skip: 0,
|
32
|
+
schema: {
|
33
|
+
round: {
|
34
|
+
type: "uint32",
|
35
|
+
},
|
36
|
+
validRound: {
|
37
|
+
optional: true,
|
38
|
+
type: "uint32",
|
39
|
+
},
|
40
|
+
block: {
|
41
|
+
type: "hex",
|
42
|
+
},
|
43
|
+
validatorIndex: {
|
44
|
+
type: "uint8",
|
45
|
+
},
|
46
|
+
...(options.includeSignature
|
47
|
+
? {
|
48
|
+
signature: {
|
49
|
+
type: "consensusSignature",
|
50
|
+
},
|
51
|
+
}
|
52
|
+
: {}),
|
53
|
+
},
|
54
|
+
});
|
55
|
+
}
|
56
|
+
async serializePrecommit(precommit) {
|
57
|
+
return this.serializer.serialize(precommit, {
|
58
|
+
length: 1 + // type
|
59
|
+
4 + // height
|
60
|
+
4 + // round
|
61
|
+
1 + // validatorIndex
|
62
|
+
1 +
|
63
|
+
(precommit.blockId ? this.hashSize : 0) + // blockId
|
64
|
+
this.signatureSize, // signature
|
65
|
+
skip: 0,
|
66
|
+
schema: {
|
67
|
+
type: {
|
68
|
+
type: "uint8",
|
69
|
+
},
|
70
|
+
height: {
|
71
|
+
type: "uint32",
|
72
|
+
},
|
73
|
+
round: {
|
74
|
+
type: "uint32",
|
75
|
+
},
|
76
|
+
blockId: {
|
77
|
+
type: "blockId",
|
78
|
+
optional: true,
|
79
|
+
},
|
80
|
+
validatorIndex: {
|
81
|
+
type: "uint8",
|
82
|
+
},
|
83
|
+
signature: {
|
84
|
+
type: "consensusSignature",
|
85
|
+
},
|
86
|
+
},
|
87
|
+
});
|
88
|
+
}
|
89
|
+
async serializePrecommitForSignature(precommit) {
|
90
|
+
return this.serializer.serialize(precommit, {
|
91
|
+
length: 1 + // type
|
92
|
+
4 + // height
|
93
|
+
4 + // round
|
94
|
+
1 +
|
95
|
+
(precommit.blockId ? this.hashSize : 0), // blockId
|
96
|
+
skip: 0,
|
97
|
+
schema: {
|
98
|
+
type: {
|
99
|
+
type: "uint8",
|
100
|
+
},
|
101
|
+
height: {
|
102
|
+
type: "uint32",
|
103
|
+
},
|
104
|
+
round: {
|
105
|
+
type: "uint32",
|
106
|
+
},
|
107
|
+
blockId: {
|
108
|
+
type: "blockId",
|
109
|
+
optional: true,
|
110
|
+
},
|
111
|
+
},
|
112
|
+
});
|
113
|
+
}
|
114
|
+
async serializePrevoteForSignature(prevote) {
|
115
|
+
return this.serializer.serialize(prevote, {
|
116
|
+
length: 1 + // type
|
117
|
+
4 + // height
|
118
|
+
4 + // round
|
119
|
+
1 +
|
120
|
+
(prevote.blockId ? this.hashSize : 0), // blockId
|
121
|
+
skip: 0,
|
122
|
+
schema: {
|
123
|
+
type: {
|
124
|
+
type: "uint8",
|
125
|
+
},
|
126
|
+
height: {
|
127
|
+
type: "uint32",
|
128
|
+
},
|
129
|
+
round: {
|
130
|
+
type: "uint32",
|
131
|
+
},
|
132
|
+
blockId: {
|
133
|
+
type: "blockId",
|
134
|
+
optional: true,
|
135
|
+
},
|
136
|
+
},
|
137
|
+
});
|
138
|
+
}
|
139
|
+
async serializePrevote(prevote) {
|
140
|
+
return this.serializer.serialize(prevote, {
|
141
|
+
length: 1 + // type
|
142
|
+
4 + // height
|
143
|
+
4 + // round
|
144
|
+
1 +
|
145
|
+
(prevote.blockId ? this.hashSize : 0) + // blockId
|
146
|
+
1 + // validatorIndex
|
147
|
+
this.signatureSize, // signature
|
148
|
+
skip: 0,
|
149
|
+
schema: {
|
150
|
+
type: {
|
151
|
+
type: "uint8",
|
152
|
+
},
|
153
|
+
height: {
|
154
|
+
type: "uint32",
|
155
|
+
},
|
156
|
+
round: {
|
157
|
+
type: "uint32",
|
158
|
+
},
|
159
|
+
blockId: {
|
160
|
+
type: "blockId",
|
161
|
+
optional: true,
|
162
|
+
},
|
163
|
+
validatorIndex: {
|
164
|
+
type: "uint8",
|
165
|
+
},
|
166
|
+
signature: {
|
167
|
+
type: "consensusSignature",
|
168
|
+
},
|
169
|
+
},
|
170
|
+
});
|
171
|
+
}
|
172
|
+
async serializeLockProof(lockProof) {
|
173
|
+
return this.serializer.serialize(lockProof, {
|
174
|
+
length: this.lockProofSize(),
|
175
|
+
skip: 0,
|
176
|
+
schema: {
|
177
|
+
signature: {
|
178
|
+
type: "consensusSignature",
|
179
|
+
},
|
180
|
+
validators: {
|
181
|
+
type: "validatorSet",
|
182
|
+
},
|
183
|
+
},
|
184
|
+
});
|
185
|
+
}
|
186
|
+
async serializeProposed(proposedBlock) {
|
187
|
+
const serializedBlock = Buffer.from(proposedBlock.block.serialized, "hex");
|
188
|
+
// NOTE: The lock proof is undefined most of the time, hence we can safe a lot of bytes
|
189
|
+
// here by explicitly storing it's length instead of padding it with zero bytes.
|
190
|
+
if (proposedBlock.lockProof) {
|
191
|
+
const serializedLockProof = await this.serializeLockProof(proposedBlock.lockProof);
|
192
|
+
const proofLength = Buffer.of(serializedLockProof.length);
|
193
|
+
return Buffer.concat([proofLength, serializedLockProof, serializedBlock]);
|
194
|
+
}
|
195
|
+
return Buffer.concat([Buffer.of(0), serializedBlock]);
|
196
|
+
}
|
197
|
+
};
|
198
|
+
exports.Serializer = Serializer;
|
199
|
+
__decorate([
|
200
|
+
(0, container_1.inject)(contracts_1.Identifiers.Cryptography.Serializer),
|
201
|
+
__metadata("design:type", Object)
|
202
|
+
], Serializer.prototype, "serializer", void 0);
|
203
|
+
__decorate([
|
204
|
+
(0, container_1.inject)(contracts_1.Identifiers.Cryptography.Signature.Size),
|
205
|
+
(0, container_1.tagged)("type", "consensus"),
|
206
|
+
__metadata("design:type", Number)
|
207
|
+
], Serializer.prototype, "signatureSize", void 0);
|
208
|
+
__decorate([
|
209
|
+
(0, container_1.inject)(contracts_1.Identifiers.Cryptography.Hash.Size.SHA256),
|
210
|
+
__metadata("design:type", Number)
|
211
|
+
], Serializer.prototype, "hashSize", void 0);
|
212
|
+
exports.Serializer = Serializer = __decorate([
|
213
|
+
(0, container_1.injectable)()
|
214
|
+
], Serializer);
|
215
|
+
//# sourceMappingURL=serializer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../source/serializer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAChD,mDAAiE;AACjE,mDAA6D;AAGtD,IAAM,UAAU,GAAhB,MAAM,UAAU;IAWf,aAAa;QACnB,OAAO,CACN,IAAI,CAAC,aAAa,GAAG,YAAY;YACjC,CAAC;YACD,CAAC,CAAC,uBAAuB;SACzB,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC7B,QAAmD,EACnD,OAAkD;QAElD,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAA4C,QAAQ,EAAE;YACrF,MAAM,EACL,CAAC,GAAG,QAAQ;gBACZ,CAAC,QAAQ,CAA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sail/crypto-messages",
|
3
|
+
"version": "0.0.1-alpha.1",
|
4
|
+
"description": "Crypto messages utilities for the Mainsail blockchain",
|
5
|
+
"license": "GPL-3.0-only",
|
6
|
+
"contributors": [],
|
7
|
+
"main": "distribution/index.js",
|
8
|
+
"types": "distribution/index.d.ts",
|
9
|
+
"files": [
|
10
|
+
"distribution"
|
11
|
+
],
|
12
|
+
"dependencies": {
|
13
|
+
"ajv": "8.12.0",
|
14
|
+
"delay": "5.0.0",
|
15
|
+
"@mainsail/container": "0.0.1-alpha.1",
|
16
|
+
"@mainsail/contracts": "0.0.1-alpha.1",
|
17
|
+
"@mainsail/crypto-block": "0.0.1-alpha.1",
|
18
|
+
"@mainsail/crypto-config": "0.0.1-alpha.1",
|
19
|
+
"@mainsail/crypto-consensus-bls12-381": "0.0.1-alpha.1",
|
20
|
+
"@mainsail/kernel": "0.0.1-alpha.1",
|
21
|
+
"@mainsail/utils": "0.0.1-alpha.1"
|
22
|
+
},
|
23
|
+
"devDependencies": {
|
24
|
+
"@types/delay": "3.1.0",
|
25
|
+
"uvu": "^0.5.6",
|
26
|
+
"@mainsail/crypto-validation": "0.0.1-alpha.1",
|
27
|
+
"@mainsail/validation": "0.0.1-alpha.1"
|
28
|
+
},
|
29
|
+
"engines": {
|
30
|
+
"node": ">=20.x"
|
31
|
+
},
|
32
|
+
"scripts": {
|
33
|
+
"build": "pnpm run clean && tsc",
|
34
|
+
"build:watch": "pnpm run clean && tsc -w",
|
35
|
+
"clean": "del distribution",
|
36
|
+
"release": "pnpm publish --access public",
|
37
|
+
"test": "uvu -r tsm source .test.ts",
|
38
|
+
"test:coverage": "c8 pnpm run test",
|
39
|
+
"test:coverage:html": "c8 -r html --all pnpm run test",
|
40
|
+
"test:file": "uvu -r tsm source"
|
41
|
+
}
|
42
|
+
}
|