@partisiablockchain/abi-client 6.62.0 → 6.85.0
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/package.json +9 -10
- package/target/main/AccountPluginInvocationDeserialization.js +4 -4
- package/target/main/AccountPluginInvocationDeserialization.js.map +1 -1
- package/target/main/TransactionAndEventDeserialization.js +1 -1
- package/target/main/TransactionAndEventDeserialization.js.map +1 -1
- package/target/main/index.d.ts +8 -2
- package/target/main/index.js +24 -6
- package/target/main/index.js.map +1 -1
- package/target/main/parser/AbiParser.js +3 -2
- package/target/main/parser/AbiParser.js.map +1 -1
- package/target/main/transaction/TransactionSerialization.d.ts +7 -0
- package/target/main/transaction/TransactionSerialization.js +49 -0
- package/target/main/transaction/TransactionSerialization.js.map +1 -0
- package/target/main/transaction/model/InnerEvent.d.ts +73 -0
- package/target/main/transaction/model/InnerEvent.js +140 -0
- package/target/main/transaction/model/InnerEvent.js.map +1 -0
- package/target/main/transaction/model/InnerSystemEvent.d.ts +150 -0
- package/target/main/transaction/model/InnerSystemEvent.js +279 -0
- package/target/main/transaction/model/InnerSystemEvent.js.map +1 -0
- package/target/main/transaction/model/Model.d.ts +81 -0
- package/target/main/transaction/model/Model.js +121 -0
- package/target/main/transaction/model/Model.js.map +1 -0
- package/target/main/transaction/model/StreamHelper.d.ts +16 -0
- package/target/main/transaction/model/StreamHelper.js +70 -0
- package/target/main/transaction/model/StreamHelper.js.map +1 -0
- package/target/main/transaction/model/Transaction.d.ts +58 -0
- package/target/main/transaction/model/Transaction.js +101 -0
- package/target/main/transaction/model/Transaction.js.map +1 -0
- package/target/main/transaction/TransactionBuilder.d.ts +0 -7
- package/target/main/transaction/TransactionBuilder.js +0 -47
- package/target/main/transaction/TransactionBuilder.js.map +0 -1
- package/target/main/transaction/TransactionReader.d.ts +0 -19
- package/target/main/transaction/TransactionReader.js +0 -74
- package/target/main/transaction/TransactionReader.js.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (C) 2022 - 2025 Partisia Blockchain Foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.InnerEvent = exports.EventType = void 0;
|
|
24
|
+
const Transaction_1 = require("./Transaction");
|
|
25
|
+
const InnerSystemEvent_1 = require("./InnerSystemEvent");
|
|
26
|
+
const StreamHelper_1 = require("./StreamHelper");
|
|
27
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
28
|
+
/** The various types of events that might occur on the blockchain.*/
|
|
29
|
+
var EventType;
|
|
30
|
+
(function (EventType) {
|
|
31
|
+
/** {@link Transaction}: Either a contract deployment, upgrade or interaction. */
|
|
32
|
+
EventType[EventType["TRANSACTION"] = 0] = "TRANSACTION";
|
|
33
|
+
/**
|
|
34
|
+
* {@link CallbackToContract}: Callback invocation to a specific smart contract, that requested
|
|
35
|
+
* the callback.
|
|
36
|
+
*/
|
|
37
|
+
EventType[EventType["CALLBACK"] = 1] = "CALLBACK";
|
|
38
|
+
/** {@link InnerSystemEvent}: Special kinds of changes to the underlying blockchain. */
|
|
39
|
+
EventType[EventType["SYSTEM"] = 2] = "SYSTEM";
|
|
40
|
+
/** {@link SyncEvent}: Special event used when changing the number of blockchain shards. */
|
|
41
|
+
EventType[EventType["SYNC"] = 3] = "SYNC";
|
|
42
|
+
})(EventType || (exports.EventType = EventType = {}));
|
|
43
|
+
const InnerTransaction = {
|
|
44
|
+
read(stream) {
|
|
45
|
+
const from = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
46
|
+
const cost = stream.readI64().toNumber();
|
|
47
|
+
const transaction = Transaction_1.Transaction.read(stream);
|
|
48
|
+
return { eventType: EventType.TRANSACTION, from, cost, transaction };
|
|
49
|
+
},
|
|
50
|
+
write(stream, value) {
|
|
51
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.from);
|
|
52
|
+
stream.writeI64(new bn_js_1.default(value.cost));
|
|
53
|
+
Transaction_1.Transaction.write(stream, value.transaction);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
const CallbackToContract = {
|
|
57
|
+
read(stream) {
|
|
58
|
+
const address = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
59
|
+
const callbackIdentifier = StreamHelper_1.StreamHelper.readHash(stream);
|
|
60
|
+
const from = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
61
|
+
const cost = stream.readI64().toNumber();
|
|
62
|
+
const callbackRpc = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
63
|
+
return { eventType: EventType.CALLBACK, address, callbackIdentifier, from, cost, callbackRpc };
|
|
64
|
+
},
|
|
65
|
+
write(stream, value) {
|
|
66
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.address);
|
|
67
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.callbackIdentifier);
|
|
68
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.from);
|
|
69
|
+
stream.writeI64(new bn_js_1.default(value.cost));
|
|
70
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.callbackRpc);
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const SyncEvent = {
|
|
74
|
+
read(stream) {
|
|
75
|
+
const accounts = StreamHelper_1.StreamHelper.readDynamicList(stream, AccountTransfer.read);
|
|
76
|
+
const contracts = StreamHelper_1.StreamHelper.readDynamicList(stream, ContractTransfer.read);
|
|
77
|
+
const stateStorage = StreamHelper_1.StreamHelper.readDynamicList(stream, StreamHelper_1.StreamHelper.readDynamicBytes);
|
|
78
|
+
return { eventType: EventType.SYNC, accounts, contracts, stateStorage };
|
|
79
|
+
},
|
|
80
|
+
write(stream, value) {
|
|
81
|
+
StreamHelper_1.StreamHelper.writeDynamicList(stream, value.accounts, AccountTransfer.write);
|
|
82
|
+
StreamHelper_1.StreamHelper.writeDynamicList(stream, value.contracts, ContractTransfer.write);
|
|
83
|
+
StreamHelper_1.StreamHelper.writeDynamicList(stream, value.stateStorage, StreamHelper_1.StreamHelper.writeDynamicBytes);
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
const AccountTransfer = {
|
|
87
|
+
read(stream) {
|
|
88
|
+
const address = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
89
|
+
const accountStateHash = StreamHelper_1.StreamHelper.readHash(stream);
|
|
90
|
+
const pluginStateHash = StreamHelper_1.StreamHelper.readHash(stream);
|
|
91
|
+
return { address, accountStateHash, pluginStateHash };
|
|
92
|
+
},
|
|
93
|
+
write(stream, value) {
|
|
94
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.address);
|
|
95
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.accountStateHash);
|
|
96
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.pluginStateHash);
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
const ContractTransfer = {
|
|
100
|
+
read(stream) {
|
|
101
|
+
const address = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
102
|
+
const accountStateHash = StreamHelper_1.StreamHelper.readHash(stream);
|
|
103
|
+
const pluginStateHash = StreamHelper_1.StreamHelper.readHash(stream);
|
|
104
|
+
return { address, accountStateHash, pluginStateHash };
|
|
105
|
+
},
|
|
106
|
+
write(stream, value) {
|
|
107
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.address);
|
|
108
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.accountStateHash);
|
|
109
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.pluginStateHash);
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
exports.InnerEvent = {
|
|
113
|
+
read(stream) {
|
|
114
|
+
const eventType = stream.readU8();
|
|
115
|
+
switch (eventType) {
|
|
116
|
+
case EventType.TRANSACTION:
|
|
117
|
+
return InnerTransaction.read(stream);
|
|
118
|
+
case EventType.CALLBACK:
|
|
119
|
+
return CallbackToContract.read(stream);
|
|
120
|
+
case EventType.SYSTEM:
|
|
121
|
+
return InnerSystemEvent_1.InnerSystemEvent.read(stream);
|
|
122
|
+
case EventType.SYNC:
|
|
123
|
+
return SyncEvent.read(stream);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
write(stream, value) {
|
|
127
|
+
stream.writeU8(value.eventType);
|
|
128
|
+
switch (value.eventType) {
|
|
129
|
+
case EventType.TRANSACTION:
|
|
130
|
+
return InnerTransaction.write(stream, value);
|
|
131
|
+
case EventType.CALLBACK:
|
|
132
|
+
return CallbackToContract.write(stream, value);
|
|
133
|
+
case EventType.SYSTEM:
|
|
134
|
+
return InnerSystemEvent_1.InnerSystemEvent.write(stream, value);
|
|
135
|
+
case EventType.SYNC:
|
|
136
|
+
return SyncEvent.write(stream, value);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=InnerEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InnerEvent.js","sourceRoot":"","sources":["../../../../src/main/transaction/model/InnerEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GA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E,KAAK,CAAC,CAAC;YAC/C,KAAK,SAAS,CAAC,IAAI;gBACjB,OAAO,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { EventType } from "./InnerEvent";
|
|
2
|
+
import { BlockchainAddress, ChainPluginType, Hash, ReturnEnvelope } from "./Model";
|
|
3
|
+
import { ByteInput, ByteOutput } from "@secata-public/bitmanipulation-ts";
|
|
4
|
+
/** Event for manipulating the system state of the blockchain. */
|
|
5
|
+
export type InnerSystemEvent = {
|
|
6
|
+
eventType: EventType.SYSTEM;
|
|
7
|
+
} & SystemEvent;
|
|
8
|
+
type SystemEvent = CreateAccountEvent | CheckExistenceEvent | SetFeatureEvent | UpdateLocalPluginStateEvent | UpdateGlobalPluginStateEvent | UpdatePluginEvent | CallbackEvent | CreateShardEvent | RemoveShardEvent | UpdateContextFreePluginState | UpgradeSystemContractEvent | RemoveContract;
|
|
9
|
+
/** Type of system event. */
|
|
10
|
+
export declare enum SystemEventType {
|
|
11
|
+
/** Create account. */
|
|
12
|
+
CREATE_ACCOUNT = 0,
|
|
13
|
+
/** Check existence. */
|
|
14
|
+
CHECK_EXISTENCE = 1,
|
|
15
|
+
/** Set feature. */
|
|
16
|
+
SET_FEATURE = 2,
|
|
17
|
+
/** Update local plugin state. */
|
|
18
|
+
UPDATE_LOCAL_PLUGIN_STATE = 3,
|
|
19
|
+
/** Update global plugin state. */
|
|
20
|
+
UPDATE_GLOBAL_PLUGIN_STATE = 4,
|
|
21
|
+
/** Update plugin. */
|
|
22
|
+
UPDATE_PLUGIN = 5,
|
|
23
|
+
/** Callback. */
|
|
24
|
+
CALLBACK = 6,
|
|
25
|
+
/** Create shard. */
|
|
26
|
+
CREATE_SHARD = 7,
|
|
27
|
+
/** Remove shard. */
|
|
28
|
+
REMOVE_SHARD = 8,
|
|
29
|
+
/** Update context free plugin state. */
|
|
30
|
+
UPDATE_CONTEXT_FREE_PLUGIN_STATE = 9,
|
|
31
|
+
/** Upgrade system contract. */
|
|
32
|
+
UPGRADE_SYSTEM_CONTRACT = 10,
|
|
33
|
+
/** Remove an existing contract from the state. */
|
|
34
|
+
REMOVE_CONTRACT = 11
|
|
35
|
+
}
|
|
36
|
+
/** Event for creating an account.*/
|
|
37
|
+
export interface CreateAccountEvent {
|
|
38
|
+
systemEventType: SystemEventType.CREATE_ACCOUNT;
|
|
39
|
+
/** Address of account to create. */
|
|
40
|
+
toCreate: BlockchainAddress;
|
|
41
|
+
}
|
|
42
|
+
/** Event for checking existence of an account or contract. */
|
|
43
|
+
export interface CheckExistenceEvent {
|
|
44
|
+
systemEventType: SystemEventType.CHECK_EXISTENCE;
|
|
45
|
+
/** Address to check for existence. */
|
|
46
|
+
contractOrAccountAddress: BlockchainAddress;
|
|
47
|
+
}
|
|
48
|
+
/** Event for setting a feature in the state. */
|
|
49
|
+
export interface SetFeatureEvent {
|
|
50
|
+
systemEventType: SystemEventType.SET_FEATURE;
|
|
51
|
+
/** Indicates feature to set. */
|
|
52
|
+
key: string;
|
|
53
|
+
/** Value to set on feature. */
|
|
54
|
+
value: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** An event to update the local state of a plugin. */
|
|
57
|
+
export interface UpdateLocalPluginStateEvent {
|
|
58
|
+
systemEventType: SystemEventType.UPDATE_LOCAL_PLUGIN_STATE;
|
|
59
|
+
/** The type of plugin to update. */
|
|
60
|
+
type: ChainPluginType;
|
|
61
|
+
/** An update to the local state of a plugin. */
|
|
62
|
+
update: LocalPluginStateUpdate;
|
|
63
|
+
}
|
|
64
|
+
/** Update to be performed against the local state of a plugin. */
|
|
65
|
+
export interface LocalPluginStateUpdate {
|
|
66
|
+
/** Address for plugin. */
|
|
67
|
+
context: BlockchainAddress;
|
|
68
|
+
/** Invocation data. */
|
|
69
|
+
rpc: Buffer;
|
|
70
|
+
}
|
|
71
|
+
/** Event for updating the global state of a plugin. */
|
|
72
|
+
export interface UpdateGlobalPluginStateEvent {
|
|
73
|
+
systemEventType: SystemEventType.UPDATE_GLOBAL_PLUGIN_STATE;
|
|
74
|
+
/** The type of plugin to update. */
|
|
75
|
+
type: ChainPluginType;
|
|
76
|
+
/** An update to the global state of a plugin. */
|
|
77
|
+
update: GlobalPluginStateUpdate;
|
|
78
|
+
}
|
|
79
|
+
/** An update that is to be performed against the global state of a plugin. */
|
|
80
|
+
export interface GlobalPluginStateUpdate {
|
|
81
|
+
/** Invocation data. */
|
|
82
|
+
rpc: Buffer;
|
|
83
|
+
}
|
|
84
|
+
/** Event for changing an active plugin. */
|
|
85
|
+
export interface UpdatePluginEvent {
|
|
86
|
+
systemEventType: SystemEventType.UPDATE_PLUGIN;
|
|
87
|
+
/** The type of plugin to update. */
|
|
88
|
+
type: ChainPluginType;
|
|
89
|
+
/** The jar to use as plugin. */
|
|
90
|
+
jar: Buffer | undefined;
|
|
91
|
+
/** Global state migration rpc. */
|
|
92
|
+
invocation: Buffer;
|
|
93
|
+
}
|
|
94
|
+
/** Callback sent when a transaction has been executed. */
|
|
95
|
+
export interface CallbackEvent {
|
|
96
|
+
systemEventType: SystemEventType.CALLBACK;
|
|
97
|
+
/** The destination for this callback. */
|
|
98
|
+
returnEnvelope: ReturnEnvelope;
|
|
99
|
+
/** The transaction that just has completed. */
|
|
100
|
+
completedTransaction: Hash;
|
|
101
|
+
/** Whether the transaction was successful. */
|
|
102
|
+
success: boolean;
|
|
103
|
+
/** Return value of the callback event. */
|
|
104
|
+
returnValue: Buffer;
|
|
105
|
+
}
|
|
106
|
+
/** Event for creating a shard. */
|
|
107
|
+
export interface CreateShardEvent {
|
|
108
|
+
systemEventType: SystemEventType.CREATE_SHARD;
|
|
109
|
+
/** Id of the shard. */
|
|
110
|
+
shardId: string;
|
|
111
|
+
}
|
|
112
|
+
/** Event for removing a shard. */
|
|
113
|
+
export interface RemoveShardEvent {
|
|
114
|
+
systemEventType: SystemEventType.REMOVE_SHARD;
|
|
115
|
+
/** Id of the shard. */
|
|
116
|
+
shardId: string;
|
|
117
|
+
}
|
|
118
|
+
/** An event to update the local state of a plugin without context on a named shard. */
|
|
119
|
+
export interface UpdateContextFreePluginState {
|
|
120
|
+
systemEventType: SystemEventType.UPDATE_CONTEXT_FREE_PLUGIN_STATE;
|
|
121
|
+
/** The type of plugin to update. */
|
|
122
|
+
type: ChainPluginType;
|
|
123
|
+
/** Local state migration rpc. */
|
|
124
|
+
rpc: Buffer;
|
|
125
|
+
}
|
|
126
|
+
/** Event for upgrading a system contract. */
|
|
127
|
+
export interface UpgradeSystemContractEvent {
|
|
128
|
+
systemEventType: SystemEventType.UPGRADE_SYSTEM_CONTRACT;
|
|
129
|
+
/** The contract. */
|
|
130
|
+
contractJar: Buffer;
|
|
131
|
+
/** The binder. */
|
|
132
|
+
binderJar: Buffer;
|
|
133
|
+
/** The abi for the contract. */
|
|
134
|
+
abi: Buffer;
|
|
135
|
+
/** The invocation. */
|
|
136
|
+
rpc: Buffer;
|
|
137
|
+
/** The address of the contract. */
|
|
138
|
+
contractAddress: BlockchainAddress;
|
|
139
|
+
}
|
|
140
|
+
/** System event used to remove a contract from the chain state. */
|
|
141
|
+
export interface RemoveContract {
|
|
142
|
+
systemEventType: SystemEventType.REMOVE_CONTRACT;
|
|
143
|
+
/** The contract that should be removed. */
|
|
144
|
+
contractAddress: BlockchainAddress;
|
|
145
|
+
}
|
|
146
|
+
export declare const InnerSystemEvent: {
|
|
147
|
+
read(stream: ByteInput): InnerSystemEvent;
|
|
148
|
+
write(stream: ByteOutput, value: InnerSystemEvent): void;
|
|
149
|
+
};
|
|
150
|
+
export {};
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (C) 2022 - 2025 Partisia Blockchain Foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.InnerSystemEvent = exports.SystemEventType = void 0;
|
|
21
|
+
const InnerEvent_1 = require("./InnerEvent");
|
|
22
|
+
const Model_1 = require("./Model");
|
|
23
|
+
const StreamHelper_1 = require("./StreamHelper");
|
|
24
|
+
/** Type of system event. */
|
|
25
|
+
var SystemEventType;
|
|
26
|
+
(function (SystemEventType) {
|
|
27
|
+
/** Create account. */
|
|
28
|
+
SystemEventType[SystemEventType["CREATE_ACCOUNT"] = 0] = "CREATE_ACCOUNT";
|
|
29
|
+
/** Check existence. */
|
|
30
|
+
SystemEventType[SystemEventType["CHECK_EXISTENCE"] = 1] = "CHECK_EXISTENCE";
|
|
31
|
+
/** Set feature. */
|
|
32
|
+
SystemEventType[SystemEventType["SET_FEATURE"] = 2] = "SET_FEATURE";
|
|
33
|
+
/** Update local plugin state. */
|
|
34
|
+
SystemEventType[SystemEventType["UPDATE_LOCAL_PLUGIN_STATE"] = 3] = "UPDATE_LOCAL_PLUGIN_STATE";
|
|
35
|
+
/** Update global plugin state. */
|
|
36
|
+
SystemEventType[SystemEventType["UPDATE_GLOBAL_PLUGIN_STATE"] = 4] = "UPDATE_GLOBAL_PLUGIN_STATE";
|
|
37
|
+
/** Update plugin. */
|
|
38
|
+
SystemEventType[SystemEventType["UPDATE_PLUGIN"] = 5] = "UPDATE_PLUGIN";
|
|
39
|
+
/** Callback. */
|
|
40
|
+
SystemEventType[SystemEventType["CALLBACK"] = 6] = "CALLBACK";
|
|
41
|
+
/** Create shard. */
|
|
42
|
+
SystemEventType[SystemEventType["CREATE_SHARD"] = 7] = "CREATE_SHARD";
|
|
43
|
+
/** Remove shard. */
|
|
44
|
+
SystemEventType[SystemEventType["REMOVE_SHARD"] = 8] = "REMOVE_SHARD";
|
|
45
|
+
/** Update context free plugin state. */
|
|
46
|
+
SystemEventType[SystemEventType["UPDATE_CONTEXT_FREE_PLUGIN_STATE"] = 9] = "UPDATE_CONTEXT_FREE_PLUGIN_STATE";
|
|
47
|
+
/** Upgrade system contract. */
|
|
48
|
+
SystemEventType[SystemEventType["UPGRADE_SYSTEM_CONTRACT"] = 10] = "UPGRADE_SYSTEM_CONTRACT";
|
|
49
|
+
/** Remove an existing contract from the state. */
|
|
50
|
+
SystemEventType[SystemEventType["REMOVE_CONTRACT"] = 11] = "REMOVE_CONTRACT";
|
|
51
|
+
})(SystemEventType || (exports.SystemEventType = SystemEventType = {}));
|
|
52
|
+
const CreateAccountEvent = {
|
|
53
|
+
read(stream) {
|
|
54
|
+
const toCreate = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
55
|
+
return { systemEventType: SystemEventType.CREATE_ACCOUNT, toCreate };
|
|
56
|
+
},
|
|
57
|
+
write(stream, value) {
|
|
58
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.toCreate);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const CheckExistenceEvent = {
|
|
62
|
+
read(stream) {
|
|
63
|
+
const contractOrAccountAddress = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
64
|
+
return { systemEventType: SystemEventType.CHECK_EXISTENCE, contractOrAccountAddress };
|
|
65
|
+
},
|
|
66
|
+
write(stream, value) {
|
|
67
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.contractOrAccountAddress);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const SetFeatureEvent = {
|
|
71
|
+
read(stream) {
|
|
72
|
+
const key = stream.readString();
|
|
73
|
+
const value = StreamHelper_1.StreamHelper.readOptional(stream, (stream) => stream.readString());
|
|
74
|
+
return { systemEventType: SystemEventType.SET_FEATURE, key, value };
|
|
75
|
+
},
|
|
76
|
+
write(stream, value) {
|
|
77
|
+
stream.writeString(value.key);
|
|
78
|
+
StreamHelper_1.StreamHelper.writeOptional(stream, value.value, (stream, value) => stream.writeString(value));
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
const UpdateLocalPluginStateEvent = {
|
|
82
|
+
read(stream) {
|
|
83
|
+
const type = stream.readU8();
|
|
84
|
+
const update = LocalPluginStateUpdate.read(stream);
|
|
85
|
+
return { systemEventType: SystemEventType.UPDATE_LOCAL_PLUGIN_STATE, type, update };
|
|
86
|
+
},
|
|
87
|
+
write(stream, value) {
|
|
88
|
+
stream.writeU8(value.type);
|
|
89
|
+
LocalPluginStateUpdate.write(stream, value.update);
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
const LocalPluginStateUpdate = {
|
|
93
|
+
read(stream) {
|
|
94
|
+
const context = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
95
|
+
const rpc = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
96
|
+
return { context, rpc };
|
|
97
|
+
},
|
|
98
|
+
write(stream, value) {
|
|
99
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.context);
|
|
100
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.rpc);
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const UpdateGlobalPluginStateEvent = {
|
|
104
|
+
read(stream) {
|
|
105
|
+
const type = stream.readU8();
|
|
106
|
+
const update = GlobalPluginStateUpdate.read(stream);
|
|
107
|
+
return { systemEventType: SystemEventType.UPDATE_GLOBAL_PLUGIN_STATE, type, update };
|
|
108
|
+
},
|
|
109
|
+
write(stream, value) {
|
|
110
|
+
stream.writeU8(value.type);
|
|
111
|
+
GlobalPluginStateUpdate.write(stream, value.update);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
const GlobalPluginStateUpdate = {
|
|
115
|
+
read(stream) {
|
|
116
|
+
const rpc = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
117
|
+
return { rpc };
|
|
118
|
+
},
|
|
119
|
+
write(stream, value) {
|
|
120
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.rpc);
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const UpdatePluginEvent = {
|
|
124
|
+
read(stream) {
|
|
125
|
+
const type = stream.readU8();
|
|
126
|
+
const jar = StreamHelper_1.StreamHelper.readOptional(stream, StreamHelper_1.StreamHelper.readDynamicBytes);
|
|
127
|
+
const invocation = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
128
|
+
return { systemEventType: SystemEventType.UPDATE_PLUGIN, type, jar, invocation };
|
|
129
|
+
},
|
|
130
|
+
write(stream, value) {
|
|
131
|
+
stream.writeU8(value.type);
|
|
132
|
+
StreamHelper_1.StreamHelper.writeOptional(stream, value.jar, StreamHelper_1.StreamHelper.writeDynamicBytes);
|
|
133
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.invocation);
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
const CallbackEvent = {
|
|
137
|
+
read(stream) {
|
|
138
|
+
const returnEnvelope = Model_1.ReturnEnvelope.read(stream);
|
|
139
|
+
const completedTransaction = StreamHelper_1.StreamHelper.readHash(stream);
|
|
140
|
+
const success = stream.readBoolean();
|
|
141
|
+
const returnValue = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
142
|
+
return {
|
|
143
|
+
systemEventType: SystemEventType.CALLBACK,
|
|
144
|
+
returnEnvelope,
|
|
145
|
+
success,
|
|
146
|
+
completedTransaction,
|
|
147
|
+
returnValue,
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
write(stream, value) {
|
|
151
|
+
Model_1.ReturnEnvelope.write(stream, value.returnEnvelope);
|
|
152
|
+
StreamHelper_1.StreamHelper.writeHash(stream, value.completedTransaction);
|
|
153
|
+
stream.writeBoolean(value.success);
|
|
154
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.returnValue);
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const CreateShardEvent = {
|
|
158
|
+
read(stream) {
|
|
159
|
+
const shardId = stream.readString();
|
|
160
|
+
return { systemEventType: SystemEventType.CREATE_SHARD, shardId };
|
|
161
|
+
},
|
|
162
|
+
write(stream, value) {
|
|
163
|
+
stream.writeString(value.shardId);
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
const RemoveShardEvent = {
|
|
167
|
+
read(stream) {
|
|
168
|
+
const shardId = stream.readString();
|
|
169
|
+
return { systemEventType: SystemEventType.REMOVE_SHARD, shardId };
|
|
170
|
+
},
|
|
171
|
+
write(stream, value) {
|
|
172
|
+
stream.writeString(value.shardId);
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
const UpdateContextFreePluginState = {
|
|
176
|
+
read(stream) {
|
|
177
|
+
const type = stream.readU8();
|
|
178
|
+
const rpc = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
179
|
+
return { systemEventType: SystemEventType.UPDATE_CONTEXT_FREE_PLUGIN_STATE, type, rpc };
|
|
180
|
+
},
|
|
181
|
+
write(stream, value) {
|
|
182
|
+
stream.writeU8(value.type);
|
|
183
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.rpc);
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
const UpgradeSystemContractEvent = {
|
|
187
|
+
read(stream) {
|
|
188
|
+
const contractJar = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
189
|
+
const binderJar = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
190
|
+
const abi = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
191
|
+
const rpc = StreamHelper_1.StreamHelper.readDynamicBytes(stream);
|
|
192
|
+
const contractAddress = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
193
|
+
return {
|
|
194
|
+
systemEventType: SystemEventType.UPGRADE_SYSTEM_CONTRACT,
|
|
195
|
+
contractJar,
|
|
196
|
+
binderJar,
|
|
197
|
+
abi,
|
|
198
|
+
rpc,
|
|
199
|
+
contractAddress,
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
write(stream, value) {
|
|
203
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.contractJar);
|
|
204
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.binderJar);
|
|
205
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.abi);
|
|
206
|
+
StreamHelper_1.StreamHelper.writeDynamicBytes(stream, value.rpc);
|
|
207
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.contractAddress);
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
const RemoveContract = {
|
|
211
|
+
read(stream) {
|
|
212
|
+
const contractAddress = StreamHelper_1.StreamHelper.readAddress(stream);
|
|
213
|
+
return { systemEventType: SystemEventType.REMOVE_CONTRACT, contractAddress };
|
|
214
|
+
},
|
|
215
|
+
write(stream, value) {
|
|
216
|
+
StreamHelper_1.StreamHelper.writeAddress(stream, value.contractAddress);
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
exports.InnerSystemEvent = {
|
|
220
|
+
read(stream) {
|
|
221
|
+
const systemEventType = stream.readU8();
|
|
222
|
+
switch (systemEventType) {
|
|
223
|
+
case SystemEventType.CREATE_ACCOUNT:
|
|
224
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, CreateAccountEvent.read(stream));
|
|
225
|
+
case SystemEventType.CHECK_EXISTENCE:
|
|
226
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, CheckExistenceEvent.read(stream));
|
|
227
|
+
case SystemEventType.SET_FEATURE:
|
|
228
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, SetFeatureEvent.read(stream));
|
|
229
|
+
case SystemEventType.UPDATE_LOCAL_PLUGIN_STATE:
|
|
230
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, UpdateLocalPluginStateEvent.read(stream));
|
|
231
|
+
case SystemEventType.UPDATE_GLOBAL_PLUGIN_STATE:
|
|
232
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, UpdateGlobalPluginStateEvent.read(stream));
|
|
233
|
+
case SystemEventType.UPDATE_PLUGIN:
|
|
234
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, UpdatePluginEvent.read(stream));
|
|
235
|
+
case SystemEventType.CALLBACK:
|
|
236
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, CallbackEvent.read(stream));
|
|
237
|
+
case SystemEventType.CREATE_SHARD:
|
|
238
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, CreateShardEvent.read(stream));
|
|
239
|
+
case SystemEventType.REMOVE_SHARD:
|
|
240
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, RemoveShardEvent.read(stream));
|
|
241
|
+
case SystemEventType.UPDATE_CONTEXT_FREE_PLUGIN_STATE:
|
|
242
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, UpdateContextFreePluginState.read(stream));
|
|
243
|
+
case SystemEventType.UPGRADE_SYSTEM_CONTRACT:
|
|
244
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, UpgradeSystemContractEvent.read(stream));
|
|
245
|
+
case SystemEventType.REMOVE_CONTRACT:
|
|
246
|
+
return Object.assign({ eventType: InnerEvent_1.EventType.SYSTEM }, RemoveContract.read(stream));
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
write(stream, value) {
|
|
250
|
+
stream.writeU8(value.systemEventType);
|
|
251
|
+
switch (value.systemEventType) {
|
|
252
|
+
case SystemEventType.CREATE_ACCOUNT:
|
|
253
|
+
return CreateAccountEvent.write(stream, value);
|
|
254
|
+
case SystemEventType.CHECK_EXISTENCE:
|
|
255
|
+
return CheckExistenceEvent.write(stream, value);
|
|
256
|
+
case SystemEventType.SET_FEATURE:
|
|
257
|
+
return SetFeatureEvent.write(stream, value);
|
|
258
|
+
case SystemEventType.UPDATE_LOCAL_PLUGIN_STATE:
|
|
259
|
+
return UpdateLocalPluginStateEvent.write(stream, value);
|
|
260
|
+
case SystemEventType.UPDATE_GLOBAL_PLUGIN_STATE:
|
|
261
|
+
return UpdateGlobalPluginStateEvent.write(stream, value);
|
|
262
|
+
case SystemEventType.UPDATE_PLUGIN:
|
|
263
|
+
return UpdatePluginEvent.write(stream, value);
|
|
264
|
+
case SystemEventType.CALLBACK:
|
|
265
|
+
return CallbackEvent.write(stream, value);
|
|
266
|
+
case SystemEventType.CREATE_SHARD:
|
|
267
|
+
return CreateShardEvent.write(stream, value);
|
|
268
|
+
case SystemEventType.REMOVE_SHARD:
|
|
269
|
+
return RemoveShardEvent.write(stream, value);
|
|
270
|
+
case SystemEventType.UPDATE_CONTEXT_FREE_PLUGIN_STATE:
|
|
271
|
+
return UpdateContextFreePluginState.write(stream, value);
|
|
272
|
+
case SystemEventType.UPGRADE_SYSTEM_CONTRACT:
|
|
273
|
+
return UpgradeSystemContractEvent.write(stream, value);
|
|
274
|
+
case SystemEventType.REMOVE_CONTRACT:
|
|
275
|
+
return RemoveContract.write(stream, value);
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
//# sourceMappingURL=InnerSystemEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InnerSystemEvent.js","sourceRoot":"","sources":["../../../../src/main/transaction/model/InnerSystemEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,6CAAyC;AACzC,mCAAmF;AAEnF,iDAA8C;AAmB9C,4BAA4B;AAC5B,IAAY,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