public-awesome / cw-nfts

Examples and helpers to build NFT contracts on CosmWasm
Apache License 2.0
185 stars 181 forks source link

Delete `MintMsg` #104

Closed larry0x closed 1 year ago

larry0x commented 1 year ago

Current:

enum ExecuteMsg<T> {
    Mint(MintMsg<T>),
}

struct MintMsg<T> {
    pub token_id: String,
    pub owner: String,
    pub token_uri: Option<String>,
    pub extension: T,
}

New:

enum ExecuteMsg {
    Mint {
        token_id: String,
        owner: String,
        token_uri: Option<String>,
        extension: T,
    },
}

This is backward compatible because ExecuteMsg serializes to the same JSON.

larry0x commented 1 year ago

Would love to know your thoughts on this design decision @shanev @jhernandezb @0xekez

0xekez commented 1 year ago

i'm pro. will need to update a couple contracts if we land this, but that's fine. forward!

larry0x commented 1 year ago

@JakeHartnell do you know why CI doesn't run?

yubrew commented 1 year ago

In the new version does ExecuteMsg still need <T>?

enum ExecuteMsg {
    Mint {
        token_id: String,
        owner: String,
        token_uri: Option<String>,
        extension: T,
    },
}
larry0x commented 1 year ago

In the new version does ExecuteMsg still need <T>?

enum ExecuteMsg {
    Mint {
        token_id: String,
        owner: String,
        token_uri: Option<String>,
        extension: T,
    },
}

T is for the extension data, for example cw-metadata-onchain puts the metadata in the extension.

JakeHartnell commented 1 year ago

Not sure what's up with CI, but ran all checks locally, and we should be good. Thanks for this @larry0x!