mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
update: unit test
This commit is contained in:
parent
cc86425ff1
commit
312a19d9f6
|
|
@ -97,6 +97,7 @@ describe("Connext Connector [Optimism]", () => {
|
||||||
const slippage = 10000;
|
const slippage = 10000;
|
||||||
const relayerFee = ethers.utils.parseEther("1");
|
const relayerFee = ethers.utils.parseEther("1");
|
||||||
const callData = "0x";
|
const callData = "0x";
|
||||||
|
const nativeRelayerFee = true;
|
||||||
|
|
||||||
const xcallParams: any = [
|
const xcallParams: any = [
|
||||||
domainId,
|
domainId,
|
||||||
|
|
@ -106,7 +107,8 @@ describe("Connext Connector [Optimism]", () => {
|
||||||
amount,
|
amount,
|
||||||
slippage,
|
slippage,
|
||||||
relayerFee,
|
relayerFee,
|
||||||
callData
|
callData,
|
||||||
|
nativeRelayerFee
|
||||||
];
|
];
|
||||||
|
|
||||||
const spells = [
|
const spells = [
|
||||||
|
|
@ -127,6 +129,7 @@ describe("Connext Connector [Optimism]", () => {
|
||||||
const slippage = 10000;
|
const slippage = 10000;
|
||||||
const relayerFee = ethers.utils.parseEther("1");
|
const relayerFee = ethers.utils.parseEther("1");
|
||||||
const callData = "0x";
|
const callData = "0x";
|
||||||
|
const nativeRelayerFee = true;
|
||||||
|
|
||||||
const xcallParams: any = [
|
const xcallParams: any = [
|
||||||
domainId,
|
domainId,
|
||||||
|
|
@ -136,7 +139,40 @@ describe("Connext Connector [Optimism]", () => {
|
||||||
amount,
|
amount,
|
||||||
slippage,
|
slippage,
|
||||||
relayerFee,
|
relayerFee,
|
||||||
callData
|
callData,
|
||||||
|
nativeRelayerFee
|
||||||
|
];
|
||||||
|
|
||||||
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: connectorName,
|
||||||
|
method: "xcall",
|
||||||
|
args: [xcallParams, 0, 0]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const tx = await dsaWallet0.connect(wallet0).cast(...encodeSpells(spells), wallet1.address);
|
||||||
|
const receipt = await tx.wait();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should xcall with usdc, relayerfee using transacting asset", async () => {
|
||||||
|
const amount = ethers.utils.parseUnits("5", 6);
|
||||||
|
const domainId = 6648936;
|
||||||
|
const slippage = 10000;
|
||||||
|
const relayerFee = ethers.utils.parseEther("1");
|
||||||
|
const callData = "0x";
|
||||||
|
const nativeRelayerFee = false;
|
||||||
|
|
||||||
|
const xcallParams: any = [
|
||||||
|
domainId,
|
||||||
|
wallet1.address,
|
||||||
|
usdcAddr,
|
||||||
|
wallet1.address,
|
||||||
|
amount,
|
||||||
|
slippage,
|
||||||
|
relayerFee,
|
||||||
|
callData,
|
||||||
|
nativeRelayerFee
|
||||||
];
|
];
|
||||||
|
|
||||||
const spells = [
|
const spells = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user