-
Notifications
You must be signed in to change notification settings - Fork 105
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 remix #163
Add remix #163
Conversation
What is remix? And based off of the conversation we had with Dete about how we want to do composable features in the future, I would potentially think about doing upgrades with new contracts instead of adding a feature with a change to the existing contract |
A remix is similar in intent to traditional sports trading card parallels. |
contracts/TopShot.cdc
Outdated
@@ -1152,6 +1240,185 @@ pub contract TopShot: NonFungibleToken { | |||
} | |||
} | |||
|
|||
// getMomentsSubedition function that return's wich Subedition the Moment belongs to |
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.
getMomentsSubedition returns the Subedition the Moment belongs to
@@ -0,0 +1,21 @@ | |||
import TopShot from 0xTOPSHOTADDRESS | |||
|
|||
// This transaction is for the admin to create a new showcase resource |
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.
Probably should update comment to indicate it's creating a subedition admin resource
@anatoly256 @jrkhan is this ready for a review again? |
Should be ready to review. |
lib/go/test/subedition_test.go
Outdated
|
||
// This test tests the pure functionality of the smart contract | ||
func TestSubeditions(t *testing.T) { | ||
b := newBlockchain() |
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.
Recently added a few helpers that should make this a bit less verbose to setup - take a look at NewTopShotTestBlockchain in topshot_test
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.
Going to deploy this to testnet to give us a window to start testing contract changes
contracts/TopShot.cdc
Outdated
@@ -94,6 +94,10 @@ pub contract TopShot: NonFungibleToken { | |||
// Emitted when a Moment is destroyed | |||
pub event MomentDestroyed(id: UInt64) | |||
|
|||
pub event SubeditionCreated(id: UInt32, name: String, metadata: {String:String}) |
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.
It isn't clear to me what the ID represents, considering you use subeditionID
in the next event. Does it represent the subedition ID? Shouldn't we also have the play and set IDs in the event?
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.
Agree with consistent/more specific name for id.
In the current iteration, the subedition is intended to be reused across many sets/plays. (This will make it much easier to search for all 'diamond' moments if they share an id) -> so subedition created event will not have a set/play as the subedition itself does not have a set/play.
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.
pub event SubeditionCreated(id: UInt32, name: String, metadata: {String:String}) | |
pub event SubeditionCreated(subeditionID: UInt32, name: String, metadata: {String:String}) |
* Add remix (#163) * add remix to contracts * add remix to transactions * add remix to lib * fix misprints * add function to get moment's subedition * fix tests * fix tests * refactor subEdition contract * add subEdition tests * add new function to create subEdition resource * add documentation * refactor SubeditionAdmin * add comments/transactions/tests * add events * Revert spacings * Fix comments * use test abstractions in subedition_test.go * fix comments * fix comments * add comment to SubeditionAdminStoragePath() * add subeditionId to MomentMinted event * change SubeditionCreated event/add length check to MintMoment event * change subeditionID to subeditionId * remove spacing changes in assets.go (#178) Co-authored-by: Jamil Khan <[email protected]>
Planning to add new resource types (subedition / subedition admin that maintains ledger of nft to subedition) to the core TopShot contract. Specifically, adding a new minting function seems to be the only way to interact with a moments serial number.
https://sketchboard.me/rDsJU4sQGlN#/
WIP
Addresses the following issue:
#164