@@ -744,7 +744,7 @@ async fn test_wasm_end_to_end_fungible(
744
744
) ;
745
745
746
746
// Needed synchronization though removing it does not get error in 100% of cases.
747
- node_service1. process_inbox ( & chain1) . await ?;
747
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
748
748
749
749
let expected_balances = [
750
750
( account_owner1, Amount :: from_tokens ( 5 ) ) ,
@@ -774,7 +774,7 @@ async fn test_wasm_end_to_end_fungible(
774
774
app1. assert_entries ( expected_balances) . await ;
775
775
app1. assert_keys ( [ account_owner1, account_owner2] ) . await ;
776
776
777
- node_service2. process_inbox ( & chain2) . await ?;
777
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
778
778
779
779
// Fungible didn't exist on chain2 initially but now it does and we can talk to it.
780
780
let app2 = FungibleApp (
@@ -807,8 +807,8 @@ async fn test_wasm_end_to_end_fungible(
807
807
. await ;
808
808
809
809
// Make sure that the cross-chain communication happens fast enough.
810
- node_service1. process_inbox ( & chain1) . await ?;
811
- node_service2. process_inbox ( & chain2) . await ?;
810
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
811
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
812
812
813
813
// Checking the final value
814
814
let expected_balances = [
@@ -914,7 +914,7 @@ async fn test_wasm_end_to_end_same_wallet_fungible(
914
914
) ;
915
915
916
916
// Needed synchronization though removing it does not get error in 100% of cases.
917
- node_service. process_inbox ( & chain1) . await ?;
917
+ assert_eq ! ( node_service. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
918
918
919
919
let expected_balances = [
920
920
( account_owner1, Amount :: from_tokens ( 5 ) ) ,
@@ -935,7 +935,7 @@ async fn test_wasm_end_to_end_same_wallet_fungible(
935
935
)
936
936
. await ;
937
937
938
- node_service. process_inbox ( & chain2) . await ?;
938
+ assert_eq ! ( node_service. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
939
939
940
940
// Checking the final values on chain1 and chain2.
941
941
let expected_balances = [
@@ -1054,7 +1054,7 @@ async fn test_wasm_end_to_end_non_fungible(config: impl LineraNetConfig) -> Resu
1054
1054
)
1055
1055
. await ;
1056
1056
1057
- node_service2. process_inbox ( & chain2) . await ?;
1057
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
1058
1058
1059
1059
// Checking the NFT is removed from chain1
1060
1060
assert ! ( app1. get_nft( & nft1_id) . await . is_err( ) ) ;
@@ -1092,8 +1092,8 @@ async fn test_wasm_end_to_end_non_fungible(config: impl LineraNetConfig) -> Resu
1092
1092
. await ;
1093
1093
1094
1094
// Make sure that the cross-chain communication happens fast enough.
1095
- node_service2. process_inbox ( & chain2) . await ?;
1096
- node_service1. process_inbox ( & chain1) . await ?;
1095
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
1096
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1097
1097
1098
1098
// Checking the NFT is removed from chain2
1099
1099
assert ! ( app2. get_nft( & nft1_id) . await . is_err( ) ) ;
@@ -1119,7 +1119,7 @@ async fn test_wasm_end_to_end_non_fungible(config: impl LineraNetConfig) -> Resu
1119
1119
. await ;
1120
1120
1121
1121
// The transfer is received by chain2 and needs to be processed.
1122
- node_service2. process_inbox ( & chain2) . await ?;
1122
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
1123
1123
1124
1124
// Checking the NFT is removed from chain1
1125
1125
assert ! ( app1. get_nft( & nft1_id) . await . is_err( ) ) ;
@@ -1187,7 +1187,7 @@ async fn test_wasm_end_to_end_non_fungible(config: impl LineraNetConfig) -> Resu
1187
1187
. await ;
1188
1188
1189
1189
// The transfer from chain2 has to be received from chain1.
1190
- node_service1. process_inbox ( & chain1) . await ?;
1190
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1191
1191
1192
1192
// Checking the NFT is removed from chain2
1193
1193
assert ! ( app2. get_nft( & nft2_id) . await . is_err( ) ) ;
@@ -1217,8 +1217,8 @@ async fn test_wasm_end_to_end_non_fungible(config: impl LineraNetConfig) -> Resu
1217
1217
. await ;
1218
1218
1219
1219
// Make sure that the cross-chain communication happens fast enough.
1220
- node_service1. process_inbox ( & chain1) . await ?;
1221
- node_service2. process_inbox ( & chain2) . await ?;
1220
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1221
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
1222
1222
1223
1223
// Checking the final state
1224
1224
@@ -1344,8 +1344,8 @@ async fn test_wasm_end_to_end_crowd_funding(config: impl LineraNetConfig) -> Res
1344
1344
1345
1345
// Chain2 requests the application from chain1, so chain1 has
1346
1346
// to receive the request and then chain2 receive the answer.
1347
- node_service1. process_inbox ( & chain1) . await ?;
1348
- node_service2. process_inbox ( & chain2) . await ?;
1347
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1348
+ assert_eq ! ( node_service2. process_inbox( & chain2) . await ?. len ( ) , 1 ) ;
1349
1349
1350
1350
let app_crowd2 = node_service2
1351
1351
. make_application ( & chain2, & application_id_crowd)
@@ -1360,7 +1360,7 @@ async fn test_wasm_end_to_end_crowd_funding(config: impl LineraNetConfig) -> Res
1360
1360
app_crowd2. mutate ( mutation) . await ?;
1361
1361
1362
1362
// Make sure that the pledge is processed fast enough by client1.
1363
- node_service1. process_inbox ( & chain1) . await ?;
1363
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1364
1364
1365
1365
// Ending the campaign.
1366
1366
app_crowd1. mutate ( "collect" ) . await ?;
@@ -1475,10 +1475,13 @@ async fn test_wasm_end_to_end_matching_engine(config: impl LineraNetConfig) -> R
1475
1475
// In an operation node_service_a.request_application(&chain_a, app_b)
1476
1476
// chain_b needs to process the request first and then chain_a
1477
1477
// the answer.
1478
- node_service_a. process_inbox ( & chain_a) . await ?;
1479
- node_service_b. process_inbox ( & chain_b) . await ?;
1480
- node_service_a. process_inbox ( & chain_a) . await ?;
1481
- node_service_admin. process_inbox ( & chain_admin) . await ?;
1478
+ assert_eq ! ( node_service_a. process_inbox( & chain_a) . await ?. len( ) , 1 ) ;
1479
+ assert_eq ! ( node_service_b. process_inbox( & chain_b) . await ?. len( ) , 1 ) ;
1480
+ assert_eq ! ( node_service_a. process_inbox( & chain_a) . await ?. len( ) , 1 ) ;
1481
+ assert_eq ! (
1482
+ node_service_admin. process_inbox( & chain_admin) . await ?. len( ) ,
1483
+ 1
1484
+ ) ;
1482
1485
1483
1486
let app_fungible0_a = FungibleApp ( node_service_a. make_application ( & chain_a, & token0) . await ?) ;
1484
1487
let app_fungible1_a = FungibleApp ( node_service_a. make_application ( & chain_a, & token1) . await ?) ;
@@ -1557,9 +1560,12 @@ async fn test_wasm_end_to_end_matching_engine(config: impl LineraNetConfig) -> R
1557
1560
1558
1561
// First chain_admin needs to process the two requests and
1559
1562
// then chain_a / chain_b the answers.
1560
- node_service_admin. process_inbox ( & chain_admin) . await ?;
1561
- node_service_a. process_inbox ( & chain_a) . await ?;
1562
- node_service_b. process_inbox ( & chain_b) . await ?;
1563
+ assert_eq ! (
1564
+ node_service_admin. process_inbox( & chain_admin) . await ?. len( ) ,
1565
+ 1
1566
+ ) ;
1567
+ assert_eq ! ( node_service_a. process_inbox( & chain_a) . await ?. len( ) , 1 ) ;
1568
+ assert_eq ! ( node_service_b. process_inbox( & chain_b) . await ?. len( ) , 1 ) ;
1563
1569
1564
1570
let app_matching_a = MatchingEngineApp (
1565
1571
node_service_a
@@ -1598,9 +1604,12 @@ async fn test_wasm_end_to_end_matching_engine(config: impl LineraNetConfig) -> R
1598
1604
// The orders are sent on chain_a / chain_b. First they are
1599
1605
// rerouted to the admin chain for processing. This leads
1600
1606
// to order being sent to chain_a / chain_b.
1601
- node_service_admin. process_inbox ( & chain_admin) . await ?;
1602
- node_service_a. process_inbox ( & chain_a) . await ?;
1603
- node_service_b. process_inbox ( & chain_b) . await ?;
1607
+ assert_eq ! (
1608
+ node_service_admin. process_inbox( & chain_admin) . await ?. len( ) ,
1609
+ 1
1610
+ ) ;
1611
+ assert_eq ! ( node_service_a. process_inbox( & chain_a) . await ?. len( ) , 1 ) ;
1612
+ assert_eq ! ( node_service_b. process_inbox( & chain_b) . await ?. len( ) , 1 ) ;
1604
1613
1605
1614
// Now reading the order_ids
1606
1615
let order_ids_a = app_matching_admin. get_account_info ( & owner_a) . await ;
@@ -1628,9 +1637,12 @@ async fn test_wasm_end_to_end_matching_engine(config: impl LineraNetConfig) -> R
1628
1637
}
1629
1638
1630
1639
// Same logic as for the insertion of orders.
1631
- node_service_admin. process_inbox ( & chain_admin) . await ?;
1632
- node_service_a. process_inbox ( & chain_a) . await ?;
1633
- node_service_b. process_inbox ( & chain_b) . await ?;
1640
+ assert_eq ! (
1641
+ node_service_admin. process_inbox( & chain_admin) . await ?. len( ) ,
1642
+ 1
1643
+ ) ;
1644
+ assert_eq ! ( node_service_a. process_inbox( & chain_a) . await ?. len( ) , 1 ) ;
1645
+ assert_eq ! ( node_service_b. process_inbox( & chain_b) . await ?. len( ) , 1 ) ;
1634
1646
1635
1647
// Check balances
1636
1648
app_fungible0_a
@@ -1803,8 +1815,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
1803
1815
)
1804
1816
. await ;
1805
1817
1806
- node_service0. process_inbox ( & chain0) . await ?;
1807
- node_service1. process_inbox ( & chain1) . await ?;
1818
+ assert_eq ! ( node_service0. process_inbox( & chain0) . await ?. len ( ) , 1 ) ;
1819
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1808
1820
1809
1821
let app_fungible0_0 = FungibleApp ( node_service0. make_application ( & chain0, & token0) . await ?) ;
1810
1822
let app_fungible1_0 = FungibleApp ( node_service0. make_application ( & chain0, & token1) . await ?) ;
@@ -1893,9 +1905,9 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
1893
1905
1894
1906
// The chain_amm must first requests those two requests
1895
1907
// and then chain0 / chain1 must handle the answers.
1896
- node_service_amm. process_inbox ( & chain_amm) . await ?;
1897
- node_service0. process_inbox ( & chain0) . await ?;
1898
- node_service1. process_inbox ( & chain1) . await ?;
1908
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
1909
+ assert_eq ! ( node_service0. process_inbox( & chain0) . await ?. len ( ) , 1 ) ;
1910
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1899
1911
1900
1912
let app_amm0 = AmmApp (
1901
1913
node_service0
@@ -1919,8 +1931,7 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
1919
1931
. add_liquidity ( owner0, Amount :: from_tokens ( 100 ) , Amount :: from_tokens ( 100 ) )
1920
1932
. await ?;
1921
1933
1922
- node_service_amm. process_inbox ( & chain_amm) . await ?;
1923
- node_service0. process_inbox ( & chain0) . await ?;
1934
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len( ) , 1 ) ;
1924
1935
1925
1936
// Ownership of the used owner_amm_chain's tokens should be with the AMM now
1926
1937
app_fungible0_amm
@@ -1979,8 +1990,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
1979
1990
. add_liquidity ( owner1, Amount :: from_tokens ( 120 ) , Amount :: from_tokens ( 100 ) )
1980
1991
. await ?;
1981
1992
1982
- node_service_amm. process_inbox ( & chain_amm) . await ?;
1983
- node_service1. process_inbox ( & chain1) . await ?;
1993
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
1994
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
1984
1995
1985
1996
app_fungible0_amm
1986
1997
. assert_balances ( [
@@ -2039,8 +2050,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2039
2050
. expect_err ( "Swapping from the AMM chain should fail" ) ;
2040
2051
2041
2052
app_amm1. swap ( owner1, 0 , Amount :: from_tokens ( 50 ) ) . await ?;
2042
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2043
- node_service1. process_inbox ( & chain1) . await ?;
2053
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2054
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
2044
2055
2045
2056
app_fungible0_amm
2046
2057
. assert_balances ( [
@@ -2108,8 +2119,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2108
2119
app_amm1
2109
2120
. remove_liquidity ( owner1, 0 , Amount :: from_tokens ( 500 ) )
2110
2121
. await ?;
2111
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2112
- node_service1. process_inbox ( & chain1) . await ?;
2122
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2123
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 0 ) ;
2113
2124
2114
2125
// Balances will be unaltered
2115
2126
app_fungible0_amm
@@ -2164,8 +2175,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2164
2175
. await ;
2165
2176
2166
2177
app_amm1. swap ( owner1, 1 , Amount :: from_tokens ( 40 ) ) . await ?;
2167
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2168
- node_service1. process_inbox ( & chain1) . await ?;
2178
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2179
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
2169
2180
2170
2181
app_fungible0_amm
2171
2182
. assert_balances ( [
@@ -2221,8 +2232,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2221
2232
app_amm1
2222
2233
. remove_liquidity ( owner1, 0 , Amount :: from_tokens ( 100 ) )
2223
2234
. await ?;
2224
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2225
- node_service1. process_inbox ( & chain1) . await ?;
2235
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2236
+ assert_eq ! ( node_service1. process_inbox( & chain1) . await ?. len ( ) , 1 ) ;
2226
2237
2227
2238
app_fungible0_amm
2228
2239
. assert_balances ( [
@@ -2276,8 +2287,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2276
2287
. await ;
2277
2288
2278
2289
app_amm0. swap ( owner0, 1 , Amount :: from_tokens ( 25 ) ) . await ?;
2279
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2280
- node_service0. process_inbox ( & chain0) . await ?;
2290
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2291
+ assert_eq ! ( node_service0. process_inbox( & chain0) . await ?. len ( ) , 1 ) ;
2281
2292
2282
2293
app_fungible0_amm
2283
2294
. assert_balances ( [
@@ -2331,8 +2342,8 @@ async fn test_wasm_end_to_end_amm(config: impl LineraNetConfig) -> Result<()> {
2331
2342
. await ;
2332
2343
2333
2344
app_amm0. remove_all_added_liquidity ( owner0) . await ?;
2334
- node_service_amm. process_inbox ( & chain_amm) . await ?;
2335
- node_service0. process_inbox ( & chain0) . await ?;
2345
+ assert_eq ! ( node_service_amm. process_inbox( & chain_amm) . await ?. len ( ) , 1 ) ;
2346
+ assert_eq ! ( node_service0. process_inbox( & chain0) . await ?. len ( ) , 1 ) ;
2336
2347
2337
2348
app_fungible0_amm
2338
2349
. assert_balances ( [
0 commit comments