@@ -2,6 +2,7 @@ import { getBuilderFactory } from '../getBuilderFactory';
22import { KeyPair , Utils } from '../../../src' ;
33import should from 'should' ;
44import * as testData from '../../resources/sol' ;
5+ import { FeeOptions } from '@bitgo/sdk-core' ;
56
67describe ( 'Sol Token Transfer Builder' , ( ) => {
78 let ataAddress ;
@@ -26,6 +27,10 @@ describe('Sol Token Transfer Builder', () => {
2627 const owner = testData . tokenTransfers . owner ;
2728 const walletPK = testData . associatedTokenAccounts . accounts [ 0 ] . pub ;
2829 const walletSK = testData . associatedTokenAccounts . accounts [ 0 ] . prv ;
30+ const prioFeeMicroLamports = '10000000' ;
31+ const priorityFee : FeeOptions = {
32+ amount : prioFeeMicroLamports ,
33+ } ;
2934 describe ( 'Succeed' , ( ) => {
3035 before ( async ( ) => {
3136 ataAddress = await Utils . getAssociatedTokenAccountAddress ( mintUSDC , otherAccount . pub ) ;
@@ -37,6 +42,7 @@ describe('Sol Token Transfer Builder', () => {
3742 txBuilder . sender ( walletPK ) ;
3843 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
3944 txBuilder . memo ( memo ) ;
45+ txBuilder . setPriorityFee ( priorityFee ) ;
4046 const tx = await txBuilder . build ( ) ;
4147 tx . inputs . length . should . equal ( 1 ) ;
4248 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -60,6 +66,7 @@ describe('Sol Token Transfer Builder', () => {
6066 txBuilder . nonce ( recentBlockHash , { walletNonceAddress : nonceAccount . pub , authWalletAddress : walletPK } ) ;
6167 txBuilder . sender ( walletPK ) ;
6268 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
69+ txBuilder . setPriorityFee ( priorityFee ) ;
6370 const tx = await txBuilder . build ( ) ;
6471 tx . inputs . length . should . equal ( 1 ) ;
6572 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -89,6 +96,7 @@ describe('Sol Token Transfer Builder', () => {
8996 txBuilder . sender ( walletPK ) ;
9097 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
9198 txBuilder . memo ( memo ) ;
99+ txBuilder . setPriorityFee ( priorityFee ) ;
92100 const tx = await txBuilder . build ( ) ;
93101 tx . inputs . length . should . equal ( 1 ) ;
94102 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -112,6 +120,7 @@ describe('Sol Token Transfer Builder', () => {
112120 txBuilder . nonce ( recentBlockHash ) ;
113121 txBuilder . sender ( walletPK ) ;
114122 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
123+ txBuilder . setPriorityFee ( priorityFee ) ;
115124 const tx = await txBuilder . build ( ) ;
116125 tx . inputs . length . should . equal ( 1 ) ;
117126 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -140,6 +149,7 @@ describe('Sol Token Transfer Builder', () => {
140149 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
141150 txBuilder . memo ( memo ) ;
142151 txBuilder . sign ( { key : walletSK } ) ;
152+ txBuilder . setPriorityFee ( priorityFee ) ;
143153 const tx = await txBuilder . build ( ) ;
144154 tx . id . should . not . equal ( undefined ) ;
145155 tx . inputs . length . should . equal ( 1 ) ;
@@ -177,6 +187,7 @@ describe('Sol Token Transfer Builder', () => {
177187 txBuilder . send ( { address : account5 . pub , amount, tokenName : nameUSDC } ) ;
178188 txBuilder . memo ( memo ) ;
179189 txBuilder . sign ( { key : authAccount . prv } ) ;
190+ txBuilder . setPriorityFee ( priorityFee ) ;
180191 const tx = await txBuilder . build ( ) ;
181192 tx . inputs . length . should . equal ( 6 ) ;
182193 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -259,6 +270,7 @@ describe('Sol Token Transfer Builder', () => {
259270 txBuilder . send ( { address : account1 . pub , amount, tokenName : nameUSDC } ) ;
260271 txBuilder . send ( { address : account2 . pub , amount, tokenName : nameSRM } ) ;
261272 txBuilder . send ( { address : account3 . pub , amount, tokenName : nameRAY } ) ;
273+ txBuilder . setPriorityFee ( priorityFee ) ;
262274 const tx = await txBuilder . build ( ) ;
263275 tx . inputs . length . should . equal ( 4 ) ;
264276 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -325,6 +337,7 @@ describe('Sol Token Transfer Builder', () => {
325337 txBuilder . nonce ( recentBlockHash ) ;
326338 txBuilder . sender ( owner ) ;
327339 txBuilder . send ( { address : account1 . pub , amount, tokenName : nameUSDC } ) ;
340+ txBuilder . setPriorityFee ( priorityFee ) ;
328341 const tx = await txBuilder . build ( ) ;
329342
330343 tx . outputs . should . deepEqual ( [
@@ -343,6 +356,7 @@ describe('Sol Token Transfer Builder', () => {
343356 txBuilder . send ( { address : otherAccount . pub , amount, tokenName : nameUSDC } ) ;
344357 txBuilder . memo ( memo ) ;
345358 txBuilder . createAssociatedTokenAccount ( { ownerAddress : otherAccount . pub , tokenName : nameUSDC } ) ;
359+ txBuilder . setPriorityFee ( priorityFee ) ;
346360 const tx = await txBuilder . build ( ) ;
347361 tx . inputs . length . should . equal ( 1 ) ;
348362 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -399,6 +413,7 @@ describe('Sol Token Transfer Builder', () => {
399413 txBuilder . createAssociatedTokenAccount ( { ownerAddress : otherAccount . pub , tokenName : nameUSDC } ) ;
400414 txBuilder . createAssociatedTokenAccount ( { ownerAddress : account1 . pub , tokenName : nameUSDC } ) ;
401415 txBuilder . createAssociatedTokenAccount ( { ownerAddress : account2 . pub , tokenName : nameUSDC } ) ;
416+ txBuilder . setPriorityFee ( priorityFee ) ;
402417 const tx = await txBuilder . build ( ) ;
403418 tx . inputs . length . should . equal ( 3 ) ;
404419 tx . inputs [ 0 ] . should . deepEqual ( {
@@ -503,6 +518,7 @@ describe('Sol Token Transfer Builder', () => {
503518 txBuilder . createAssociatedTokenAccount ( { ownerAddress : otherAccount . pub , tokenName : nameUSDC } ) ;
504519 txBuilder . createAssociatedTokenAccount ( { ownerAddress : otherAccount . pub , tokenName : nameUSDC } ) ;
505520 txBuilder . createAssociatedTokenAccount ( { ownerAddress : otherAccount . pub , tokenName : nameUSDC } ) ;
521+ txBuilder . setPriorityFee ( priorityFee ) ;
506522 const tx = await txBuilder . build ( ) ;
507523 tx . inputs . length . should . equal ( 3 ) ;
508524 tx . inputs [ 0 ] . should . deepEqual ( {
0 commit comments