testing: fix tests
This commit is contained in:
parent
b71181a404
commit
39f5877756
|
@ -29,6 +29,7 @@ import {
|
|||
deriveCustodyKey,
|
||||
deriveEndpointKey,
|
||||
deriveMintAuthorityKey,
|
||||
deriveRedeemerAccountKey,
|
||||
deriveWrappedMintKey,
|
||||
getAttestTokenAccounts,
|
||||
getCompleteTransferNativeAccounts,
|
||||
|
@ -714,7 +715,8 @@ describe("Token Bridge", () => {
|
|||
|
||||
it("getCompleteTransferNativeWithPayloadCpiAccounts", () => {
|
||||
const mint = NATIVE_MINT;
|
||||
const mintAta = getAssociatedTokenAddressSync(mint, cpiProgramId, true);
|
||||
const redeemer = deriveRedeemerAccountKey(cpiProgramId);
|
||||
const mintAta = getAssociatedTokenAddressSync(mint, redeemer, true);
|
||||
|
||||
const amountEncoded = 42069n;
|
||||
|
||||
|
@ -725,7 +727,7 @@ describe("Token Bridge", () => {
|
|||
1,
|
||||
amountEncoded,
|
||||
1,
|
||||
mintAta.toBuffer().toString("hex"),
|
||||
cpiProgramId.toBuffer().toString("hex"),
|
||||
Buffer.alloc(32, 0),
|
||||
Buffer.from("All your base are belong to us"),
|
||||
nonce,
|
||||
|
@ -739,11 +741,11 @@ describe("Token Bridge", () => {
|
|||
);
|
||||
|
||||
const accounts = getCompleteTransferNativeWithPayloadCpiAccounts(
|
||||
cpiProgramId,
|
||||
TOKEN_BRIDGE_ADDRESS,
|
||||
CORE_BRIDGE_ADDRESS,
|
||||
payer,
|
||||
signedVaa
|
||||
signedVaa,
|
||||
mintAta
|
||||
);
|
||||
|
||||
// verify accounts
|
||||
|
@ -752,7 +754,7 @@ describe("Token Bridge", () => {
|
|||
"GnQ6fGttTRnJpAJuy2XEg5TLgEMtbyU4HDJnBWmojsTv"
|
||||
);
|
||||
expect(accounts.vaa.toString()).to.equal(
|
||||
"9jdun7HMoJp7KL1jRYF7MT9pjRLVM3RPDbDgf6qXNBR4"
|
||||
"GtiCPc4mxBVsrPQVgYnuVUzhuvh24A54KaDZhcP4mhDa"
|
||||
);
|
||||
expect(accounts.tokenBridgeClaim.toString()).to.equal(
|
||||
"HzjTihvhEx7BbKnB2KHATNBwGFCEm2nnMG6c4Pwx6pPE"
|
||||
|
@ -787,7 +789,8 @@ describe("Token Bridge", () => {
|
|||
tokenChain,
|
||||
tokenAddress
|
||||
);
|
||||
const mintAta = getAssociatedTokenAddressSync(mint, cpiProgramId, true);
|
||||
const redeemer = deriveRedeemerAccountKey(cpiProgramId);
|
||||
const mintAta = getAssociatedTokenAddressSync(mint, redeemer, true);
|
||||
|
||||
const amount = 4206942069n;
|
||||
const recipientChain = 1;
|
||||
|
@ -798,7 +801,7 @@ describe("Token Bridge", () => {
|
|||
tokenChain,
|
||||
amount,
|
||||
recipientChain,
|
||||
mintAta.toBuffer().toString("hex"),
|
||||
cpiProgramId.toBuffer().toString("hex"),
|
||||
Buffer.alloc(32, 0),
|
||||
Buffer.from("All your base are belong to us"),
|
||||
nonce,
|
||||
|
@ -812,11 +815,11 @@ describe("Token Bridge", () => {
|
|||
);
|
||||
|
||||
const accounts = getCompleteTransferWrappedWithPayloadCpiAccounts(
|
||||
cpiProgramId,
|
||||
TOKEN_BRIDGE_ADDRESS,
|
||||
CORE_BRIDGE_ADDRESS,
|
||||
payer,
|
||||
signedVaa
|
||||
signedVaa,
|
||||
mintAta
|
||||
);
|
||||
|
||||
// verify accounts
|
||||
|
@ -825,7 +828,7 @@ describe("Token Bridge", () => {
|
|||
"GnQ6fGttTRnJpAJuy2XEg5TLgEMtbyU4HDJnBWmojsTv"
|
||||
);
|
||||
expect(accounts.vaa.toString()).to.equal(
|
||||
"3czQYHVjwCNBAaQAAoMcmtLwXkF16UG1E1wU4RM9tje7"
|
||||
"9nFMaAfuXmE4FdJe8koZ4ScvYcJ5znoJPDgT29aVZM1x"
|
||||
);
|
||||
expect(accounts.tokenBridgeClaim.toString()).to.equal(
|
||||
"7Ae57QxvZMwCrknoDWpeaMTLbMP3LBeCJee6KaLEwxP6"
|
||||
|
|
Loading…
Reference in New Issue