@gearbox-protocol/sdk 14.12.0-next.27 → 14.12.0-next.28
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.
|
@@ -38,7 +38,6 @@ function makeInnerOperationsState() {
|
|
|
38
38
|
}
|
|
39
39
|
async function applyInnerOperations(sdk, multicall, state) {
|
|
40
40
|
let inBracket = false;
|
|
41
|
-
let storeSeen = false;
|
|
42
41
|
let error;
|
|
43
42
|
for (const op of multicall) {
|
|
44
43
|
let opError;
|
|
@@ -59,13 +58,12 @@ async function applyInnerOperations(sdk, multicall, state) {
|
|
|
59
58
|
state.quotaChanges.push({ token: op.token, balance: op.change });
|
|
60
59
|
break;
|
|
61
60
|
case "StoreExpectedBalances":
|
|
62
|
-
if (
|
|
61
|
+
if (inBracket) {
|
|
63
62
|
opError = {
|
|
64
63
|
code: import_types.ERROR_MALFORMED_BRACKET,
|
|
65
|
-
message: "
|
|
64
|
+
message: "nested storeExpectedBalances/compareBalances bracket"
|
|
66
65
|
};
|
|
67
66
|
}
|
|
68
|
-
storeSeen = true;
|
|
69
67
|
inBracket = true;
|
|
70
68
|
for (const { token, balance } of op.deltas) {
|
|
71
69
|
state.balances.inc(token, balance);
|
|
@@ -26,7 +26,6 @@ function makeInnerOperationsState() {
|
|
|
26
26
|
}
|
|
27
27
|
async function applyInnerOperations(sdk, multicall, state) {
|
|
28
28
|
let inBracket = false;
|
|
29
|
-
let storeSeen = false;
|
|
30
29
|
let error;
|
|
31
30
|
for (const op of multicall) {
|
|
32
31
|
let opError;
|
|
@@ -47,13 +46,12 @@ async function applyInnerOperations(sdk, multicall, state) {
|
|
|
47
46
|
state.quotaChanges.push({ token: op.token, balance: op.change });
|
|
48
47
|
break;
|
|
49
48
|
case "StoreExpectedBalances":
|
|
50
|
-
if (
|
|
49
|
+
if (inBracket) {
|
|
51
50
|
opError = {
|
|
52
51
|
code: ERROR_MALFORMED_BRACKET,
|
|
53
|
-
message: "
|
|
52
|
+
message: "nested storeExpectedBalances/compareBalances bracket"
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
|
-
storeSeen = true;
|
|
57
55
|
inBracket = true;
|
|
58
56
|
for (const { token, balance } of op.deltas) {
|
|
59
57
|
state.balances.inc(token, balance);
|
|
@@ -3,8 +3,8 @@ import type { Asset } from "../../sdk/index.js";
|
|
|
3
3
|
import type { PoolOperationType } from "../parse/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Broken `storeExpectedBalances`/`compareBalances` bracket structure:
|
|
6
|
-
* `storeExpectedBalances` without a matching `compareBalances`,
|
|
7
|
-
*
|
|
6
|
+
* `storeExpectedBalances` without a matching `compareBalances`, nested
|
|
7
|
+
* brackets, or `compareBalances` without a preceding `storeExpectedBalances`.
|
|
8
8
|
* We expect transactions that were generated by our frontend using router/withdrawal compressor
|
|
9
9
|
**/
|
|
10
10
|
export declare const ERROR_MALFORMED_BRACKET = 1001;
|