@mainsail/transactions 0.0.1-evm.4 → 0.0.1-evm.41
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/distribution/handlers/index.d.ts +0 -2
- package/distribution/handlers/index.d.ts.map +1 -1
- package/distribution/handlers/index.js +0 -2
- package/distribution/handlers/index.js.map +1 -1
- package/distribution/handlers/transaction.d.ts +8 -13
- package/distribution/handlers/transaction.d.ts.map +1 -1
- package/distribution/handlers/transaction.js +78 -27
- package/distribution/handlers/transaction.js.map +1 -1
- package/distribution/index.d.ts +0 -2
- package/distribution/index.d.ts.map +1 -1
- package/distribution/index.js +0 -2
- package/distribution/index.js.map +1 -1
- package/distribution/service-provider.d.ts +0 -3
- package/distribution/service-provider.d.ts.map +1 -1
- package/distribution/service-provider.js +17 -28
- package/distribution/service-provider.js.map +1 -1
- package/distribution/transaction-validator.d.ts +2 -2
- package/distribution/transaction-validator.d.ts.map +1 -1
- package/distribution/transaction-validator.js +11 -9
- package/distribution/transaction-validator.js.map +1 -1
- package/package.json +10 -12
- package/distribution/handlers/handler-provider.d.ts +0 -9
- package/distribution/handlers/handler-provider.d.ts.map +0 -1
- package/distribution/handlers/handler-provider.js +0 -98
- package/distribution/handlers/handler-provider.js.map +0 -1
- package/distribution/handlers/handler-registry.d.ts +0 -13
- package/distribution/handlers/handler-registry.d.ts.map +0 -1
- package/distribution/handlers/handler-registry.js +0 -72
- package/distribution/handlers/handler-registry.js.map +0 -1
- package/distribution/utils.d.ts +0 -3
- package/distribution/utils.d.ts.map +0 -1
- package/distribution/utils.js +0 -2
- package/distribution/utils.js.map +0 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { TransactionHandlerProvider } from "./handler-provider.js";
|
|
2
|
-
export { TransactionHandlerRegistry as Registry } from "./handler-registry.js";
|
|
3
1
|
export type { TransactionHandlerConstructor } from "./transaction.js";
|
|
4
2
|
export { TransactionHandler } from "./transaction.js";
|
|
5
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/handlers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/handlers/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/handlers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/handlers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { Contracts } from "@mainsail/contracts";
|
|
2
|
-
export declare
|
|
1
|
+
import type { Contracts } from "@mainsail/contracts";
|
|
2
|
+
export declare class TransactionHandler implements Contracts.Transactions.TransactionHandler {
|
|
3
|
+
#private;
|
|
3
4
|
protected readonly app: Contracts.Kernel.Application;
|
|
4
|
-
protected readonly gasFeeCalculator: Contracts.Evm.GasFeeCalculator;
|
|
5
5
|
protected readonly logger: Contracts.Kernel.Logger;
|
|
6
6
|
protected readonly configuration: Contracts.Crypto.Configuration;
|
|
7
7
|
protected readonly verifier: Contracts.Crypto.TransactionVerifier;
|
|
8
|
-
protected readonly
|
|
9
|
-
|
|
8
|
+
protected readonly feeCalculator: Contracts.BlockchainUtils.FeeCalculator;
|
|
9
|
+
private readonly events;
|
|
10
|
+
private readonly state;
|
|
10
11
|
verify(transaction: Contracts.Crypto.Transaction): Promise<boolean>;
|
|
11
|
-
throwIfCannotBeApplied(transaction: Contracts.Crypto.Transaction, sender: Contracts.State.Wallet): Promise<void>;
|
|
12
|
-
|
|
13
|
-
verifySignatures(wallet: Contracts.State.Wallet, transaction: Contracts.Crypto.TransactionData, multiSignature: Contracts.Crypto.MultiSignatureAsset): Promise<boolean>;
|
|
14
|
-
protected allTransactions(transactions: Contracts.Crypto.Transaction[]): Contracts.Crypto.TransactionData[];
|
|
15
|
-
abstract apply(context: Contracts.Transactions.TransactionHandlerContext, transaction: Contracts.Crypto.Transaction): Promise<Contracts.Evm.TransactionReceipt>;
|
|
16
|
-
abstract getConstructor(): Contracts.Crypto.TransactionConstructor;
|
|
17
|
-
abstract dependencies(): ReadonlyArray<TransactionHandlerConstructor>;
|
|
18
|
-
abstract isActivated(): Promise<boolean>;
|
|
12
|
+
throwIfCannotBeApplied(transaction: Contracts.Crypto.Transaction, sender: Contracts.State.Wallet, evm: Contracts.Evm.Instance): Promise<void>;
|
|
13
|
+
apply(context: Contracts.Transactions.TransactionHandlerContext, transaction: Contracts.Crypto.Transaction): Promise<Contracts.Evm.TransactionReceipt>;
|
|
19
14
|
}
|
|
20
15
|
export type TransactionHandlerConstructor = new () => TransactionHandler;
|
|
21
16
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../source/handlers/transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../source/handlers/transaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,qBACa,kBAAmB,YAAW,SAAS,CAAC,YAAY,CAAC,kBAAkB;;IAEnF,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;IAGpD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAG,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAGnE,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAG,SAAS,CAAC,eAAe,CAAC,aAAa,CAAC;IAG3E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAG3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAElC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnE,sBAAsB,CAClC,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,EACzC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,EAC9B,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,QAAQ,GACzB,OAAO,CAAC,IAAI,CAAC;IA+BH,KAAK,CACjB,OAAO,EAAE,SAAS,CAAC,YAAY,CAAC,yBAAyB,EACzD,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,GACvC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC;CA2C5C;AAED,MAAM,MAAM,6BAA6B,GAAG,UAAU,kBAAkB,CAAC"}
|
|
@@ -7,45 +7,92 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
import { Events, Identifiers } from "@mainsail/constants";
|
|
10
11
|
import { inject, injectable } from "@mainsail/container";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
12
|
+
import { TransactionFailedToPreverifyError, UnexpectedLegacySecondSignatureError } from "@mainsail/exceptions";
|
|
13
|
+
import { assert } from "@mainsail/utils";
|
|
13
14
|
let TransactionHandler = class TransactionHandler {
|
|
15
|
+
app;
|
|
16
|
+
logger;
|
|
17
|
+
configuration;
|
|
18
|
+
verifier;
|
|
19
|
+
feeCalculator;
|
|
20
|
+
events;
|
|
21
|
+
state;
|
|
14
22
|
async verify(transaction) {
|
|
15
|
-
|
|
23
|
+
assert.string(transaction.data.from);
|
|
16
24
|
return this.verifier.verifyHash(transaction.data);
|
|
17
25
|
}
|
|
18
|
-
async throwIfCannotBeApplied(transaction, sender) {
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
async throwIfCannotBeApplied(transaction, sender, evm) {
|
|
27
|
+
// Legacy
|
|
28
|
+
if (sender.hasLegacySecondPublicKey()) {
|
|
29
|
+
await this.verifier.verifyLegacySecondSignature(transaction.data, sender.legacySecondPublicKey());
|
|
21
30
|
}
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
else {
|
|
32
|
+
if (transaction.data.legacySecondSignature) {
|
|
33
|
+
throw new UnexpectedLegacySecondSignatureError();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const milestone = this.configuration.getMilestone();
|
|
37
|
+
const preverified = await evm.preverifyTransaction({
|
|
38
|
+
blockGasLimit: BigInt(milestone.block.maxGasLimit),
|
|
39
|
+
data: Buffer.from(transaction.data.data, "hex"),
|
|
40
|
+
from: transaction.data.from,
|
|
41
|
+
gasLimit: BigInt(transaction.data.gasLimit),
|
|
42
|
+
gasPrice: BigInt(transaction.data.gasPrice),
|
|
43
|
+
legacyAddress: transaction.data.senderLegacyAddress,
|
|
44
|
+
nonce: transaction.data.nonce.toBigInt(),
|
|
45
|
+
specId: milestone.evmSpec,
|
|
46
|
+
to: transaction.data.to,
|
|
47
|
+
txHash: transaction.data.hash,
|
|
48
|
+
value: transaction.data.value.toBigInt(),
|
|
49
|
+
});
|
|
50
|
+
if (!preverified.success) {
|
|
51
|
+
throw new TransactionFailedToPreverifyError(transaction, new Error(preverified.error));
|
|
29
52
|
}
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
async apply(context, transaction) {
|
|
55
|
+
assert.string(transaction.hash);
|
|
56
|
+
const { evmSpec } = this.configuration.getMilestone();
|
|
57
|
+
const { from, senderLegacyAddress } = transaction.data;
|
|
58
|
+
try {
|
|
59
|
+
const { instance, blockContext } = context.evm;
|
|
60
|
+
const { receipt } = await instance.process({
|
|
61
|
+
blockContext,
|
|
62
|
+
data: Buffer.from(transaction.data.data, "hex"),
|
|
63
|
+
from,
|
|
64
|
+
gasLimit: BigInt(transaction.data.gasLimit),
|
|
65
|
+
gasPrice: BigInt(transaction.data.gasPrice),
|
|
66
|
+
index: transaction.data.transactionIndex,
|
|
67
|
+
legacyAddress: senderLegacyAddress,
|
|
68
|
+
nonce: transaction.data.nonce.toBigInt(),
|
|
69
|
+
specId: evmSpec,
|
|
70
|
+
to: transaction.data.to,
|
|
71
|
+
txHash: transaction.hash,
|
|
72
|
+
value: transaction.data.value.toBigInt(),
|
|
73
|
+
});
|
|
74
|
+
void this.#emit(Events.EvmEvent.TransactionReceipt, {
|
|
75
|
+
receipt,
|
|
76
|
+
sender: from,
|
|
77
|
+
transactionId: transaction.hash,
|
|
78
|
+
});
|
|
79
|
+
return receipt;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new Error(`invalid EVM call: ${error.message}`);
|
|
83
|
+
}
|
|
34
84
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
85
|
+
async #emit(event, data) {
|
|
86
|
+
if (this.state.isBootstrap()) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
return this.events.dispatch(event, data);
|
|
39
90
|
}
|
|
40
91
|
};
|
|
41
92
|
__decorate([
|
|
42
93
|
inject(Identifiers.Application.Instance),
|
|
43
94
|
__metadata("design:type", Object)
|
|
44
95
|
], TransactionHandler.prototype, "app", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
inject(Identifiers.Evm.Gas.FeeCalculator),
|
|
47
|
-
__metadata("design:type", Object)
|
|
48
|
-
], TransactionHandler.prototype, "gasFeeCalculator", void 0);
|
|
49
96
|
__decorate([
|
|
50
97
|
inject(Identifiers.Services.Log.Service),
|
|
51
98
|
__metadata("design:type", Object)
|
|
@@ -59,13 +106,17 @@ __decorate([
|
|
|
59
106
|
__metadata("design:type", Object)
|
|
60
107
|
], TransactionHandler.prototype, "verifier", void 0);
|
|
61
108
|
__decorate([
|
|
62
|
-
inject(Identifiers.
|
|
109
|
+
inject(Identifiers.BlockchainUtils.FeeCalculator),
|
|
63
110
|
__metadata("design:type", Object)
|
|
64
|
-
], TransactionHandler.prototype, "
|
|
111
|
+
], TransactionHandler.prototype, "feeCalculator", void 0);
|
|
65
112
|
__decorate([
|
|
66
113
|
inject(Identifiers.Services.EventDispatcher.Service),
|
|
67
114
|
__metadata("design:type", Object)
|
|
68
|
-
], TransactionHandler.prototype, "
|
|
115
|
+
], TransactionHandler.prototype, "events", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
inject(Identifiers.State.State),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], TransactionHandler.prototype, "state", void 0);
|
|
69
120
|
TransactionHandler = __decorate([
|
|
70
121
|
injectable()
|
|
71
122
|
], TransactionHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../source/handlers/transaction.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../source/handlers/transaction.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,iCAAiC,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAC/G,OAAO,E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a;AAGhD;IADlB,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC;;yDACyB;AAG1D;IADhB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC;;kDACM;AAG1C;IADhB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;;iDACe;AApBnC,kBAAkB;IAD9B,UAAU,EAAE;GACA,kBAAkB,CA4G9B"}
|
package/distribution/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,cAAc,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
|
package/distribution/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,cAAc,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { interfaces } from "@mainsail/container";
|
|
2
1
|
import { Providers } from "@mainsail/kernel";
|
|
3
|
-
import { TransactionHandlerConstructor } from "./handlers/index.js";
|
|
4
2
|
export declare class ServiceProvider extends Providers.ServiceProvider {
|
|
5
|
-
static getTransactionHandlerConstructorsBinding(): (context: interfaces.Context) => TransactionHandlerConstructor[];
|
|
6
3
|
register(): Promise<void>;
|
|
7
4
|
required(): Promise<boolean>;
|
|
8
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-provider.d.ts","sourceRoot":"","sources":["../source/service-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-provider.d.ts","sourceRoot":"","sources":["../source/service-provider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,qBACa,eAAgB,SAAQ,SAAS,CAAC,eAAe;IAChD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAazB,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;CAGzC"}
|
|
@@ -1,39 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Identifiers } from "@mainsail/constants";
|
|
8
|
+
import { injectable } from "@mainsail/container";
|
|
2
9
|
import { Providers } from "@mainsail/kernel";
|
|
3
|
-
import {
|
|
4
|
-
import { TransactionHandlerProvider } from "./handlers/index.js";
|
|
10
|
+
import { TransactionHandler } from "./handlers/index.js";
|
|
5
11
|
import { TransactionValidator } from "./transaction-validator.js";
|
|
6
|
-
|
|
7
|
-
static getTransactionHandlerConstructorsBinding() {
|
|
8
|
-
return (context) => {
|
|
9
|
-
const handlerConstructors = [];
|
|
10
|
-
let container = context.container;
|
|
11
|
-
do {
|
|
12
|
-
const bindingDictionary = container["_bindingDictionary"];
|
|
13
|
-
const handlerBindings = bindingDictionary.getMap().get(Identifiers.Transaction.Handler.Instances) ?? [];
|
|
14
|
-
for (const handlerBinding of handlerBindings) {
|
|
15
|
-
if (handlerBinding.implementationType) {
|
|
16
|
-
handlerConstructors.push(handlerBinding.implementationType);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
container = container.parent;
|
|
20
|
-
} while (container);
|
|
21
|
-
return handlerConstructors;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
12
|
+
let ServiceProvider = class ServiceProvider extends Providers.ServiceProvider {
|
|
24
13
|
async register() {
|
|
25
|
-
this.app.bind(Identifiers.Transaction.Handler.Provider).to(TransactionHandlerProvider).inSingletonScope();
|
|
26
|
-
this.app
|
|
27
|
-
.bind(Identifiers.Transaction.Handler.Constructors)
|
|
28
|
-
.toDynamicValue(ServiceProvider.getTransactionHandlerConstructorsBinding());
|
|
29
|
-
this.app.bind(Identifiers.Transaction.Handler.Registry).to(TransactionHandlerRegistry);
|
|
30
14
|
this.app.bind(Identifiers.Transaction.Validator.Instance).to(TransactionValidator);
|
|
15
|
+
this.app.bind(Identifiers.Transaction.Handler).to(TransactionHandler);
|
|
31
16
|
this.app
|
|
32
17
|
.bind(Identifiers.Transaction.Validator.Factory)
|
|
33
|
-
.
|
|
18
|
+
.toFactory((context) => () => context.get(Identifiers.Transaction.Validator.Instance));
|
|
34
19
|
}
|
|
35
20
|
async required() {
|
|
36
21
|
return true;
|
|
37
22
|
}
|
|
38
|
-
}
|
|
23
|
+
};
|
|
24
|
+
ServiceProvider = __decorate([
|
|
25
|
+
injectable()
|
|
26
|
+
], ServiceProvider);
|
|
27
|
+
export { ServiceProvider };
|
|
39
28
|
//# sourceMappingURL=service-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-provider.js","sourceRoot":"","sources":["../source/service-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-provider.js","sourceRoot":"","sources":["../source/service-provider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAG3D,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,SAAS,CAAC,eAAe;IACtD,KAAK,CAAC,QAAQ;QACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC;QAEnF,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;QAEtE,IAAI,CAAC,GAAG;aACN,IAAI,CAA6B,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;aAC3E,SAAS,CACT,CAAC,OAAqD,EAAE,EAAE,CAAC,GAAG,EAAE,CAC/D,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CACxD,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AAjBY,eAAe;IAD3B,UAAU,EAAE;GACA,eAAe,CAiB3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Contracts } from "@mainsail/contracts";
|
|
1
|
+
import type { Contracts } from "@mainsail/contracts";
|
|
2
2
|
export declare class TransactionValidator implements Contracts.Transactions.TransactionValidator {
|
|
3
3
|
private readonly evm;
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly transactionHandler;
|
|
5
5
|
private readonly transactionFactory;
|
|
6
6
|
getEvm(): Contracts.Evm.Instance;
|
|
7
7
|
validate(context: Contracts.Transactions.TransactionValidatorContext, transaction: Contracts.Crypto.Transaction): Promise<Contracts.Evm.TransactionReceipt>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.d.ts","sourceRoot":"","sources":["../source/transaction-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-validator.d.ts","sourceRoot":"","sources":["../source/transaction-validator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,qBACa,oBAAqB,YAAW,SAAS,CAAC,YAAY,CAAC,oBAAoB;IAGvF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA0B;IAG9C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA6C;IAGhF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAuC;IAEnE,MAAM,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ;IAI1B,QAAQ,CACpB,OAAO,EAAE,SAAS,CAAC,YAAY,CAAC,2BAA2B,EAC3D,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,GACvC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC;CA2B5C"}
|
|
@@ -7,20 +7,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
import { Identifiers } from "@mainsail/constants";
|
|
10
11
|
import { inject, injectable, tagged } from "@mainsail/container";
|
|
11
|
-
import {
|
|
12
|
-
import { Utils as AppUtils } from "@mainsail/kernel";
|
|
12
|
+
import { assert } from "@mainsail/utils";
|
|
13
13
|
import { strictEqual } from "assert";
|
|
14
14
|
let TransactionValidator = class TransactionValidator {
|
|
15
|
+
evm;
|
|
16
|
+
transactionHandler;
|
|
17
|
+
transactionFactory;
|
|
15
18
|
getEvm() {
|
|
16
19
|
return this.evm;
|
|
17
20
|
}
|
|
18
21
|
async validate(context, transaction) {
|
|
19
22
|
const deserialized = await this.transactionFactory.fromBytes(transaction.serialized);
|
|
20
|
-
strictEqual(transaction.
|
|
23
|
+
strictEqual(transaction.hash, deserialized.hash);
|
|
21
24
|
const { commitKey, gasLimit, timestamp, generatorAddress } = context;
|
|
22
|
-
const
|
|
23
|
-
const receipt = await handler.apply({
|
|
25
|
+
const receipt = await this.transactionHandler.apply({
|
|
24
26
|
evm: {
|
|
25
27
|
blockContext: {
|
|
26
28
|
commitKey,
|
|
@@ -31,19 +33,19 @@ let TransactionValidator = class TransactionValidator {
|
|
|
31
33
|
instance: this.evm,
|
|
32
34
|
},
|
|
33
35
|
}, transaction);
|
|
34
|
-
|
|
36
|
+
assert.string(transaction.data.from);
|
|
35
37
|
return receipt;
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
__decorate([
|
|
39
41
|
inject(Identifiers.Evm.Instance),
|
|
40
|
-
tagged("instance", "
|
|
42
|
+
tagged("instance", "validator"),
|
|
41
43
|
__metadata("design:type", Object)
|
|
42
44
|
], TransactionValidator.prototype, "evm", void 0);
|
|
43
45
|
__decorate([
|
|
44
|
-
inject(Identifiers.Transaction.Handler
|
|
46
|
+
inject(Identifiers.Transaction.Handler),
|
|
45
47
|
__metadata("design:type", Object)
|
|
46
|
-
], TransactionValidator.prototype, "
|
|
48
|
+
], TransactionValidator.prototype, "transactionHandler", void 0);
|
|
47
49
|
__decorate([
|
|
48
50
|
inject(Identifiers.Cryptography.Transaction.Factory),
|
|
49
51
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../source/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":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CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC;IAChC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC;;iDACc;AAG7B;IADhB,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC;;gEACwC;AAG/D;IADhB,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC;;gEACqB;AAT9D,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CA6ChC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainsail/transactions",
|
|
3
|
-
"version": "0.0.1-evm.
|
|
3
|
+
"version": "0.0.1-evm.41",
|
|
4
4
|
"description": "Transaction Services for Mainsail blockchain",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"contributors": [],
|
|
@@ -11,27 +11,25 @@
|
|
|
11
11
|
"/distribution"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@mainsail/
|
|
15
|
-
"@mainsail/
|
|
16
|
-
"@mainsail/
|
|
17
|
-
"@mainsail/kernel": "0.0.1-evm.
|
|
14
|
+
"@mainsail/constants": "0.0.1-evm.41",
|
|
15
|
+
"@mainsail/container": "0.0.1-evm.41",
|
|
16
|
+
"@mainsail/exceptions": "0.0.1-evm.41",
|
|
17
|
+
"@mainsail/kernel": "0.0.1-evm.41",
|
|
18
|
+
"@mainsail/utils": "0.0.1-evm.41"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@mainsail/utils": "0.0.1-evm.4",
|
|
23
|
-
"@mainsail/crypto-config": "0.0.1-evm.4"
|
|
21
|
+
"uvu": "0.5.6",
|
|
22
|
+
"@mainsail/contracts": "0.0.1-evm.41"
|
|
24
23
|
},
|
|
25
24
|
"engines": {
|
|
26
25
|
"node": ">=20.x"
|
|
27
26
|
},
|
|
28
27
|
"scripts": {
|
|
29
|
-
"build": "
|
|
28
|
+
"build": "tsc -b",
|
|
30
29
|
"build:watch": "pnpm run clean && tsc -w",
|
|
31
|
-
"clean": "del distribution",
|
|
32
30
|
"release": "pnpm publish --access public",
|
|
33
31
|
"test": "pnpm run uvu source .test.ts",
|
|
34
|
-
"test:coverage": "c8 pnpm run test",
|
|
32
|
+
"test:coverage": "c8 -r=text -r=lcov --all pnpm run test",
|
|
35
33
|
"test:coverage:html": "c8 -r html --all pnpm run test",
|
|
36
34
|
"test:file": "pnpm run uvu source",
|
|
37
35
|
"uvu": "tsx --tsconfig ../../tsconfig.test.json ./node_modules/uvu/bin.js"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Contracts } from "@mainsail/contracts";
|
|
2
|
-
export declare class TransactionHandlerProvider implements Contracts.Transactions.TransactionHandlerProvider {
|
|
3
|
-
#private;
|
|
4
|
-
private readonly handlerConstructors;
|
|
5
|
-
private readonly transactionRegistry;
|
|
6
|
-
isRegistrationRequired(): boolean;
|
|
7
|
-
registerHandlers(): void;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=handler-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler-provider.d.ts","sourceRoot":"","sources":["../../source/handlers/handler-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAA2B,MAAM,qBAAqB,CAAC;AAMzE,qBACa,0BAA2B,YAAW,SAAS,CAAC,YAAY,CAAC,0BAA0B;;IAEnG,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmC;IAGvE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAwC;IAKrE,sBAAsB,IAAI,OAAO;IAIjC,gBAAgB,IAAI,IAAI;CA4E/B"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12
|
-
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");
|
|
13
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
|
-
};
|
|
15
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
16
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
17
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
18
|
-
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");
|
|
19
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
20
|
-
};
|
|
21
|
-
var _TransactionHandlerProvider_instances, _TransactionHandlerProvider_registered, _TransactionHandlerProvider_handlerDependencyLookup, _TransactionHandlerProvider_registerHandler, _TransactionHandlerProvider_hasOtherHandlerHandling, _TransactionHandlerProvider_hasOtherHandler;
|
|
22
|
-
import { inject, injectable } from "@mainsail/container";
|
|
23
|
-
import { Contracts, Exceptions, Identifiers } from "@mainsail/contracts";
|
|
24
|
-
import { InternalTransactionType } from "@mainsail/crypto-transaction";
|
|
25
|
-
import { Utils } from "@mainsail/kernel";
|
|
26
|
-
let TransactionHandlerProvider = class TransactionHandlerProvider {
|
|
27
|
-
constructor() {
|
|
28
|
-
_TransactionHandlerProvider_instances.add(this);
|
|
29
|
-
_TransactionHandlerProvider_registered.set(this, false);
|
|
30
|
-
_TransactionHandlerProvider_handlerDependencyLookup.set(this, new Set());
|
|
31
|
-
}
|
|
32
|
-
isRegistrationRequired() {
|
|
33
|
-
return __classPrivateFieldGet(this, _TransactionHandlerProvider_registered, "f") === false;
|
|
34
|
-
}
|
|
35
|
-
registerHandlers() {
|
|
36
|
-
for (const handlerConstructor of this.handlerConstructors) {
|
|
37
|
-
__classPrivateFieldGet(this, _TransactionHandlerProvider_instances, "m", _TransactionHandlerProvider_registerHandler).call(this, handlerConstructor);
|
|
38
|
-
}
|
|
39
|
-
__classPrivateFieldSet(this, _TransactionHandlerProvider_registered, true, "f");
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
_TransactionHandlerProvider_registered = new WeakMap();
|
|
43
|
-
_TransactionHandlerProvider_handlerDependencyLookup = new WeakMap();
|
|
44
|
-
_TransactionHandlerProvider_instances = new WeakSet();
|
|
45
|
-
_TransactionHandlerProvider_registerHandler = function _TransactionHandlerProvider_registerHandler(handlerConstructor) {
|
|
46
|
-
const handler = new handlerConstructor();
|
|
47
|
-
const transactionConstructor = handler.getConstructor();
|
|
48
|
-
__classPrivateFieldGet(this, _TransactionHandlerProvider_handlerDependencyLookup, "f").add(transactionConstructor);
|
|
49
|
-
Utils.assert.defined(transactionConstructor.type);
|
|
50
|
-
Utils.assert.defined(transactionConstructor.typeGroup);
|
|
51
|
-
const internalType = InternalTransactionType.from(transactionConstructor.type, transactionConstructor.typeGroup);
|
|
52
|
-
if (__classPrivateFieldGet(this, _TransactionHandlerProvider_instances, "m", _TransactionHandlerProvider_hasOtherHandlerHandling).call(this, handlerConstructor, internalType, transactionConstructor.version)) {
|
|
53
|
-
throw new Exceptions.AlreadyRegisteredError(internalType);
|
|
54
|
-
}
|
|
55
|
-
for (const dependency of handler.dependencies()) {
|
|
56
|
-
if (__classPrivateFieldGet(this, _TransactionHandlerProvider_instances, "m", _TransactionHandlerProvider_hasOtherHandler).call(this, dependency) === false) {
|
|
57
|
-
throw new Exceptions.UnsatisfiedDependencyError(internalType);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (transactionConstructor.typeGroup !== Contracts.Crypto.TransactionTypeGroup.Core) {
|
|
61
|
-
this.transactionRegistry.registerTransactionType(transactionConstructor);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
_TransactionHandlerProvider_hasOtherHandlerHandling = function _TransactionHandlerProvider_hasOtherHandlerHandling(handlerConstructor, internalType, version) {
|
|
65
|
-
for (const otherHandlerConstructor of this.handlerConstructors) {
|
|
66
|
-
if (otherHandlerConstructor === handlerConstructor) {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const otherHandler = new otherHandlerConstructor();
|
|
70
|
-
const otherTransactionConstructor = otherHandler.getConstructor();
|
|
71
|
-
Utils.assert.defined(otherTransactionConstructor.type);
|
|
72
|
-
Utils.assert.defined(otherTransactionConstructor.typeGroup);
|
|
73
|
-
const otherInternalType = InternalTransactionType.from(otherTransactionConstructor.type, otherTransactionConstructor.typeGroup);
|
|
74
|
-
if (otherInternalType === internalType && otherTransactionConstructor.version === version) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
};
|
|
80
|
-
_TransactionHandlerProvider_hasOtherHandler = function _TransactionHandlerProvider_hasOtherHandler(dependencyConstructor) {
|
|
81
|
-
const dependency = new dependencyConstructor().getConstructor();
|
|
82
|
-
return [...__classPrivateFieldGet(this, _TransactionHandlerProvider_handlerDependencyLookup, "f")].some((handler) => handler.type === dependency.type &&
|
|
83
|
-
handler.typeGroup === dependency.typeGroup &&
|
|
84
|
-
handler.version === dependency.version);
|
|
85
|
-
};
|
|
86
|
-
__decorate([
|
|
87
|
-
inject(Identifiers.Transaction.Handler.Constructors),
|
|
88
|
-
__metadata("design:type", Array)
|
|
89
|
-
], TransactionHandlerProvider.prototype, "handlerConstructors", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
inject(Identifiers.Cryptography.Transaction.Registry),
|
|
92
|
-
__metadata("design:type", Object)
|
|
93
|
-
], TransactionHandlerProvider.prototype, "transactionRegistry", void 0);
|
|
94
|
-
TransactionHandlerProvider = __decorate([
|
|
95
|
-
injectable()
|
|
96
|
-
], TransactionHandlerProvider);
|
|
97
|
-
export { TransactionHandlerProvider };
|
|
98
|
-
//# sourceMappingURL=handler-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler-provider.js","sourceRoot":"","sources":["../../source/handlers/handler-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAA0B,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAKlC,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAAhC;;QAON,iDAAc,KAAK,EAAC;QACpB,8DAA2B,IAAI,GAAG,EAA0B,EAAC;IAkF9D,CAAC;IAhFO,sBAAsB;QAC5B,OAAO,uBAAA,IAAI,8CAAY,KAAK,KAAK,CAAC;IACnC,CAAC;IAEM,gBAAgB;QACtB,KAAK,MAAM,kBAAkB,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3D,uBAAA,IAAI,0FAAiB,MAArB,IAAI,EAAkB,kBAAkB,CAAC,CAAC;QAC3C,CAAC;QAED,uBAAA,IAAI,0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contracts";
|
|
2
|
-
import { TransactionHandler } from "./transaction.js";
|
|
3
|
-
export declare class TransactionHandlerRegistry implements Contracts.Transactions.TransactionHandlerRegistry {
|
|
4
|
-
private readonly provider;
|
|
5
|
-
private readonly handlers;
|
|
6
|
-
initialize(): void;
|
|
7
|
-
getRegisteredHandlers(): TransactionHandler[];
|
|
8
|
-
getRegisteredHandlerByType(internalType: Contracts.Transactions.InternalTransactionType, version?: number): TransactionHandler;
|
|
9
|
-
getActivatedHandlers(): Promise<TransactionHandler[]>;
|
|
10
|
-
getActivatedHandlerByType(internalType: Contracts.Transactions.InternalTransactionType, version?: number): Promise<TransactionHandler>;
|
|
11
|
-
getActivatedHandlerForData(transactionData: Contracts.Crypto.TransactionData): Promise<TransactionHandler>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=handler-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler-registry.d.ts","sourceRoot":"","sources":["../../source/handlers/handler-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAA2B,MAAM,qBAAqB,CAAC;AAKzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,qBACa,0BAA2B,YAAW,SAAS,CAAC,YAAY,CAAC,0BAA0B;IAEnG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IAGvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;IAG1C,UAAU,IAAI,IAAI;IAMlB,qBAAqB,IAAI,kBAAkB,EAAE;IAI7C,0BAA0B,CAChC,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC,uBAAuB,EAC5D,OAAO,SAAI,GACT,kBAAkB;IAiBR,oBAAoB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IASrD,yBAAyB,CACrC,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC,uBAAuB,EAC5D,OAAO,SAAI,GACT,OAAO,CAAC,kBAAkB,CAAC;IAQjB,0BAA0B,CACtC,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,eAAe,GAC/C,OAAO,CAAC,kBAAkB,CAAC;CAI9B"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { inject, injectable, multiInject, postConstruct } from "@mainsail/container";
|
|
11
|
-
import { Exceptions, Identifiers } from "@mainsail/contracts";
|
|
12
|
-
import { InternalTransactionType } from "@mainsail/crypto-transaction";
|
|
13
|
-
import { Utils } from "@mainsail/kernel";
|
|
14
|
-
import { TransactionHandlerProvider } from "./handler-provider.js";
|
|
15
|
-
let TransactionHandlerRegistry = class TransactionHandlerRegistry {
|
|
16
|
-
initialize() {
|
|
17
|
-
if (this.provider.isRegistrationRequired()) {
|
|
18
|
-
this.provider.registerHandlers();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
getRegisteredHandlers() {
|
|
22
|
-
return this.handlers;
|
|
23
|
-
}
|
|
24
|
-
getRegisteredHandlerByType(internalType, version = 1) {
|
|
25
|
-
for (const handler of this.handlers) {
|
|
26
|
-
const transactionConstructor = handler.getConstructor();
|
|
27
|
-
Utils.assert.defined(transactionConstructor.type);
|
|
28
|
-
Utils.assert.defined(transactionConstructor.typeGroup);
|
|
29
|
-
const handlerInternalType = InternalTransactionType.from(transactionConstructor.type, transactionConstructor.typeGroup);
|
|
30
|
-
if (handlerInternalType === internalType && transactionConstructor.version === version) {
|
|
31
|
-
return handler;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
throw new Exceptions.InvalidTransactionTypeError(internalType);
|
|
35
|
-
}
|
|
36
|
-
async getActivatedHandlers() {
|
|
37
|
-
const promises = this.handlers.map(async (handler) => [handler, await handler.isActivated()]);
|
|
38
|
-
const results = await Promise.all(promises);
|
|
39
|
-
const activated = results.filter(([_, activated]) => activated);
|
|
40
|
-
return activated.map(([handler, _]) => handler);
|
|
41
|
-
}
|
|
42
|
-
async getActivatedHandlerByType(internalType, version = 1) {
|
|
43
|
-
const handler = this.getRegisteredHandlerByType(internalType, version);
|
|
44
|
-
if (await handler.isActivated()) {
|
|
45
|
-
return handler;
|
|
46
|
-
}
|
|
47
|
-
throw new Exceptions.DeactivatedTransactionHandlerError(internalType);
|
|
48
|
-
}
|
|
49
|
-
async getActivatedHandlerForData(transactionData) {
|
|
50
|
-
const internalType = InternalTransactionType.from(transactionData.type, transactionData.typeGroup);
|
|
51
|
-
return this.getActivatedHandlerByType(internalType, transactionData.version);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
__decorate([
|
|
55
|
-
inject(Identifiers.Transaction.Handler.Provider),
|
|
56
|
-
__metadata("design:type", TransactionHandlerProvider)
|
|
57
|
-
], TransactionHandlerRegistry.prototype, "provider", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
multiInject(Identifiers.Transaction.Handler.Instances),
|
|
60
|
-
__metadata("design:type", Array)
|
|
61
|
-
], TransactionHandlerRegistry.prototype, "handlers", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
postConstruct(),
|
|
64
|
-
__metadata("design:type", Function),
|
|
65
|
-
__metadata("design:paramtypes", []),
|
|
66
|
-
__metadata("design:returntype", void 0)
|
|
67
|
-
], TransactionHandlerRegistry.prototype, "initialize", null);
|
|
68
|
-
TransactionHandlerRegistry = __decorate([
|
|
69
|
-
injectable()
|
|
70
|
-
], TransactionHandlerRegistry);
|
|
71
|
-
export { TransactionHandlerRegistry };
|
|
72
|
-
//# sourceMappingURL=handler-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler-registry.js","sourceRoot":"","sources":["../../source/handlers/handler-registry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAa,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAI5D,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAQ/B,UAAU;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,EAAE,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAClC,CAAC;IACF,CAAC;IAEM,qBAAqB;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEM,0BAA0B,CAChC,YAA4D,EAC5D,OAAO,GAAG,CAAC;QAEX,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;YACxD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAS,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC1D,KAAK,CAAC,MAAM,CAAC,OAAO,CAAS,sBAAsB,CAAC,SAAS,CAAC,CAAC;YAC/D,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,IAAI,CACvD,sB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O,IAAI,CAAC,yBAAyB,CAAC,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAC9E,CAAC;CACD,CAAA;AA9DiB;IADhB,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;8BACrB,0BAA0B;4DAAC;AAGtC;IADhB,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;;4DACN;AAG1C;IADN,aAAa,EAAE;;;;4DAKf;AAZW,0BAA0B;IADtC,UAAU,EAAE;GACA,0BAA0B,CAgEtC"}
|
package/distribution/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../source/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,eAAO,MAAM,0BAA0B,gBACzB,MAAM,8BAEJ,UAAU,MAAM,CAAC,aAAa,KAC3C,OAAmG,CAAC"}
|
package/distribution/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../source/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACzC,WAAmB,EACnB,MAAM,EACN,aAA6C,EACnC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC"}
|