Skip to content

Concurrent tx test #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Concurrent tx test #27

wants to merge 17 commits into from

Conversation

daveminer
Copy link
Collaborator

This PR builds upon the previous integration test PR to send the transactions concurrently from their own child processes.

This usage exposes a missing state handler, as indicated below:

|   1) test can perform basic transactions to transfer ADA (Xander.Integration.TransactionTest)
|      test/integration/transaction_test.exs:199
|      ** (EXIT from #PID<0.478.0>) exited in: :gen_statem.call(Xander.Transaction, {:request, :send_tx, "84a300d90102818258208cc2f88405991a5dfb8cb6962fe44f56510d93405cfe9ea23baf1f6bf29f301100018282583900c8c47610a36034aac6fc58848bdae5c278d994ff502c05455e3b3ee8f8ed3a0eea0ef835ffa7bbfcde55f7fe9d2cc5d55ea62cecb42bab3c1a000f424082583900627b2598dd71129167825160c564067d1d245e79cc237094815c5cb2b125e30ec2f4ce4059a069e08c3cd82cdfc9451bfb22487f8a25ceef1b0000000253f9ff13021a0002a2ada100d90102818258203942eb2689934ab474fa3d1e7246fac737c3109ff54ca5cdbdb410b9df64783558403aed4cb009022d431f7d19075d9d710204017084cf19fa283e4ed4d258fef27b4b8d4e0b02565d76077f73f582b80da9acbe5e1f9c6a7830820f83115dd39909f5f6"}, :infinity)
|          ** (EXIT) an exception was raised:
|              ** (FunctionClauseError) no function clause matching in Xander.Transaction.busy/3
|                  (xander 0.1.1) lib/xander/transaction.ex:187: Xander.Transaction.busy({:call, {#PID<0.497.0>, #Reference<0.2528737271.2400976902.151132>}}, {:request, :send_tx, "84a300d9010281825820dc0d0d0a13e683e443c575147ec12136e5ac6a4f994cd4189d4d25bed541c44d00018282583900ca6e1b1f320d543a24adeabc0aa4627635c7349b639f86f74bdfdd78d31b28c9619a58b3792a7394ab85deb36889c4d7b0632c8167b855d21a000f4240825839004048ff89ca4f88e66598e620aa0c7128c2145d9a181ae9a4a81ca8e3e849af38840c5562dd382be37c9e76545c8191f9d8f6df1d20cfcee01b0000000253f9ff13021a0002a2ada100d90102818258202edaddc3c4b97521d40fb9464074c079ba0f0968c718c4d2132d94ea96dbaa4858400c821ac15dc9097f5016fb8b46b300579e3e868fcdbb00888f8a5e14853ab3c1b7f452aac3a08214e2b7b4aee4d3ab08a3b9ac0fda1ec73ae9b6b3165f452e09f5f6"}, %Xander.Transaction{client: :gen_tcp, path: {:local, "/root/.yaci-cli/local-clusters/default/node/node.sock"}, port: 0, socket: #Port<0.35>, network: :yaci_devkit, queue: {[{{#PID<0.496.0>, #Reference<0.2528737271.2400976902.151131>}, "84a300d90102818258206d36c0e2f304a5c27b85b3f04e95fc015566d35aef5f061c17c70e3e8b9ee508000182825839004048ff89ca4f88e66598e620aa0c7128c2145d9a181ae9a4a81ca8e3e849af38840c5562dd382be37c9e76545c8191f9d8f6df1d20cfcee01a000f424082583900c8c47610a36034aac6fc58848bdae5c278d994ff502c05455e3b3ee8f8ed3a0eea0ef835ffa7bbfcde55f7fe9d2cc5d55ea62cecb42bab3c1b0000000253f9ff13021a0002a2ada100d90102818258206ea31d27d585439ea8fd9cd8e6664ed83e605c06aec24d32dfaba488e49287d95840ac09a62ec5381634370d79df10bc05242f39fff1c02845a9ae3f0056a4d9499740b3c8ab2b35302431e407efd091e6277bed1f5c1acd6455dd356002cd17450af5f6"}], []}})
|                  (stdlib 5.2.3.3) gen_statem.erl:1395: :gen_statem.loop_state_callback/11
|                  (stdlib 5.2.3.3) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
| 

tasks =
Enum.map(signed_transactions, fn {index, tx_cbor, tx_signed} ->
Task.async(fn ->
case :gen_statem.call(Xander.Transaction, {:request, :send_tx, tx_cbor}) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why the code here needs to be different from Xander.Transaction.send(tx_cbor) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants