Anoma.Node.Examples.EGRPC (Anoma v0.32.0)

I contain examples to test the GRPC endpoint of the node.

Summary

Types

t()

I am the state of a GRPC connection to the node.

Functions

I add an intent to the client.

I make a request to add an intent, but without an intent.

I add a transaction to the client.

Given an enode, I connect to its GRPC endpoint.

I list the intents over grpc on the client.

I list the intents over grpc on the client and expect a failure by not providing a node id.

I list the intents over grpc on the client, but I provide a wrong node id.

Types

@type t() :: %Anoma.Node.Examples.EGRPC{
  channel: any() | nil,
  node: Anoma.Node.Examples.ENode.t() | nil
}

I am the state of a GRPC connection to the node.

Fields

  • :channel - The channel for making grpc requests.
  • :node - The node to which the client is connected.

Functions

Link to this function

add_intent(client \\ connect_to_node())

@spec add_intent(t()) :: boolean()

I add an intent to the client.

Link to this function

add_intent_fail_no_intent(client \\ connect_to_node())

I make a request to add an intent, but without an intent.

I expect an error to occur.

Link to this function

add_transaction(client \\ connect_to_node())

@spec add_transaction(t()) :: t()

I add a transaction to the client.

Link to this function

connect_to_node(enode \\ nil)

@spec connect_to_node(Anoma.Node.Examples.ENode.t() | nil) :: t()

Given an enode, I connect to its GRPC endpoint.

The examples in this file are used to test against the client GRPC endpoint. The client needs a node to process incoming requests (except prove), so a node is also required to run these examples.

Link to this function

list_intents(client \\ connect_to_node())

@spec list_intents(t()) :: boolean()

I list the intents over grpc on the client.

Link to this function

list_intents_fail(client \\ connect_to_node())

@spec list_intents_fail(t()) :: boolean()

I list the intents over grpc on the client and expect a failure by not providing a node id.

Link to this function

list_intents_invalid_node(client \\ connect_to_node())

@spec list_intents_invalid_node(t()) :: boolean()

I list the intents over grpc on the client, but I provide a wrong node id.