Skip to content

Commit

Permalink
Merge pull request #161 from provenance-io/kwtalley/add-metadataaddre…
Browse files Browse the repository at this point in the history
…ss-util

add MetadataAddress util for encode/decode
  • Loading branch information
kwtalley authored Sep 27, 2024
2 parents 0d5efd2 + 8314bab commit abc04ec
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Unreleased changes

* migrate to GRPC queries ([#157](https://github.com/provenance-io/provwasm/issues/157))
* add `MetadataAddress` type for encoding/decoding metadata
addresses ([#161](https://github.com/provenance-io/provwasm/pull/161))

## Releases

Expand Down
2 changes: 2 additions & 0 deletions RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### [v2.4.0](https://github.com/provenance-io/provwasm/tree/v2.4.0)

* migrate to GRPC queries ([#157](https://github.com/provenance-io/provwasm/issues/157))
* add `MetadataAddress` type for encoding/decoding metadata
addresses ([#161](https://github.com/provenance-io/provwasm/pull/161))
4 changes: 2 additions & 2 deletions contracts/marker/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Marker {
pub struct MarkAccount {
pub base_account: Option<String>,
pub manager: String,
pub demon: String,
pub denom: String,
pub supply: String,
}

Expand All @@ -20,7 +20,7 @@ impl From<MarkerAccount> for MarkAccount {
MarkAccount {
base_account: value.base_account.unwrap().address.into(),
manager: value.manager,
demon: value.denom.to_string(),
denom: value.denom.to_string(),
supply: value.supply.to_string(),
}
}
Expand Down
17 changes: 1 addition & 16 deletions contracts/name/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::{cw_serde, QueryResponses};
use provwasm_std::types::provenance::name::v1::{QueryResolveResponse, QueryReverseLookupResponse};
use provwasm_std::types::provenance::name::v1::QueryReverseLookupResponse;

#[cw_serde]
pub struct InitMsg {
Expand All @@ -23,21 +23,6 @@ pub enum QueryMsg {
Params {},
}

#[cw_serde]
pub struct ResolveResponse {
address: String,
restricted: bool,
}

impl From<QueryResolveResponse> for ResolveResponse {
fn from(value: QueryResolveResponse) -> Self {
ResolveResponse {
address: value.address,
restricted: value.restricted,
}
}
}

#[cw_serde]
pub struct LookupResponse {
pub name: Vec<String>,
Expand Down
7 changes: 6 additions & 1 deletion packages/provwasm-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,20 @@ keywords = ["provenance", "blockchain", "smart-contracts", "defi", "finance"]
categories = ["api-bindings", "cryptography::cryptocurrencies", "wasm"]

[dependencies]
base64 = "0.22.1"
bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] }
chrono = { version = "0.4.24", default-features = false }
cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
hex = { version = "0.4.3", default-features = false }
prost = { workspace = true, default-features = false, features = ["prost-derive"] }
prost-types = { workspace = true, default-features = false }
provwasm-common = { workspace = true }
provwasm-proc-macro = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, default-features = false, features = ["derive"] }
serde-cw-value = "0.7.0"
base64 = "0.22.1"
sha2 = { version = "0.10.8", default-features = false }
strum_macros = "0.26.4"
thiserror = { workspace = true }
uuid = { version = "1.10.0", default-features = false }
2 changes: 1 addition & 1 deletion packages/provwasm-std/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// The version (commit hash) of the Cosmos SDK used when generating this library.
pub const PROVENANCE_VERSION: &str = include_str!("types/PROVENANCE_COMMIT");

// mod serde;
pub mod metadata_address;
pub mod shim;
#[allow(
deprecated,
Expand Down
Loading

0 comments on commit abc04ec

Please sign in to comment.