@ocap/tx-protocols 1.18.130 → 1.18.131
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.
|
@@ -101,6 +101,9 @@ runner.use(pipes.VerifyAccountMigration({ stateKey: 'senderState', addressKey: '
|
|
|
101
101
|
runner.use(pipes.ExtractState({ from: 'itx.to', to: 'receiverState', status: 'OK', table: 'account' }));
|
|
102
102
|
runner.use(pipes.VerifyAccountMigration({ stateKey: 'receiverState', addressKey: 'itx.to' }));
|
|
103
103
|
|
|
104
|
+
// Ensure sender and receiver are not the same
|
|
105
|
+
runner.use(pipes.AntiLandAttack({ senderState: 'senderState', receiverState: 'receiverState' }));
|
|
106
|
+
|
|
104
107
|
// Extract delegation
|
|
105
108
|
runner.use(pipes.ExtractState({ from: 'itx.address', to: 'delegationState', table: 'delegation', status: 'OK' }));
|
|
106
109
|
|
|
@@ -61,7 +61,6 @@ runner.use(pipes.ExtractState({ from: 'itx.token.address', to: 'tokenState', sta
|
|
|
61
61
|
|
|
62
62
|
// 4. verify sender and signer states
|
|
63
63
|
runner.use(pipes.ExtractState({ from: 'tx.from', to: 'senderState', status: 'INVALID_SENDER_STATE', table: 'account' })); // prettier-ignore
|
|
64
|
-
runner.use(pipes.VerifyAccountMigration({ stateKey: 'senderState', addressKey: 'tx.from' }));
|
|
65
64
|
|
|
66
65
|
// 5. verify amount
|
|
67
66
|
runner.use((context, next) => {
|
|
@@ -146,6 +145,10 @@ runner.use((context, next) => {
|
|
|
146
145
|
verifyMultiSigV2(context, next);
|
|
147
146
|
});
|
|
148
147
|
|
|
148
|
+
// 7. verify signers (sender + proposer)
|
|
149
|
+
runner.use(pipes.ExtractState({ from: 'signers', to: 'signerStates', status: 'INVALID_SIGNER_STATE', table: 'account' })); // prettier-ignore
|
|
150
|
+
runner.use(pipes.VerifyAccountMigration({ signerKey: 'signerStates', stateKey: 'senderState', addressKey: 'tx.from' }));
|
|
151
|
+
|
|
149
152
|
// 8. verify staking: user withdraw is locked in stake
|
|
150
153
|
runner.use((context, next) => {
|
|
151
154
|
const { itx, senderState } = context;
|
|
@@ -87,8 +87,6 @@ runner.use(pipes.VerifySigner({ signer: 'itx.to' }));
|
|
|
87
87
|
runner.use(pipes.VerifyListSize({ listKey: ['senderAssets', 'receiverAssets'] }));
|
|
88
88
|
runner.use(pipes.VerifyListSize({ listKey: ['senderTokens', 'receiverTokens'] }));
|
|
89
89
|
|
|
90
|
-
// TODO: anti-replay-exchange-attack
|
|
91
|
-
|
|
92
90
|
runner.use(pipes.ExtractState({ from: 'tx.from', to: 'senderState', status: 'INVALID_SENDER_STATE', table: 'account' })); // prettier-ignore
|
|
93
91
|
runner.use(pipes.ExtractState({ from: 'tx.delegator', to: 'delegatorState', status: 'OK', table: 'account' }));
|
|
94
92
|
runner.use(pipes.VerifyDelegation({ type: 'signature', signerKey: 'senderState', delegatorKey: 'delegatorState' }));
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.18.
|
|
6
|
+
"version": "1.18.131",
|
|
7
7
|
"description": "Predefined tx pipeline sets to execute certain type of transactions",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@arcblock/did": "1.18.
|
|
25
|
-
"@arcblock/did-util": "1.18.
|
|
26
|
-
"@arcblock/jwt": "1.18.
|
|
27
|
-
"@arcblock/validator": "1.18.
|
|
28
|
-
"@ocap/asset": "1.18.
|
|
29
|
-
"@ocap/mcrypto": "1.18.
|
|
30
|
-
"@ocap/merkle-tree": "1.18.
|
|
31
|
-
"@ocap/message": "1.18.
|
|
32
|
-
"@ocap/state": "1.18.
|
|
33
|
-
"@ocap/tx-pipeline": "1.18.
|
|
34
|
-
"@ocap/util": "1.18.
|
|
35
|
-
"@ocap/wallet": "1.18.
|
|
24
|
+
"@arcblock/did": "1.18.131",
|
|
25
|
+
"@arcblock/did-util": "1.18.131",
|
|
26
|
+
"@arcblock/jwt": "1.18.131",
|
|
27
|
+
"@arcblock/validator": "1.18.131",
|
|
28
|
+
"@ocap/asset": "1.18.131",
|
|
29
|
+
"@ocap/mcrypto": "1.18.131",
|
|
30
|
+
"@ocap/merkle-tree": "1.18.131",
|
|
31
|
+
"@ocap/message": "1.18.131",
|
|
32
|
+
"@ocap/state": "1.18.131",
|
|
33
|
+
"@ocap/tx-pipeline": "1.18.131",
|
|
34
|
+
"@ocap/util": "1.18.131",
|
|
35
|
+
"@ocap/wallet": "1.18.131",
|
|
36
36
|
"debug": "^4.3.4",
|
|
37
37
|
"deep-diff": "^1.0.2",
|
|
38
38
|
"empty-value": "^1.0.1",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"jest": "^27.5.1",
|
|
48
48
|
"start-server-and-test": "^1.14.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1e07d8baecba883a20db0a1ab44aeba211e97b30"
|
|
51
51
|
}
|