GithubHelp home page GithubHelp logo

cw-minus's Introduction

CosmWasm Minus

CircleCI

Utilities Crates.io Docs Coverage
cw-utils cw-utils on crates.io Docs codecov
cw-controllers cw-controllers on crates.io Docs codecov
cw2 cw2 on crates.io Docs codecov

Note: cw2 and controllers have been moved from the cw-plus repo. Their commit history and changelog can be found in the previous repository.

Generating changelog

To generate a changelog we decided to use github-changelog-generator.

To install tool you need Ruby's gem package manager.

$ gem --user install github_changelog_generator

And put $HOME/.gem/ruby/*/bin/ into your PATH.

Generating changelog file first time:

$ github_changelog_generator -u CosmWasm -p cw-plus

Appending next releases could be done adding --base flag:

$ github_changelog_generator -u CosmWasm -p cw-plus --base CHANGELOG.md

If you hit GitHub's 50 requests/hour limit, please follow this guide to create a token key which you can pass using --token flag.

There's also a convenience scripts/update_changelog.sh, which can take a --since-tag parameter (to avoid processing the entire history). It can also auto-detect the latest version tag for you, with --latest-tag.

Licenses

This repo is licensed under Apache 2.0.

cw-minus's People

Contributors

0xekez avatar chipshort avatar ethanfrey avatar hashedone avatar jawoznia avatar kulikthebird avatar larry0x avatar marcelmws avatar maurolacy avatar orkunkl avatar the-frey avatar ueco-jb avatar uint avatar webmaster128 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cw-minus's Issues

cw2: Move cw-storage-plus to [dev-dependencies]

In the future there can be contracts that do not use cw-storage-plus but still require cw2. To prepare for that we should try to remove the dependency on cw-storage-plus at runtime. The crate is designed to be simple enough to use raw storage access an manual deserialization. The storage key is always 636F6E74726163745F696E666F which can be hardcoded.

Keeping cw-storage-plus in [dev-dependencies] would allow us to check if cw2 writes an cw_store_plus::Item compatible storage entry or is able to read data written by cw_store_plus::Item.

Release 2.0.0-beta

This issue should prepare cw-utils repo for a 2.0 release. Before it happen we should prepare a prerelease version 2.0.0-beta in order to properly integrate it with the dependent crates before the final 2.0 release.

Deprecate and remove cw_utils::Event

It's unclear to me why this exists. Maybe from a time before we added the cosmwasm_std::Event. I can't see how this is useful today. If someone knows, please comment here.

/// This defines a set of attributes which should be added to `Response`.
pub trait Event {
    /// Append attributes to response
    fn add_attributes(&self, response: &mut Response);
}

Thoughts on adding deadline wrapper?

interested to hear thoughts about this wrapper to live in cw-utils.

#[cw_serde]
#[serde(untagged)]
pub enum Deadline {
    Expiration(Expiration),
    Duration(Duration),
}

impl Default for Deadline {
    fn default() -> Self {
        Deadline::Expiration(Expiration::default())
    }
}

impl Deadline {
  pub fn into_expiration(self, block: &BlockInfo) -> Expiration {
    match self {
      Deadline::Expiration(expiration) => expiration,
      Deadline::Duration(duration) => duration.after(block)
    }
  }
}

The main idea here is to export a wrapper that can accept either Expiration or a Duration, and turns it into an Expiration.

The main benefit is that it removes all custom logic that a contract need to handle both cases if a contract wants to accept either one of the options.

Example:

Looking at cw721 ExecuteMsg::Approve:

Approve {
    spender: String,
    token_id: String,
    expires: Option<Expiration>,
},

can be turned into:

Approve {
    spender: String,
    token_id: String,
    expires: Deadline, // or  Option<Deadline>,
},

In contract, we can easily turn deadline into expiration:

let expiration = expires.into_expiration(&env.block)

Or using an optional Deadline

let expiration = expires.unwrap_or_default().into_expiration(&env.block)

Now the user can specify either a specific block/time or some random duration

NOTE:

The #[serde(untagged)] here is to provide a nicer UI, should work nicely given untagged should be supported now and Expiration and Duration enums doesn't have an overlapping values.

Bump cosmwasm-std to ^1.1.8

and remove those dependencies:

# We don't use the following dependencies directly. They're dependencies of our dependencies.
# We specify them to tighten their version requirements so that builds with `-Zminimal-versions` work.
# Once we bump `cosmwasm-*` deps to a version after `1.1.5`, we can remove these.
k256 = { version = "0.11.1", features = ["ecdsa"] }
anyhow = "1.0.41"

and

# We don't use the following dependencies directly. They're dependencies of our dependencies.
# We specify them to tighten their version requirements so that builds with `-Zminimal-versions` work.
# Once we bump `cosmwasm-*` deps to a version after `1.1.5`, we can remove these.
serde_json = "1.0.40"

Unify workspace version

Some crates were moved from cw-plus to cw-minus and there was a decision to keep a single CHANGELOG for whole the workspace. In such a case all the crates should have the same version. The best way to unify it is to bump cw2 and cw-controllers to the current version of cw-utils.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.