-
Notifications
You must be signed in to change notification settings - Fork 1
Tests #41
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
Tests #41
Conversation
Stake keys aren't provided by plutip so the mintCnft contract fails, but the plutip test environment is working
This is broken until the slot length issue is addressed: Plutonomicon/cardano-transaction-lib#868 However, hacking a local CTL clone to hardcode the right slot length allows these tests to run properly
…rice" This reverts commit 4fcdaf8.
We were already checking for total correct payment, but now we check for the specific payment utxos with the correct amounts and datum
Can we get the other checks fixed? Theres some warnings about imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres a lot of code here that should definitely be generalised, have you spoke to the CTL guys about getting this added somewhere?
Right now I think we have to wait for Plutonomicon/cardano-transaction-lib#906, it's making some fairly big changes that we'll need, after that I'll go through and make sure all the checks are passing
Just made an issue: Plutonomicon/cardano-transaction-lib#948 |
@samuelWilliams99 This should be ready for merge now. One thing though is that the plutip tests take ~15 minutes to run: https://ci.staging.mlabs.city/build/261068. For local development this isn't a big issue since you can run only some tests and skip others, but it's probably not great for CI. I don't think there's much we can do about it right now, but if it's an issue I can make an issue and bring it up to the CTL team |
Looks good to me :D |
Closes #32
getTxByHash
is having trouble parsing metadata, I'll link an issue here once it gets created, for now the discussion is limited to slacksetSeabugMetadata
call to run the tests, that's how I've been testing my testschangeValue
is positive before calculating min ada Plutonomicon/cardano-transaction-lib#940setPrice
contract #48Minting testing
Minting testing
We test:
We also test failing transactions:
Buy testing
Buy Testing
For each of the below test cases, we check:
retBehaviour
mpExpectedLoss
buyerExpectedLoss
Test cases:
Buyer not paying full price
buyerExpectedLoss
andmpExpectedLoss
are defined as follows:For example, given the transaction 910f14c0d53e7466f5ba7ac2e3d20a51f30344ba74808aa8ebeadf143ee7a885:
To summarize, when the sgNft is sent to the buyer, the marketplace script ends up covering tx fees, and the remainder from the marketplace utxo goes towards funding the min ada required for the buyer's nft utxo, which leads to the buyer paying less than the full price after accounting for the nft utxo