Skip to content

Commit 2ca1a42

Browse files
committed
Revert "Started test environement specific documentation"
This reverts commit a5fd450.
1 parent a5fd450 commit 2ca1a42

File tree

8 files changed

+3
-124
lines changed

8 files changed

+3
-124
lines changed

cw-orch/examples/mock_test.rs

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
use std::str::FromStr;
2-
3-
use cosmwasm_std::{coins, Addr, BlockInfo, Decimal, Timestamp};
1+
use cosmwasm_std::Addr;
42

53
use counter_contract::{
64
contract::CounterContract,
75
msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg},
86
};
9-
use cw_orch::prelude::{CallAs, CwOrchExecute, CwOrchInstantiate, CwOrchQuery, CwOrchUpload, Mock};
7+
use cw_orch::prelude::{CwOrchExecute, CwOrchInstantiate, CwOrchQuery, CwOrchUpload, Mock};
108

11-
/// This example shows how to create and use the cw-multi-test mock environment
129
pub fn main() {
13-
// ANCHOR: mock_creation
1410
let sender = Addr::unchecked("juno16g2rahf5846rxzp3fwlswy08fz8ccuwk03k57y");
1511

1612
let mock = Mock::new(&sender);
17-
// ANCHOR_END: mock_creation
1813

19-
// ANCHOR: mock_usage
2014
let contract_counter = CounterContract::new("mock:contract_counter", mock);
2115

2216
let upload_res = contract_counter.upload();
2317
upload_res.unwrap();
24-
// ANCHOR_END: mock_usage
2518

2619
let init_res = contract_counter.instantiate(&InstantiateMsg { count: 0 }, Some(&sender), None);
2720
init_res.unwrap();
@@ -32,52 +25,3 @@ pub fn main() {
3225
let query_res = contract_counter.query::<GetCountResponse>(&QueryMsg::GetCount {});
3326
assert_eq!(query_res.unwrap().count, 1);
3427
}
35-
36-
// This is used for documentation only
37-
// This is actually only used to avoid having the `mut` keyword inside the mock_usage anchor (only necessary for set_sender)
38-
pub fn customize() {
39-
let sender = Addr::unchecked("juno16g2rahf5846rxzp3fwlswy08fz8ccuwk03k57y");
40-
41-
let mock = Mock::new(&sender);
42-
43-
let mut contract_counter = CounterContract::new("mock:contract_counter", mock.clone());
44-
45-
// ANCHOR: mock_customization
46-
let new_sender = Addr::unchecked("entirely-new-sender");
47-
mock.set_balance(&new_sender, coins(100_000, "ujunox"))
48-
.unwrap();
49-
50-
// Reuploads as the new sender
51-
contract_counter.call_as(&new_sender).upload().unwrap();
52-
53-
// Here the contract_counter sender is again `sender`
54-
55-
// Sets the new_sender as the definite sender
56-
contract_counter.set_sender(&new_sender);
57-
58-
// From now on the contract_counter sender is `new_sender`
59-
// ANCHOR_END: mock_customization
60-
61-
// ANCHOR: deep_mock_customization
62-
mock.app
63-
.borrow_mut()
64-
.init_modules(|router, api, storage| {
65-
router.staking.add_validator(
66-
api,
67-
storage,
68-
&BlockInfo {
69-
height: 16736,
70-
time: Timestamp::from_seconds(13345762376),
71-
chain_id: "juno-1".to_string(),
72-
},
73-
cosmwasm_std::Validator {
74-
address: "new-validator-address".to_string(),
75-
commission: Decimal::from_str("0.5").unwrap(), // Greedy validator
76-
max_commission: Decimal::from_str("1").unwrap(), // Dangerous validator
77-
max_change_rate: Decimal::from_str("1").unwrap(), // Very dangerous validator
78-
},
79-
)
80-
})
81-
.unwrap();
82-
// ANCHOR_END: deep_mock_customization
83-
}

docs/src/SUMMARY.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
- [Scripting](./single_contract/scripting.md)
1313
- [Integration Tests](./single_contract/integration-tests.md)
1414

15-
- [Integrations](./integrations/index.md)
16-
- [Daemon (Live Chains)](./integrations/daemon.md)
17-
- [Cw Multi Test](./integrations/cw-multi-test.md)
18-
- [Osmosis Test Tube](./integrations/osmosis-test-tube.md)
19-
- [Starship](./integrations/starship.md)
20-
2115

2216
- [Workspace](./workspace/index.md)
2317
- [Structure]()

docs/src/integrations/cw-multi-test.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

docs/src/integrations/daemon.md

Whitespace-only changes.

docs/src/integrations/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/integrations/osmosis-test-tube.md

Whitespace-only changes.

docs/src/integrations/starship.md

Whitespace-only changes.

docs/src/intro.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ cw-orchestrator is an advanced testing and deployment tool for CosmWasm smart-co
1111

1212
## Features
1313

14-
- **Testing**: cw-orchestrator provides a testing framework that makes it easy to write tests for CosmWasm contracts. It does this by providing a testing environment that mimics the behavior of a CosmWasm blockchain. This allows you to write tests that interact with your contract in the same way that it would be interacted with on a real blockchain. These kinds of tests allow developers to more easily test contract-to-contract interactions without having to deal with the overhead of running a local node. The testing framework also provides a number of utilities that make it easy to write tests for CosmWasm contracts. These utilities include the ability to easily set and query balances, set block height/time and more. Additionally by creating a wrapper interface around a project's deployment developers can share their testing infrastructure with other developers, allowing them to easily test how their contracts interact with the project. The testing framework supported by cw-orchestrator include :
15-
- **[Cw-Multi-Test](./integrations/cw-multi-test.md)**
16-
- **[Starship](./integrations/starship.md)**
17-
- **[Osmosis-test-tube](./integrations/osmosis-test-tube.md)**
14+
- **Testing**: cw-orchestrator provides a testing framework that makes it easy to write tests for CosmWasm contracts. It does this by providing a testing environment that mimics the behavior of a CosmWasm blockchain. This allows you to write tests that interact with your contract in the same way that it would be interacted with on a real blockchain. These kinds of tests allow developers to more easily test contract-to-contract interactions without having to deal with the overhead of running a local node. The testing framework also provides a number of utilities that make it easy to write tests for CosmWasm contracts. These utilities include the ability to easily set and query balances, set block height/time and more. Additionally by creating a wrapper interface around a project's deployment developers can share their testing infrastructure with other developers, allowing them to easily test how their contracts interact with the project.
1815

1916
- **Deployment**: cw-orchestrator also provides the ability to deploy to real networks. It does this by providing an easy to use interface to a blockchain node that can be used to submit transactions, query state and inspect transaction results.
2017

0 commit comments

Comments
 (0)