1515import org .junit .jupiter .api .Disabled ;
1616import org .junit .jupiter .api .Test ;
1717
18+ import java .util .LinkedHashMap ;
1819import java .util .Map ;
1920
2021import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -47,8 +48,8 @@ public void testGetAliasOutputIds() throws ClientException, InterruptedException
4748
4849 Output aliasOutput = client .buildAliasOutput (params );
4950
50- client .buildAndPostBlock (s , new BuildBlockOptions ().withOutputs (new Output [] { aliasOutput }));
51- Thread . sleep ( 1000 * 25 );
51+ Map . Entry < BlockId , Block > entry = client .buildAndPostBlock (s , new BuildBlockOptions ().withOutputs (new Output [] { aliasOutput }));
52+ client . retryUntilIncluded ( entry . getKey (), 2 , 15 );
5253
5354 for (OutputId outputId : client .getAliasOutputIds (new NodeIndexerApi .QueryParams ().withParam ("governor" , address )))
5455 System .out .println (outputId );
@@ -71,8 +72,8 @@ public void testGetNftOutputIds() throws ClientException, NoFundsReceivedFromFau
7172
7273 Output aliasOutput = client .buildNftOutput (params );
7374
74- client .buildAndPostBlock (s , new BuildBlockOptions ().withOutputs (new Output [] { aliasOutput }));
75- Thread . sleep ( 1000 * 25 );
75+ Map . Entry < BlockId , Block > entry = client .buildAndPostBlock (s , new BuildBlockOptions ().withOutputs (new Output [] { aliasOutput }));
76+ client . retryUntilIncluded ( entry . getKey (), 2 , 15 );
7677
7778 for (OutputId outputId : client .getNftOutputIds (new NodeIndexerApi .QueryParams ().withParam ("address" , address )))
7879 System .out .println (outputId );
@@ -94,7 +95,7 @@ public void testGetFoundryOutputIds() throws ClientException, NoFundsReceivedFro
9495 });
9596
9697 Map .Entry <BlockId , Block > response = client .buildAndPostBlock (s , new BuildBlockOptions ().withOutputs (new Output [] { client .buildAliasOutput (p ) }));
97- Thread . sleep ( 1000 * 25 );
98+ client . retryUntilIncluded ( response . getKey (), 2 , 15 );
9899 TransactionId transactionId = client .getTransactionId (new TransactionPayload (response .getValue ().toJson ().get ("payload" ).getAsJsonObject ()));
99100
100101 // Build the Foundry Output
@@ -120,14 +121,14 @@ public void testGetFoundryOutputIds() throws ClientException, NoFundsReceivedFro
120121 }));
121122
122123 // Create the transaction and use the outputs
123- client .buildAndPostBlock (s , new BuildBlockOptions ()
124+ Map . Entry < BlockId , Block > entry = client .buildAndPostBlock (s , new BuildBlockOptions ()
124125 .withOutputs (new Output [] {
125126 foundryOutput ,
126127 newAliasOutput
127128 })
128129 );
129130
130- Thread . sleep ( 1000 * 25 );
131+ client . retryUntilIncluded ( entry . getKey (), 2 , 15 );
131132
132133 for (OutputId outputId : client .getFoundryOutputIds (new NodeIndexerApi .QueryParams ().withParam ("aliasAddress" , client .aliasIdToBech32 (aliasId , client .getBech32Hrp ()))))
133134 System .out .println (outputId );
0 commit comments