@@ -10,7 +10,7 @@ import { generateMnemonic } from "bip39";
10
10
11
11
import { setUp , tearDown } from "../__support__/setup" ;
12
12
13
- export const generateWallets = quantity => {
13
+ export const generateWallets = ( quantity ) => {
14
14
const wallets : { address : string ; passphrase : string ; publicKey : string } [ ] = [ ] ;
15
15
16
16
for ( let i = 0 ; i < quantity ; i ++ ) {
@@ -56,13 +56,13 @@ beforeAll(async () => {
56
56
app = await setUp ( ) ;
57
57
api = new ApiHelpers ( app ) ;
58
58
59
- delegates = secrets . map ( secret => {
59
+ delegates = secrets . map ( ( secret ) => {
60
60
const publicKey : string = Identities . PublicKey . fromPassphrase ( secret ) ;
61
61
const address : string = Identities . Address . fromPassphrase ( secret ) ;
62
62
63
63
const transaction : { amount : string } = Managers . configManager
64
64
. get ( "genesisBlock" )
65
- . transactions . find ( transaction => transaction . recipientId === address && transaction . type === 0 ) ;
65
+ . transactions . find ( ( transaction ) => transaction . recipientId === address && transaction . type === 0 ) ;
66
66
67
67
return {
68
68
secret,
@@ -705,7 +705,7 @@ describe("API 2.0 - Transactions", () => {
705
705
expect ( response . data . data . invalid [ 0 ] ) . toBe ( transactions [ 1 ] . id ) ;
706
706
} ) ;
707
707
708
- it . each ( [ 3 , 5 , 8 ] ) ( "should accept and broadcast %i transactions emptying a wallet" , async txNumber => {
708
+ it . each ( [ 3 , 5 , 8 ] ) ( "should accept and broadcast %i transactions emptying a wallet" , async ( txNumber ) => {
709
709
const sender = delegates [ txNumber ] ; // use txNumber so that we use a different delegate for each test case
710
710
const receivers = generateWallets ( 2 ) ;
711
711
const amountPlusFee = Math . floor ( + sender . balance / txNumber ) ;
@@ -730,16 +730,18 @@ describe("API 2.0 - Transactions", () => {
730
730
731
731
expect ( response ) . toBeSuccessfulResponse ( ) ;
732
732
733
- expect ( response . data . data . accept . sort ( ) ) . toEqual ( allTransactions . map ( transaction => transaction . id ) . sort ( ) ) ;
733
+ expect ( response . data . data . accept . sort ( ) ) . toEqual (
734
+ allTransactions . map ( ( transaction ) => transaction . id ) . sort ( ) ,
735
+ ) ;
734
736
expect ( response . data . data . broadcast . sort ( ) ) . toEqual (
735
- allTransactions . map ( transaction => transaction . id ) . sort ( ) ,
737
+ allTransactions . map ( ( transaction ) => transaction . id ) . sort ( ) ,
736
738
) ;
737
739
expect ( response . data . data . invalid ) . toHaveLength ( 0 ) ;
738
740
} ) ;
739
741
740
742
it . each ( [ 3 , 5 , 8 ] ) (
741
743
"should not accept the last of %i transactions emptying a wallet when the last one is 1 satoshi too much" ,
742
- async txNumber => {
744
+ async ( txNumber ) => {
743
745
const sender = delegates [ txNumber + 1 ] ; // use txNumber + 1 so that we don't use the same delegates as the above test
744
746
const receivers = generateWallets ( 2 ) ;
745
747
const amountPlusFee = Math . floor ( + sender . balance / txNumber ) ;
@@ -769,12 +771,12 @@ describe("API 2.0 - Transactions", () => {
769
771
expect ( response ) . toBeSuccessfulResponse ( ) ;
770
772
771
773
expect ( response . data . data . accept . sort ( ) ) . toEqual (
772
- transactions . map ( transaction => transaction . id ) . sort ( ) ,
774
+ transactions . map ( ( transaction ) => transaction . id ) . sort ( ) ,
773
775
) ;
774
776
expect ( response . data . data . broadcast . sort ( ) ) . toEqual (
775
- transactions . map ( transaction => transaction . id ) . sort ( ) ,
777
+ transactions . map ( ( transaction ) => transaction . id ) . sort ( ) ,
776
778
) ;
777
- expect ( response . data . data . invalid ) . toEqual ( lastTransaction . map ( transaction => transaction . id ) ) ;
779
+ expect ( response . data . data . invalid ) . toEqual ( lastTransaction . map ( ( transaction ) => transaction . id ) ) ;
778
780
} ,
779
781
) ;
780
782
} ) ;
0 commit comments