Skip to content

Conversation

samuelWilliams99
Copy link
Contributor

No description provided.

nrutledge and others added 30 commits May 19, 2022 00:11
The patch branch is based off the previous commit with
Plutonomicon/cardano-transaction-lib@f5785cd
applied

The use of `/\` in an instance declaration was causing an invalid string literal
in the output JS, something like "toMetadataArray/\"
Fix logLevel issue and add fd to nix develop (require for seabug build)
transactionId = byteArrayToHex $ unwrap input.transactionId
inputIndex = UInt.toInt input.index
address = addressBech32 output.address
-- TODO: What do we do if this fails?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting issue - can only occur if the NftResult passed in is malformed, which is built from a real transaction.
We could return an error? but the only way this would break is if you intentionally broke it.

Copy link
Contributor

Choose a reason for hiding this comment

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

We could return an empty string like we're doing with dataHash. This could be acceptable if the only plans for using this field are to show it in the frontend.

I also don't see anywhere this is actually used in the frontend (besides a mock in a test), so we could just remove it, unless there are plans to use it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets leave as is for now, get a ticket up, I'll check with Neil

marketplaceShareValidated <- natToShare nftCollection.daoShare
setTxMetadata tx $ SeabugMetadata
{ policyId
, mintPolicy: mempty
Copy link
Contributor Author

Choose a reason for hiding this comment

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

#13

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can just hardcode something like "V1" for now? Not sure what the best solution is in the long term, maybe some kind of environment file and passing config from there, like we're doing with projectId

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 imagine eventually we'll need a mapping from the various versions to unapplied scripts, we can do V1 for now.


instance ToData SeabugMetadataDelta where
toData (SeabugMetadataDelta meta) = unsafePartial $ toData $ AssocMap.Map
[ unsafeMkKey "727" /\ AssocMap.Map
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 believe the key for delta was supposed to be 727d? Unsure if this is permitted in the metadata standard, but it certainly shouldn't be the same as the full metadata, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Afaict the closest we have to a standard is https://developers.cardano.org/docs/transaction-metadata/, and that won't allow it. Idk what we should change it to though, 728? 727D from base 16 to base 10? I was also hearing something about a new whitepaper for seabug, maybe we can follow that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was over a week ago, lets ask directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got no reply, we can leave as is for now since we're not using the delta.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's permitted but using 727d would save onchain space. Not sure if we're capable of parsing delta metadata now though so lets stick with it

@samuelWilliams99
Copy link
Contributor Author

@rynoV The changes required here will be your next task

@rynoV rynoV linked an issue Jul 26, 2022 that may be closed by this pull request
@rynoV
Copy link
Contributor

rynoV commented Jul 27, 2022

Also removed the unneccessary minAdaVal from the buy contract, this transaction tested that it wasn't necessary, seems like CTL handles it properly

@rynoV
Copy link
Contributor

rynoV commented Jul 27, 2022

@samuelWilliams99
Copy link
Contributor Author

I love that you're able to get these transactions up so quickly, such a difference to when we used BPI

@samuelWilliams99
Copy link
Contributor Author

Once CI passes, we'll merge :)

@rynoV rynoV merged commit 23f49cf into master Jul 27, 2022
@KindaSloth KindaSloth mentioned this pull request Aug 17, 2022
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.

Remove some debug logs Integrate with frontend following CTL update + script parameterisation

5 participants