Skip to content

feat: adjust etna builder props #882

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

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Conversation

erictaylor
Copy link
Member

@erictaylor erictaylor commented Oct 11, 2024

This pull request includes several changes to the src/vms/pvm/etna-builder/builder.ts file and its related test files. The primary focus is on refactoring the code to replace the usage of SpendOptions with individual parameters and improving code readability. Additionally, a minor typo was corrected in src/vms/common/models.ts.

Changes

  1. Removal of spendOptions prop.
  2. Add changeAddressesBytes common builder prop. Defaults to use the fromAddressesBytes.
  3. Add memo common builder prop. Defaults to empty Uint8Array.
  4. Add minIssuanceTime common builder prop. Defaults to current unix time in seconds.
  5. Renamed newImportTx toAddresses prop to toAddressesBytes.

Migration

  • spendOptions.changeAddresses -> changeAddressesBytes.
  • spendOptions.memo -> memo.
  • spendOptions.minIssuanceTime -> minIssuanceTime.
  • On import tx's toAddresses -> toAddressesBytes.

Any usage of spendOptions.locktime or spendOptions.threshold need removed. Those props didn't do anything in the builder, and therefore caused confusion.

Copy link
Collaborator

@rictorlome rictorlome left a comment

Choose a reason for hiding this comment

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

I am good with this for now. I think, per our conversation with @bferenc , we might want to actually make use of the threshold and locktime, but that can be a follow up.
Also left a question regarding duplication of changeOutput parameters.

@erictaylor erictaylor requested a review from rictorlome October 14, 2024 20:21
Copy link
Collaborator

@rictorlome rictorlome left a comment

Choose a reason for hiding this comment

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

lgtm

@erictaylor erictaylor merged commit ad65b27 into master Oct 14, 2024
3 checks passed
@erictaylor erictaylor deleted the erictaylor/etna-builder-props branch October 14, 2024 20:37
github-actions bot pushed a commit that referenced this pull request Nov 22, 2024
# [4.1.0](v4.0.5...v4.1.0) (2024-11-22)

### Bug Fixes

* add .getSigIndices() for DisableL1ValidatorTx ([ac7e0d7](ac7e0d7))
* add missing L1Validator props ([b31f376](b31f376))
* address review feedback and fix adding stakeouts ([94e1361](94e1361))
* burn amount validation for new tx types ([d54bb02](d54bb02))
* change minDelegatorStake to uint64 ([#903](#903)) ([1ecf74e](1ecf74e))
* complexity calculations and associated tests ([0e90227](0e90227))
* convertsubnettx types ([811304b](811304b))
* export PChainOwner and ConvertSubnetValidator ([ba50da3](ba50da3))
* expose calculateFee ([#910](#910)) ([7900273](7900273))
* network id type error ([0ad71b1](0ad71b1))
* only allow AVAX assets on importtx ([141294d](141294d))
* remove etna builder minPrice usage and update examples ([#881](#881)) ([5b7868a](5b7868a))
* typo in upgrades type ([db80e73](db80e73))
* usable unlocked utxos ([6f2979f](6f2979f))

### Features

* add .getL1Validator() to P-Chain api ([cc4574c](cc4574c))
* add `DisableSubnetValidatorTx` and `SetSubnetValidatorWeightTx` ([#890](#890)) ([d80b456](d80b456))
* add convertSubnetValidator tests and fix for passing ([c69e1e6](c69e1e6))
* add etna builder spend logic ([12dcdef](12dcdef))
* add fee calculator ([2651bf5](2651bf5))
* add getsubnet api endpoint ([#920](#920)) ([0b4eb57](0b4eb57))
* add info.getEtnaTime and pvm.getFeeConfig api ([86bf791](86bf791))
* add new etna experimental spend ([8007fa1](8007fa1))
* add new etnaBuilder for p-chain ([d485942](d485942))
* add nodePOP to GetNodeIdResponse" ([#893](#893)) ([11bcd3b](11bcd3b))
* add p-chain auth complexity ([b64d15a](b64d15a))
* add p-chain etna examples ([36dd950](36dd950))
* add platform.getFeeState and update etna builder ([#879](#879)) ([47f216e](47f216e))
* add pvm builder complexity logic ([03bb77a](03bb77a))
* add RegisterSubnetValidatorTx ([#891](#891)) ([2746ee8](2746ee8))
* add txComplexity ([eb04ec9](eb04ec9))
* add validateAvaxBurnedAmountEtna ([b685484](b685484))
* adjust etna builder props ([#882](#882)) ([ad65b27](ad65b27))
* adjust validateBurnedAmount params ([e071a75](e071a75))
* base pvm complexity fns ([bba2054](bba2054))
* breakout spend reducers filters ([61946ff](61946ff))
* convertSubtnetTx ([6bba3b3](6bba3b3))
* etna builder wrap up bug fixes and tests ([5e6ce59](5e6ce59))
* etna-builder fixes and more tests ([62cabd2](62cabd2))
* expose new etna builder via experimental exports ([d4c5c0d](d4c5c0d))
* implement IncreaseBalanceTx ([683b56f](683b56f)), closes [#888](#888) [#873](#873)
* opt-in consolidate outputs ([7183cfe](7183cfe))
* pass gasPrice and weights as part of feeConfig into txBuilder ([dd6c8fe](dd6c8fe))
* refactor for ACP-77 nomenclature ([a18fbff](a18fbff))
* spend reducers and tests ([0fe9515](0fe9515))
* spend reducers and tests ([4a29afc](4a29afc))
* update acp-103 complexities ([#919](#919)) ([7fca80c](7fca80c))
* update getUpgradesInfo function name ([ee3029a](ee3029a))
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