@multiversx/sdk-dapp-liquidity 2.1.1-alpha.0 → 2.2.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const r=require("../../types/errors.js"),e=require("../assertRateConfirmationMatchesIntent.js"),o=(n={})=>({to:"0xdeadbeef",data:"0x",gasLimit:BigInt(21e3),value:BigInt(0),account:"0xSender",txHash:"",...n});describe("assertRateConfirmationMatchesIntent",()=>{const n={fromChainId:"1",sender:"0xSender"};it("does not throw for an empty transactions array",()=>{expect(()=>e.assertRateConfirmationMatchesIntent(n,[])).not.toThrow()}),it("does not throw when chainID and account match",()=>{const t=o({
|
|
2
|
+
"use strict";const r=require("../../types/errors.js"),e=require("../assertRateConfirmationMatchesIntent.js"),o=(n={})=>({to:"0xdeadbeef",data:"0x",gasLimit:BigInt(21e3),value:BigInt(0),account:"0xSender",txHash:"",...n});describe("assertRateConfirmationMatchesIntent",()=>{const n={fromChainId:"1",sender:"0xSender"};it("does not throw for an empty transactions array",()=>{expect(()=>e.assertRateConfirmationMatchesIntent(n,[])).not.toThrow()}),it("does not throw when chainID and account match",()=>{const t=o({fromChainId:"1",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).not.toThrow()}),it("does not throw when chainID is undefined (field absent)",()=>{const t=o({account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).not.toThrow()}),it("throws RateConfirmationMismatchError when chainID does not match fromChainId",()=>{const t=o({fromChainId:"999",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).toThrow(r.RateConfirmationMismatchError)}),it("throws RateConfirmationMismatchError when account does not match sender (case-insensitive)",()=>{const t=o({account:"0xAttacker"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t])).toThrow(r.RateConfirmationMismatchError)}),it("does not throw when account matches sender case-insensitively",()=>{const t=o({account:"0xsender"}),a={fromChainId:"1",sender:"0xSENDER"};expect(()=>e.assertRateConfirmationMatchesIntent(a,[t])).not.toThrow()}),it("throws RateConfirmationMismatchError when MvX sender field does not match",()=>{const t=o({account:"0xSender",sender:"erd1attacker"}),a={fromChainId:"1",sender:"erd1legit"};expect(()=>e.assertRateConfirmationMatchesIntent(a,[t])).toThrow(r.RateConfirmationMismatchError)}),it("throws on the bad transaction when mixed valid and invalid transactions are present",()=>{const t=o({fromChainId:"1",account:"0xSender"}),a=o({fromChainId:"999",account:"0xSender"});expect(()=>e.assertRateConfirmationMatchesIntent(n,[t,a])).toThrow(r.RateConfirmationMismatchError)})});
|
|
@@ -14,7 +14,7 @@ describe("assertRateConfirmationMatchesIntent", () => {
|
|
|
14
14
|
it("does not throw for an empty transactions array", () => {
|
|
15
15
|
expect(() => e(n, [])).not.toThrow();
|
|
16
16
|
}), it("does not throw when chainID and account match", () => {
|
|
17
|
-
const t = o({
|
|
17
|
+
const t = o({ fromChainId: "1", account: "0xSender" });
|
|
18
18
|
expect(
|
|
19
19
|
() => e(n, [t])
|
|
20
20
|
).not.toThrow();
|
|
@@ -24,7 +24,7 @@ describe("assertRateConfirmationMatchesIntent", () => {
|
|
|
24
24
|
() => e(n, [t])
|
|
25
25
|
).not.toThrow();
|
|
26
26
|
}), it("throws RateConfirmationMismatchError when chainID does not match fromChainId", () => {
|
|
27
|
-
const t = o({
|
|
27
|
+
const t = o({ fromChainId: "999", account: "0xSender" });
|
|
28
28
|
expect(() => e(n, [t])).toThrow(
|
|
29
29
|
r
|
|
30
30
|
);
|
|
@@ -44,7 +44,7 @@ describe("assertRateConfirmationMatchesIntent", () => {
|
|
|
44
44
|
r
|
|
45
45
|
);
|
|
46
46
|
}), it("throws on the bad transaction when mixed valid and invalid transactions are present", () => {
|
|
47
|
-
const t = o({
|
|
47
|
+
const t = o({ fromChainId: "1", account: "0xSender" }), a = o({ fromChainId: "999", account: "0xSender" });
|
|
48
48
|
expect(
|
|
49
49
|
() => e(n, [t, a])
|
|
50
50
|
).toThrow(r);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "MultiversX",
|
|
4
4
|
"description": "A complete toolkit for bridging assets between MultiversX, Ethereum, BNB Chain and Sui",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/multiversx/mx-sdk-dapp-liquidity.git"
|