File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import {
26
26
bitcoinAddressToSTXAddress ,
27
27
getOperations ,
28
28
getOptionsFromOperations ,
29
- getSingers ,
29
+ getSigners ,
30
30
isDecimalsSupported ,
31
31
isSignedTransaction ,
32
32
isSymbolSupported ,
@@ -249,18 +249,18 @@ export function createRosettaConstructionRouter(db: DataStore): RouterWithAsync
249
249
return ;
250
250
}
251
251
const inputTx = req . body . transaction ;
252
- const singed = req . body . signed ;
252
+ const signed = req . body . signed ;
253
253
const transaction = rawTxToStacksTransaction ( inputTx ) ;
254
254
const checkSigned = isSignedTransaction ( transaction ) ;
255
- if ( singed != checkSigned ) {
255
+ if ( signed != checkSigned ) {
256
256
res . status ( 400 ) . json ( RosettaErrors . invalidParams ) ;
257
257
return ;
258
258
}
259
259
const operations = getOperations ( rawTxToBaseTx ( inputTx ) ) ;
260
- if ( singed ) {
260
+ if ( signed ) {
261
261
res . json ( {
262
262
operations : operations ,
263
- account_identifier_signers : getSingers ( transaction ) ,
263
+ account_identifier_signers : getSigners ( transaction ) ,
264
264
} ) ;
265
265
} else {
266
266
res . json ( {
Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ export function rawTxToBaseTx(raw_tx: string): BaseTx {
359
359
return dbtx ;
360
360
}
361
361
362
- export function getSingers ( transaction : StacksTransaction ) : RosettaAccountIdentifier [ ] | undefined {
362
+ export function getSigners ( transaction : StacksTransaction ) : RosettaAccountIdentifier [ ] | undefined {
363
363
let address ;
364
364
if ( transaction . payload . payloadType == PayloadType . TokenTransfer ) {
365
365
address = transaction . payload . recipient . address ;
@@ -373,25 +373,25 @@ export function getSingers(transaction: StacksTransaction): RosettaAccountIdenti
373
373
const account_identifier_signers : RosettaAccountIdentifier [ ] = [ ] ;
374
374
if ( transaction . auth . authType == AuthType . Standard ) {
375
375
if ( transaction . auth . spendingCondition ) {
376
- const singer = {
376
+ const signer = {
377
377
address : addressToString ( {
378
378
version : version ,
379
379
hash160 : transaction . auth . spendingCondition . signer ,
380
380
type : type ,
381
381
} ) ,
382
382
} ;
383
- account_identifier_signers . push ( singer ) ;
383
+ account_identifier_signers . push ( signer ) ;
384
384
}
385
385
} else if ( transaction . auth . authType == AuthType . Sponsored ) {
386
386
if ( transaction . auth . spendingCondition ) {
387
- const singer = {
387
+ const signer = {
388
388
address : addressToString ( {
389
389
version : version ,
390
390
hash160 : transaction . auth . spendingCondition . signer ,
391
391
type : type ,
392
392
} ) ,
393
393
} ;
394
- account_identifier_signers . push ( singer ) ;
394
+ account_identifier_signers . push ( signer ) ;
395
395
}
396
396
if ( transaction . auth . sponsorSpendingCondition ) {
397
397
const sponsored = {
Original file line number Diff line number Diff line change @@ -967,6 +967,8 @@ describe('Rosetta API', () => {
967
967
// test recipient
968
968
expect ( actual . operations [ 2 ] . account ?. address ) . toEqual ( recipientAddr ) ;
969
969
expect ( actual . operations [ 2 ] . amount ?. value ) . toEqual ( amount . toString ( ) ) ;
970
+ // test signer
971
+ expect ( actual . account_identifier_signers ?. [ 0 ] . address ) . toEqual ( senderAddr ) ;
970
972
} ) ;
971
973
972
974
test ( 'construction/parse - unsigned' , async ( ) => {
You can’t perform that action at this time.
0 commit comments