@coolwallet/sol
Version:
Coolwallet Solana sdk
305 lines (281 loc) • 21.8 kB
text/typescript
import { TOKEN_PROGRAM_ID } from '../../config/params';
import { Transaction } from '../Transaction';
import {
compileAssociateTokenAccount,
compileDelegateAndCreateAccountWithSeed,
compileSplTokenTransaction,
compileStakingWithdraw,
compileTransferTransaction,
compileUndelegate,
} from '../rawTransaction';
import {
getCreateAndTransferSPLToken,
getDelegateAndCreateAccountArguments,
getSignInArguments,
getSignMessageArguments,
getSignVersionedArguments,
getSplTokenTransferArguments,
getTransferArguments,
getUndelegateArguments,
getWithdrawArguments,
} from '../scriptUtil';
import { VersionedTransaction } from '../versionedTransaction';
jest.mock('@coolwallet/core', () => {
return {
utils: {
getFullPath: jest.fn().mockReturnValue('108000002c800001f58000000080000000'),
},
};
});
describe('Test scriptUtil.getXXXArguments function', () => {
// common parameters
const recentBlockhash = 'FL9S1qtY9NkBXmmcsiiwRgPVDoUV4HRhezJjZvhsbMyK';
const signer = '5kkqLZbsHMLbpMMSrzsHd4ssHtbxGyr7yPHfow8PdJnp';
const computeUnitPrice = '120000';
const computeUnitLimit = '200000';
const tokenProgramId = TOKEN_PROGRAM_ID;
const tokenInfo = {
symbol: 'USDT',
decimals: 6,
address: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
};
it('getTransferArguments', () => {
const tx = {
fromPubkey: signer,
toPubkey: 'B3uA4nk8Y4zgqy96Wk1vofz1CDRrv8yAqtnHECFAKomf',
recentBlockhash,
lamports: 100000,
computeUnitPrice,
computeUnitLimit,
};
const compiledTx = compileTransferTransaction(tx);
const rawTx = new Transaction(compiledTx);
const args = getTransferArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100020446a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a59553011306db1a1031713f763abf61f3ddd146fc10da02d44cac09c15c57ccf600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a400000002d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2dd4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe39864203000903c0d401000000000003000502400d0300020200010c02000000a086010000000000"`
);
});
it('getSplTokenTransferArguments', () => {
const tx = {
signer,
fromTokenAccount: 'FXLxFVPWB8FuRZnb621YbWw2tmY7fmEAJAC6dMkZWWzx',
toTokenAccount: 'ASMnRWAZpArzDDWyqUDzd8TF9AdikwfD9gnYNAu6P7oP',
recentBlockhash,
programId: tokenProgramId,
tokenInfo,
amount: 100,
computeUnitPrice,
computeUnitLimit,
};
const compiledTx = compileSplTokenTransaction(tx);
const rawTx = new Transaction(compiledTx);
const args = getSplTokenTransferArguments(rawTx, 0, tokenInfo);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100030646a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a58c3833bf94c6e3e386337e8efa318b291d494390618f8dbe056a6cb2422c205ad7c99a08ee7f29dc9240af6974fa48b266e47c950ad13631be0aa5a317bdfa9d0306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000ce010e60afedb22717bd63192f54145a3f965a33bb82d2c7029eb2ce1e20826406ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a9d4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe39864203000903c0d401000000000003000502400d03000504020401000a0c640000000000000006060455534454000000ce010e60afedb22717bd63192f54145a3f965a33bb82d2c7029eb2ce1e208264000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`
);
});
it('getCreateAndTransferSplTokenArguments', () => {
const tx = {
signer,
toPubkey: 'B3uA4nk8Y4zgqy96Wk1vofz1CDRrv8yAqtnHECFAKomf',
fromTokenAccount: 'FXLxFVPWB8FuRZnb621YbWw2tmY7fmEAJAC6dMkZWWzx',
toTokenAccount: 'ASMnRWAZpArzDDWyqUDzd8TF9AdikwfD9gnYNAu6P7oP',
recentBlockhash,
programId: tokenProgramId,
tokenInfo,
amount: 100,
computeUnitPrice,
computeUnitLimit,
};
const compiledAssociateAccountTx = compileAssociateTokenAccount({
...tx,
signer,
owner: signer,
associateAccount: tx.toTokenAccount,
token: tokenInfo.address,
});
const transferSplTokenTx = compileSplTokenTransaction({ ...tx, signer });
compiledAssociateAccountTx.instructions.push(...transferSplTokenTx.instructions);
const rawTx = new Transaction(compiledAssociateAccountTx);
const args = getCreateAndTransferSPLToken(rawTx, 0, tokenInfo);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100050846a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a58c3833bf94c6e3e386337e8efa318b291d494390618f8dbe056a6cb2422c205ad7c99a08ee7f29dc9240af6974fa48b266e47c950ad13631be0aa5a317bdfa9d00000000000000000000000000000000000000000000000000000000000000008c97258f4e2489f1bb3d1029148e0d830b5a1399daff1084048e7bd8dbe9f8590306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000ce010e60afedb22717bd63192f54145a3f965a33bb82d2c7029eb2ce1e20826406ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a90000000000000000000000000000000000000000000000000000000000000000d4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe39864204060001000603070005000903c0d401000000000005000502400d03000704020601000a0c640000000000000006060455534454000000ce010e60afedb22717bd63192f54145a3f965a33bb82d2c7029eb2ce1e208264000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`
);
});
it('getSignInArguments', () => {
const message = {
domain: 'solana-labs.github.io',
statement: 'Please sign in.',
address: signer,
};
const args = getSignInArguments(message, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f5800000008000000015736f6c616e612d6c6162732e6769746875622e696f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110a0a506c65617365207369676e20696e2e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000108000002c800001f58000000080000000"`
);
});
it('getSignMessageArguments', () => {
const message = Buffer.from([
115, 111, 108, 97, 110, 97, 45, 108, 97, 98, 115, 46, 103, 105, 116, 104, 117, 98, 46, 105, 111, 32, 119, 97, 110,
116, 115, 32, 121, 111, 117, 32, 116, 111, 32, 115, 105, 103, 110, 32, 105, 110, 32, 119, 105, 116, 104, 32, 121,
111, 117, 114, 32, 83, 111, 108, 97, 110, 97, 32, 97, 99, 99, 111, 117, 110, 116, 58, 10, 53, 120, 112, 86, 70,
121, 57, 80, 70, 101, 88, 113, 56, 106, 101, 112, 84, 81, 83, 50, 112, 49, 114, 82, 78, 98, 77, 118, 50, 78, 53,
50, 82, 74, 52, 82, 65, 88, 86, 106, 100, 110, 72, 77, 10, 10, 80, 108, 101, 97, 115, 101, 32, 115, 105, 103, 110,
32, 105, 110, 46,
]).toString('hex');
const args = getSignMessageArguments(message, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f58000000080000000736f6c616e612d6c6162732e6769746875622e696f2077616e747320796f7520746f207369676e20696e207769746820796f757220536f6c616e61206163636f756e743a0a357870564679395046655871386a657054515332703172524e624d76324e3532524a34524158566a646e484d0a0a506c65617365207369676e20696e2e"`
);
});
it('getSignVersionedArguments', () => {
const txArray = [
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 73, 187, 98, 219,
129, 161, 187, 91, 218, 9, 26, 180, 16, 176, 209, 229, 161, 209, 224, 183, 87, 147, 83, 7, 162, 248, 116, 138, 15,
112, 182, 200, 5, 74, 83, 90, 153, 41, 33, 6, 77, 36, 232, 113, 96, 218, 56, 124, 124, 53, 181, 221, 188, 146,
187, 129, 228, 31, 168, 64, 65, 5, 68, 141, 152, 39, 220, 81, 76, 209, 99, 1, 32, 205, 53, 122, 98, 29, 251, 237,
146, 252, 182, 94, 180, 7, 176, 152, 48, 112, 246, 93, 195, 245, 103, 79, 1, 1, 0, 50, 72, 101, 108, 108, 111, 44,
32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 83, 111, 108, 97, 110, 97, 32, 87, 97, 108, 108, 101, 116, 32, 65,
100, 97, 112, 116, 101, 114, 32, 101, 120, 97, 109, 112, 108, 101, 32, 97, 112, 112, 33,
];
const versionedTransaction = VersionedTransaction.deserialize(Uint8Array.from(Buffer.from(txArray)));
const args = getSignVersionedArguments(versionedTransaction.message, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100010249bb62db81a1bb5bda091ab410b0d1e5a1d1e0b757935307a2f8748a0f70b6c8054a535a992921064d24e87160da387c7c35b5ddbc92bb81e41fa8404105448d9827dc514cd1630120cd357a621dfbed92fcb65eb407b0983070f65dc3f5674f0101003248656c6c6f2c2066726f6d2074686520536f6c616e612057616c6c65742041646170746572206578616d706c652061707021"`
);
});
it('getDelegateAndCreateAccountArguments', async () => {
const tx = {
votePubkey: '9QU2QSxhb24FUX3Tu2FpczXjpK3VYrvRudywSZaM29mF',
newAccountPubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
seed: 'mSNdZ9gneHjGsRPnoQnfSY',
recentBlockhash,
lamports: '100000000',
};
const compiledDelegateAndCreateAccountWithSeedTx = compileDelegateAndCreateAccountWithSeed({
...tx,
fromPubkey: signer,
basePubkey: signer,
});
const rawTx = new Transaction(compiledDelegateAndCreateAccountWithSeedTx);
const args = getDelegateAndCreateAccountArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100070946a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b2647100000000000000000000000000000000000000000000000000000000000000007ce0690f82fb61475febbd1605ef20c346a9167706d829ce4699435c4c2780ae06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000002d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2dd4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe39864203000000000000000000000000000000000000000002020001720300000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a51600000000000000000000000000000000006d534e645a39676e65486a477352506e6f516e66535900e1f50500000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000004020107740000000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a546a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004060103060805000402000000"`
);
});
it('getDelegateAndCreateAccountArguments with compute budget', async () => {
const tx = {
votePubkey: '9QU2QSxhb24FUX3Tu2FpczXjpK3VYrvRudywSZaM29mF',
newAccountPubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
seed: 'mSNdZ9gneHjGsRPnoQnfSY',
recentBlockhash,
lamports: '100000000',
computeUnitPrice,
computeUnitLimit,
};
const compiledDelegateAndCreateAccountWithSeedTx = compileDelegateAndCreateAccountWithSeed({
...tx,
fromPubkey: signer,
basePubkey: signer,
});
const rawTx = new Transaction(compiledDelegateAndCreateAccountWithSeedTx);
const args = getDelegateAndCreateAccountArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100080a46a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b2647100000000000000000000000000000000000000000000000000000000000000007ce0690f82fb61475febbd1605ef20c346a9167706d829ce4699435c4c2780ae0306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff4000000d4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe3986420504000903c0d401000000000004000502400d030002020001720300000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a51600000000000000000000000000000000006d534e645a39676e65486a477352506e6f516e66535900e1f50500000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000005020108740000000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a546a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005060103070906000402000000"`
);
});
it('getUndelegateArguments', async () => {
const tx = {
authorizedPubkey: signer,
stakePubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
recentBlockhash,
};
const compiledUndelegateTx = compileUndelegate({
...tx,
feePayer: signer,
});
const rawTx = new Transaction(compiledUndelegateTx);
const args = getUndelegateArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100020446a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b2647106a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b21000000002d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2dd4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe39864201000000000000000000000000000000000000000002030103000405000000"`
);
});
it('getUndelegateArguments with compute budget', async () => {
const tx = {
authorizedPubkey: signer,
stakePubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
recentBlockhash,
computeUnitPrice,
computeUnitLimit,
};
const compiledUndelegateTx = compileUndelegate({
...tx,
feePayer: signer,
});
const rawTx = new Transaction(compiledUndelegateTx);
const args = getUndelegateArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100030546a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b264710306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b2100000000d4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe3986420302000903c0d401000000000002000502400d030003030104000405000000"`
);
});
it('getWithdrawArguments', async () => {
const tx = {
withdrawToPubKey: signer,
stakePubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
lamports: '100000000',
recentBlockhash,
};
const compiledStakingWithdraw = compileStakingWithdraw({
...tx,
authorizedPubkey: signer,
});
const rawTx = new Transaction(compiledStakingWithdraw);
const args = getWithdrawArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100030546a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b2647106a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000002d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2dd4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe398642010000000000000000000000000000000000000000020501000304000c0400000000e1f50500000000"`
);
});
it('getWithdrawArguments with compute budget', async () => {
const tx = {
withdrawToPubKey: signer,
stakePubkey: '9UdXnMquoTy8RJpQmidCDHJydZo5Q2ZFY2ntNbgqi1HA',
lamports: '100000000',
recentBlockhash,
computeUnitPrice,
computeUnitLimit,
};
const compiledStakingWithdraw = compileStakingWithdraw({
...tx,
authorizedPubkey: signer,
});
const rawTx = new Transaction(compiledStakingWithdraw);
const args = getWithdrawArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100040646a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a57df17b90d080e3a08cad64b0a1eecbdea26322603bd4cda54cf9f25525b264710306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000002d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2dd4eb2f852b6be253a3e9585f8f1c7ad35affb8b3304785b620546d6fbe3986420302000903c0d401000000000002000502400d0300030501000405000c0400000000e1f50500000000"`
);
});
/** https://coolbitx.slack.com/archives/CREBU3Y9J/p1720681306123589
* 使用者遇到符合 base58 標準的 hex 會不小心再 decode 一次,導致 encode 失敗
* **/
it('getDelegateAndCreateAccountArguments with base58 hex', async () => {
const tx = {
newAccountPubkey: '2BYJssEMc2spFHTy7qbET3zQkEPe27tVmfadfQWEPyNJ',
votePubkey: '9QU2QSxhb24FUX3Tu2FpczXjpK3VYrvRudywSZaM29mF',
seed: '577FUdWdT2q8twccYV9WU5',
lamports: '1019700000',
recentBlockhash: 'EihREW9p63PZmRYWNMv7MmHFc9tQdHzVA8ZowkAcyfhz',
computeUnitPrice: '80000',
computeUnitLimit: '200000',
};
const compiledDelegateAndCreateAccountWithSeedTx = compileDelegateAndCreateAccountWithSeed({
...tx,
fromPubkey: signer,
basePubkey: signer,
});
const rawTx = new Transaction(compiledDelegateAndCreateAccountWithSeedTx);
const args = getDelegateAndCreateAccountArguments(rawTx, 0);
expect(args).toMatchInlineSnapshot(
`"11108000002c800001f580000000800000000100080a46a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a5118ee534efe8bda871b7a17a3f3c5298171511299bdd29418bcfd9fca43635d300000000000000000000000000000000000000000000000000000000000000007ce0690f82fb61475febbd1605ef20c346a9167706d829ce4699435c4c2780ae0306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff4000000cbd6719b37beff025927cc01a6c4fa477d342b4947aeb9b5752c7d3b5bd916f10504000903803801000000000004000502400d030002020001720300000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a5160000000000000000000000000000000000353737465564576454327138747763635956395755352063c73c00000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000005020108740000000046a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a546a448fb09aea355ea540c1e2e86127d4795a86a533a977e20f5476f5bd100a500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005060103070906000402000000"`
);
});
});