Skip to content
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

feat: add address endpoint to derive #89

Closed
4 tasks
dongsam opened this issue Nov 11, 2021 · 0 comments · Fixed by #90
Closed
4 tasks

feat: add address endpoint to derive #89

dongsam opened this issue Nov 11, 2021 · 0 comments · Fixed by #90
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dongsam
Copy link
Contributor

dongsam commented Nov 11, 2021

Summary

add address query endpoint and cli for query an address that can be used as source and destination is derived according to the given name, module name, and address type.

Problem Definition

The budget source address and destination address can be used after designating an address that does not yet exist. However, since it is difficult for users to derive the address as a code, it is necessary to provide an address endpoint that can be easily derived for this purpose.

Proposal

// AddressType enumerates the available types of a address.
enum AddressType {
  option (gogoproto.goproto_enum_prefix) = false;

  // ADDRESS_TYPE_32_BYTES defines the 32 bytes length address type of ADR 028.
  ADDRESS_TYPE_32_BYTES = 0 [(gogoproto.enumvalue_customname) = "AddressType32Bytes"];
  // ADDRESS_TYPE_20_BYTES defines the default 20 bytes length address type.
  ADDRESS_TYPE_20_BYTES = 1 [(gogoproto.enumvalue_customname) = "AddressType20Bytes"];
}

// QueryAddressesRequest is the request type for the Query/Addresses RPC method.
message QueryAddressesRequest {
  // The Address Type, default 0 for ADDRESS_TYPE_32_BYTES or 1 for ADDRESS_TYPE_20_BYTES
  AddressType type = 1;
  // The module name to be used for address derivation, default is budget.
  string module_name = 2;
  // The name to be used for address derivation.
  string name = 3;
}

// QueryAddressesResponse is the response type for the Query/Addresses RPC method.
message QueryAddressesResponse {
  string address = 1;
}

Tasks

  • add proto
  • add cli query address
  • add grpc_query /cosmos/budget/v1beta1/addresses
  • update swagger and publish
  • add testcases
  • add how-to docs for cli, query

References


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant