Anoma.Node.Examples.EIntentPool (Anoma v0.29.0)
I contain several examples on how to run the intent pool.
Summary
Functions
I check that when an intent is added to the pool, is is present in the mapset.
I submit a transaction containing a nullifier to an ephemeral resource used in a trivial swap transaction.
I check that adding an intent with nullifiers already known in the nlfs_set does not add the intent to the pool.
I check that adding an intent with commitments already known in the state does not add the intent to the pool.
I check that the intent pool returns an empty map of intents when its started.
I submit a commitment event to the node.
I submit a nullifier event to the node.
I add and remove an intent from the pool and ensure that it's actually gone.
I use add_intent_transaction_nullifier
and then execute the trivial
swap.
Functions
add_intent(enode \\ ENode.start_node())
@spec add_intent(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I check that when an intent is added to the pool, is is present in the mapset.
add_intent_transaction_nullifier(enode \\ ENode.start_node())
@spec add_intent_transaction_nullifier(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I submit a transaction containing a nullifier to an ephemeral resource used in a trivial swap transaction.
add_intent_with_known_nullifiers(enode \\ ENode.start_node())
@spec add_intent_with_known_nullifiers(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I check that adding an intent with nullifiers already known in the nlfs_set does not add the intent to the pool.
add_intent_with_submitted_commitments(enode \\ ENode.start_node())
@spec add_intent_with_submitted_commitments(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I check that adding an intent with commitments already known in the state does not add the intent to the pool.
intents_are_written(enode \\ ENode.start_node())
list_intents(enode \\ ENode.start_node())
@spec list_intents(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I check that the intent pool returns an empty map of intents when its started.
new_commitments_event(enode \\ ENode.start_node(), cms_set \\ MapSet.new())
@spec new_commitments_event(Anoma.Node.Examples.ENode.t(), MapSet.t()) :: Anoma.Node.Examples.ENode.t()
I submit a commitment event to the node.
new_nullifiers_event(enode \\ ENode.start_node(), nlfs_set \\ MapSet.new())
@spec new_nullifiers_event(Anoma.Node.Examples.ENode.t(), MapSet.t()) :: Anoma.Node.Examples.ENode.t()
I submit a nullifier event to the node.
remove_intent(enode \\ ENode.start_node())
@spec remove_intent(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I add and remove an intent from the pool and ensure that it's actually gone.
remove_intents_with_nulllified_resources(enode \\ ENode.start_node())
@spec remove_intents_with_nulllified_resources(Anoma.Node.Examples.ENode.t()) :: Anoma.Node.Examples.ENode.t()
I use add_intent_transaction_nullifier
and then execute the trivial
swap.
The nullifier of the ephemeral resource used gets trasmitted to the intent pool, hence removing the specified intent from the pool.