public-awesome / cw-nfts

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

Bump cosmwasm to v1.1, tidy up dependencies, update schema, update CI #79

Closed larry0x closed 1 year ago

larry0x commented 1 year ago

Changes

- #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
- #[serde(rename_all = "snake_case")]
+ #[cw_serde]
- use serde::__private::PhantomData;
+ use std::markers::PhantomData;

I assume this is because someone used editor auto-completion for imports...

Notes

webmaster128 commented 1 year ago
  • For dependency version numbers, only keep the first two digits (e.g. v1.x.y --> v1.x). The 3rd digit marks non-breaking changes, so no need to hardcode it. Imo, better leaving it as a wildcard and let Rust compiler determine the most appropriate versions to use.

There can be good reason to do that. If you write "1.2.3" that means 1.2.0-1.2.2 are too low. Those versions might contain a bug you want to prevent in the codebase. Using 1.2 only includes those patch releases. Anyways, probably not important here.

larry0x commented 1 year ago
  • For dependency version numbers, only keep the first two digits (e.g. v1.x.y --> v1.x). The 3rd digit marks non-breaking changes, so no need to hardcode it. Imo, better leaving it as a wildcard and let Rust compiler determine the most appropriate versions to use.

There can be good reason to do that. If you write "1.2.3" that means 1.2.0-1.2.2 are too low. Those versions might contain a bug you want to prevent in the codebase. Using 1.2 only includes those patch releases. Anyways, probably not important here.

my understanding is that if i write 1.2, the compiler should automatically choose the latest, which is 1.2.3 in this example, unless there are conflicts making it unable to choose 1.2.3

webmaster128 commented 1 year ago

my understanding is that if i write 1.2, the compiler should automatically choose the latest, which is 1.2.3 in this example, unless there are conflicts making it unable to choose 1.2.3

In the average case yes. But you still get lower version if:

larry0x commented 1 year ago

my understanding is that if i write 1.2, the compiler should automatically choose the latest, which is 1.2.3 in this example, unless there are conflicts making it unable to choose 1.2.3

In the average case yes. But you still get lower version if:

  • You have 1.2.2, 1.2.1, 1.2.0 in the lockfile already
  • Some other crate pins version to e.g. "=1.2.2"

Good point, will change back

larry0x commented 1 year ago

@webmaster128 I have downgraded the Rust version used in CI to 1.60.0 and use the full version numbers (1.x.y) for dependencies