Skip to content

Commit

Permalink
fix: test suite and fix listing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bufo24 committed Aug 9, 2023
1 parent 23e5c36 commit 1de00b7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cep78/deploy
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
casper-client put-deploy \
--node-address http://65.108.2.46:7777 \
--node-address https://us-central1-abiding-arch-334410.cloudfunctions.net/cspr_testnet \
--chain-name casper-test \
--secret-key ~/Downloads/BitHotel_secret_key.pem \
--payment-amount 350000000000 \
--session-path ../target/wasm32-unknown-unknown/release/cep78.wasm \
--session-arg "collection_name:string='Bit Hotel 5'" \
--session-arg "collection_name:string='BitHotel5'" \
--session-arg "collection_symbol:string='BTH5'" \
--session-arg "total_token_supply:u64='100'" \
--session-arg "ownership_mode:u8='2'" \
Expand All @@ -14,4 +14,4 @@ casper-client put-deploy \
--session-arg "metadata_mutability:u8='1'" \
--session-arg "minting_mode:u8='0'" \
--session-arg "json_schema:string=''" \
--session-arg "owner_reverse_lookup_mode:u8='1'"
--session-arg "owner_reverse_lookup_mode:u8='0'"
1 change: 1 addition & 0 deletions marketplace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build-contract:

test: build-contract
mkdir -p tests/wasm
cp ../target/wasm32-unknown-unknown/release/cep78.wasm tests/wasm/cep78.wasm
cp ../target/wasm32-unknown-unknown/release/marketplace_contract.wasm tests/wasm/marketplace.wasm
cp ../target/wasm32-unknown-unknown/release/execute_listing_call.wasm tests/wasm/execute_listing_call.wasm
cd tests && cargo test
Expand Down
6 changes: 3 additions & 3 deletions marketplace/contract/src/interfaces/icep78.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ impl ICEP78 {
)
}

pub fn transfer(&self, sender: Key, recipient: Key, token_id: TokenId) {
runtime::call_contract::<(String, Key)>(
pub fn transfer(&self, sender: Key, recipient: Key, token_id: TokenId) -> () {
runtime::call_contract::<()>(
self.contract_hash,
"transfer",
runtime_args! {
"token_id" => token_id,
"source_key" => sender,
"target_key" => recipient,
},
);
)
}
}
4 changes: 2 additions & 2 deletions marketplace/contract/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub fn get_current_address() -> Address {
}
CallStackElement::StoredContract {
contract_package_hash,
..
} => Address::from(contract_package_hash),
contract_hash,
} => Address::from(contract_hash),
}
}

Expand Down
4 changes: 3 additions & 1 deletion marketplace/tests/src/marketplace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub fn deploy() -> (
"identifier_mode" => 0u8,
"metadata_mutability" => 1u8,
"nft_holder_mode" => 2u8, // FIXME: check if this works
"reporting_mode" => 0u8
},
)
.build();
Expand All @@ -90,7 +91,8 @@ pub fn deploy() -> (
let marketplace_contract_hash =
get_contract_hash(&builder, default_account, "marketplace_contract_hash");

let nft_contract_hash = get_contract_hash(&builder, default_account, "nft_contract");
let nft_contract_hash =
get_contract_hash(&builder, default_account, "cep78_contract_hash_Bit Hotel");
(builder, marketplace_contract_hash, nft_contract_hash)
}

Expand Down
Binary file modified marketplace/tests/wasm/cep78.wasm
Binary file not shown.
Binary file modified marketplace/tests/wasm/marketplace.wasm
Binary file not shown.

0 comments on commit 1de00b7

Please sign in to comment.