@@ -18,6 +18,8 @@ const aptosSpecs: AppSpec<Transaction> = {
18
18
appQuery : {
19
19
model : DeviceModelId . nanoSP ,
20
20
appName : "Aptos" ,
21
+ appVersion : "0.8.11" ,
22
+ firmware : "1.3.2" ,
21
23
} ,
22
24
genericDeviceAction : acceptTransaction ,
23
25
testTimeout : 6 * 60 * 1000 ,
@@ -96,12 +98,11 @@ const aptosSpecs: AppSpec<Transaction> = {
96
98
const senderTokenAcc = findTokenSubAccountWithBalance ( account ) ;
97
99
invariant ( senderTokenAcc , "Sender token account with available balance not found" ) ;
98
100
99
- const token = senderTokenAcc . token ;
100
- const siblingWithoutToken = siblings . find ( acc => ! findTokenSubAccount ( acc , token . id ) ) ;
101
- invariant ( siblingWithoutToken , `Recipient without ${ token . ticker } ATA not found` ) ;
101
+ const receiverTokenAcc = siblings . find ( acc => findTokenSubAccountWithBalance ( acc ) ) ;
102
+ invariant ( receiverTokenAcc , "Recipient not found" ) ;
102
103
103
- const amount = senderTokenAcc . balance . div ( 1.9 + 0.2 * Math . random ( ) ) . integerValue ( ) ;
104
- const recipient = siblingWithoutToken . freshAddress ;
104
+ const amount = senderTokenAcc . spendableBalance . div ( 2 ) . integerValue ( ) ;
105
+ const recipient = receiverTokenAcc . freshAddress ;
105
106
const transaction = bridge . createTransaction ( account ) ;
106
107
const subAccountId = senderTokenAcc . id ;
107
108
@@ -123,12 +124,6 @@ function findTokenSubAccountWithBalance(account: Account) {
123
124
| undefined ;
124
125
}
125
126
126
- function findTokenSubAccount ( account : Account , tokenId : string ) {
127
- return account . subAccounts ?. find (
128
- acc => acc . type === "TokenAccount" && acc . token . id === tokenId ,
129
- ) as TokenAccount | undefined ;
130
- }
131
-
132
127
function expectTokenAccountCorrectBalanceChange ( {
133
128
account,
134
129
accountBeforeTransaction,
0 commit comments