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/198 construction derive staking support #207

Merged
merged 22 commits into from Nov 11, 2020

Conversation

tomasBustamante
Copy link
Contributor

Description

Endpoint /construction/derive now supports the creation of Base and Reward addresses besided the already supported Enterprise address.

Proposed Solution

The staking key and the address type are provided as optional parameters in the metadata.

The controller does some basic validation and the service does the actual construction based on the following:

  • Base address: if address type is 'Base' and both the public key and the staking keys are provided.
  • Reward address: if address type is 'Reward' (the required public key is the only needed).
  • Enterprise address: if address type is 'Enterprise' or no type at all (default scenario).

References

Closes #198

@tomasBustamante tomasBustamante force-pushed the feat/198-construction-derive-staking-support branch from 0d14712 to 1b122be Compare November 6, 2020 06:51
@tomasBustamante tomasBustamante force-pushed the feat/198-construction-derive-staking-support branch 2 times, most recently from 4040531 to 4f1849d Compare November 11, 2020 13:15
AlanVerbner
AlanVerbner previously approved these changes Nov 11, 2020
Copy link
Contributor

@AlanVerbner AlanVerbner left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Contributor

@AlanVerbner AlanVerbner left a comment

Choose a reason for hiding this comment

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

lgtm

@tomasBustamante tomasBustamante merged commit fabc859 into master Nov 11, 2020
AlanVerbner pushed a commit that referenced this pull request Nov 28, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
AlanVerbner pushed a commit that referenced this pull request Dec 2, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
rhyslbw pushed a commit that referenced this pull request Dec 4, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
AlanVerbner pushed a commit that referenced this pull request Dec 7, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
@AlanVerbner AlanVerbner deleted the feat/198-construction-derive-staking-support branch December 7, 2020 19:40
AlanVerbner pushed a commit that referenced this pull request Dec 8, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
AlanVerbner pushed a commit that referenced this pull request Dec 11, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
AlanVerbner pushed a commit that referenced this pull request Dec 11, 2020
* feat: add staking_credential and address_type in ConstructionDeriveRequest

* refactor: move staking_credential and address_type into metadata of ConstructionDeriveRequest

* feat: add invalid address type error

* feat: add metadata validation in construction derive controller

* refactor: generatePayload parameters in construction derive tests

* test: construction derive with invalid staking key

* refactor: exclude enum for address type in openApi

* test: construction derive with invalid address type

* test: construction derive for Base and Reward addresses

* feat: construction derive Base and Reward address support

* test: construction derive validation for staking key size

* test: construction derive reward address correct bech32 address

* fix: correct address prefix for reward address creation

* refactor: move UTxOAddressTypes enum to constants file

* refactor: rename UTxOAddressType and make Enterprise default value

* refactor: add comment for staking address prefix

* test: add comments to construction derive tests

* refactor: use proper error for invalid staking key

* test: construction derive error when no staking key for base address

* feat: missing staking key validation for base address generation

* refactor: rename AddressType

* refactor: address type description in openApi

Refs #198
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.

/construction/derive staking support
2 participants