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

Add vasil features #157

Merged
merged 50 commits into from
Nov 25, 2022
Merged

Add vasil features #157

merged 50 commits into from
Nov 25, 2022

Conversation

samuelWilliams99
Copy link
Contributor

@samuelWilliams99 samuelWilliams99 commented Nov 7, 2022

  • Updates plutus-apps to a2045141fc0b4f14470ebf4679c6abe40aac4db7
    • Alongside the many changes that required, including unfortunately introducting issues, such as timeslotconversion
  • Adds plutusV2 support all round, using the Versioned datatype
  • Adds support for creating and spending inline datums
  • Adds support for spending reference inputs (creating is identical to other inputs)
  • Adds support for creating arbitrary reference scripts, and using reference scripts ONLY FOR VALIDATORS
  • General refactors of the estimation logic, including moving the node queries about utxos, parameters, etc, to the start of balancing, rather than in a loop (CLI buildTx required utxo context). This works via the runInEstimationEffect function, which brings context we need into a state effect, and handles querying said state.
  • Had to remove mocked budget estimation from cli tests, as originally the cli filtered the inputs, now it doesn't, as it doesn't need to filter the result of the real estimation. However, tests relied on this behaviour to mock those. For now, all budget estimations in the tests are 0,0 (as they were with minting already).
  • Add BPI Constraints for above timeslotconversion fix
  • Fix partial signing behaviour, for Orcfax
  • Add back metadata! 🎉 (this time to bpi constraints, so no forked plutus-apps)
  • Change make lint to run hlint --refactor on each file using apply-refact

@samuelWilliams99 samuelWilliams99 added the enhancement New feature or request label Nov 7, 2022
@samuelWilliams99
Copy link
Contributor Author

I won't yet be merging master into this branch, as significant changes have occured, and I want this working first.

Copy link
Member

@t4ccer t4ccer left a comment

Choose a reason for hiding this comment

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

Nothing regarding business logic! Just some styleguide/best practices stuff

@t4ccer
Copy link
Member

t4ccer commented Nov 16, 2022

Fix required checks in GH branch protection settings

@samuelWilliams99
Copy link
Contributor Author

@t4ccer I will make those branch protection fixes when I merge, as to not confuse other PRs

Copy link
Member

@t4ccer t4ccer left a comment

Choose a reason for hiding this comment

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

Looks great! Disclaimer: I've not ran this code

Eff effs (Either (FileError ()) Text)
writeMetadataFile pabConf metadata =
let filepath = metadataFilePath pabConf metadata
in fmap (const filepath) <$> writeFileRaw @w (Text.unpack filepath) metadata
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
in fmap (const filepath) <$> writeFileRaw @w (Text.unpack filepath) metadata
in (filepath <$) <$> writeFileRaw @w (Text.unpack filepath) metadata

(shorter, but maybe less readable ¯_(ツ)_/¯)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I tend to lean towards fmap in situations like this.
theres also const filepath <<$>> ... which would work, but its a bit of an unknown operator

@@ -257,6 +309,10 @@ unDummyPrivateKey :: DummyPrivKey -> Crypto.XPrv
unDummyPrivateKey (FromSKey key) = key
unDummyPrivateKey (FromVKey key) = key

-- | Used as a signing keys for foreign signers BPI has no access to (ie. multisig schemes)
dummyXPrv :: Crypto.XPrv
dummyXPrv = generate ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" :: Base.String) ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" :: Base.String)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
dummyXPrv = generate ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" :: Base.String) ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" :: Base.String)
dummyXPrv = join generate("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" :: Base.String)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't aware join had this behaviour on functions, and im unsure how I feel about it
It feels misleading

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I actually got join from pointfree tool output myself =) I was just concerned a bit about typing exact amount of letters two times in arow - stopped to check if they are of the same length XD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think i'd rather leave as is, I might check if the passphrase input has to be the same length, as if we can change it to just "pass phrase", then this call makes more sense

@mikekeke
Copy link
Collaborator

Tremendous work 🎖️

@samuelWilliams99
Copy link
Contributor Author

Ran CI locally, all passes, merging :)

@samuelWilliams99 samuelWilliams99 merged commit a1f1d0e into master Nov 25, 2022
@samuelWilliams99 samuelWilliams99 deleted the sam/add-vasil-features branch November 25, 2022 11:30
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 this pull request may close these issues.

4 participants