Skip to content

Commit

Permalink
bump optimizer version (#270)
Browse files Browse the repository at this point in the history
* bump optimizer version

* bump version

* fix linter
  • Loading branch information
jhernandezb authored Nov 24, 2022
1 parent d7f3e72 commit ee92804
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
- run:
name: Build development contracts
command: |
docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.12.7
docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.12.9
docker cp with_code:/code/artifacts ./artifacts
- run:
name: Show data
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/marketplace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sg-marketplace"
version = "1.1.0"
version = "1.2.0"
authors = [
"Shane Vitarana <s@noreply.publicawesome.com>",
"Jake Hartnell <jake@publicawesome.com>",
Expand Down
20 changes: 9 additions & 11 deletions contracts/marketplace/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ pub fn execute_set_ask(
};
}

let mut reserve_for_str = "".to_string();
let mut event = Event::new("set-ask")
.add_attribute("collection", collection.to_string())
.add_attribute("token_id", token_id.to_string())
.add_attribute("sale_type", sale_type.to_string());

if let Some(address) = reserve_for.clone() {
if address == info.sender {
return Err(ContractError::InvalidReserveAddress {
Expand All @@ -312,13 +316,13 @@ pub fn execute_set_ask(
reason: "can only reserve for fixed_price sales".to_string(),
});
}
reserve_for_str = address.to_string()
event = event.add_attribute("reserve_for", address.to_string());
}

let seller = info.sender;
let ask = Ask {
sale_type: sale_type.clone(),
collection: collection.clone(),
sale_type,
collection,
token_id,
seller: seller.clone(),
price: price.amount,
Expand All @@ -338,17 +342,11 @@ pub fn execute_set_ask(

let hook = prepare_ask_hook(deps.as_ref(), &ask, HookAction::Create)?;

let mut event = Event::new("set-ask")
.add_attribute("collection", collection.to_string())
.add_attribute("token_id", token_id.to_string())
.add_attribute("sale_type", sale_type.to_string())
event = event
.add_attribute("seller", seller)
.add_attribute("price", price.to_string())
.add_attribute("expires", expires.to_string());

if !reserve_for_str.is_empty() {
event = event.add_attribute("reserve_for", reserve_for_str);
}
Ok(res.add_submessages(hook).add_event(event))
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/optimize.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker run --rm -v "$(pwd)":/code --platform linux/amd64 \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer:0.12.7
cosmwasm/workspace-optimizer:0.12.9

0 comments on commit ee92804

Please sign in to comment.