factory_utils/
tests.rs

1use crate::msg::CollectionParams;
2use cosmwasm_std::Decimal;
3use cosmwasm_std::Timestamp;
4use terp721::{CollectionInfo, ResidualInfoResponse};
5
6pub fn mock_collection_params() -> CollectionParams {
7    CollectionParams {
8        code_id: 1,
9        name: "Collection Name".to_string(),
10        symbol: "COL".to_string(),
11        info: CollectionInfo {
12            creator: "creator".to_string(),
13            description: String::from("Terp Monkeys"),
14            image: "https://example.com/image.png".to_string(),
15            external_link: Some("https://example.com/external.html".to_string()),
16            start_trading_time: None,
17            explicit_content: Some(false),
18            residual_info: Some(ResidualInfoResponse {
19                payment_address: "creator".to_string(),
20                share: Decimal::percent(10),
21            }),
22        },
23    }
24}
25
26pub fn mock_collection_params_1(start_trading_time: Option<Timestamp>) -> CollectionParams {
27    CollectionParams {
28        code_id: 1,
29        name: "Collection Name".to_string(),
30        symbol: "COL".to_string(),
31        info: CollectionInfo {
32            creator: "creator".to_string(),
33            description: String::from("Terp Monkeys"),
34            image: "https://example.com/image.png".to_string(),
35            external_link: Some("https://example.com/external.html".to_string()),
36            start_trading_time,
37            explicit_content: Some(false),
38            residual_info: Some(ResidualInfoResponse {
39                payment_address: "creator".to_string(),
40                share: Decimal::percent(10),
41            }),
42        },
43    }
44}
45
46pub fn mock_curator_payment_address(start_trading_time: Option<Timestamp>) -> CollectionParams {
47    CollectionParams {
48        code_id: 1,
49        name: String::from("Test Coin"),
50        symbol: String::from("TEST"),
51        info: CollectionInfo {
52            creator: "creator".to_string(),
53            description: String::from("Terp Monkeys"),
54            image: "https://example.com/image.png".to_string(),
55            external_link: Some("https://example.com/external.html".to_string()),
56            residual_info: Some(ResidualInfoResponse {
57                payment_address: "curator".to_string(),
58                share: Decimal::percent(10),
59            }),
60            start_trading_time,
61            explicit_content: None,
62        },
63    }
64}
65
66pub fn mock_collection_params_high_fee(start_trading_time: Option<Timestamp>) -> CollectionParams {
67    CollectionParams {
68        code_id: 1,
69        name: String::from("Test Coin"),
70        symbol: String::from("TEST"),
71        info: CollectionInfo {
72            creator: "creator".to_string(),
73            description: String::from("Terp Monkeys"),
74            image:
75                "ipfs://bafybeigi3bwpvyvsmnbj46ra4hyffcxdeaj6ntfk5jpic5mx27x6ih2qvq/images/1.png"
76                    .to_string(),
77            external_link: Some("https://example.com/external.html".to_string()),
78            residual_info: Some(ResidualInfoResponse {
79                payment_address: "creator".to_string(),
80                share: Decimal::percent(100),
81            }),
82            start_trading_time,
83            explicit_content: None,
84        },
85    }
86}
87
88pub fn mock_collection_two(start_trading_time: Option<Timestamp>) -> CollectionParams {
89    CollectionParams {
90        code_id: 1,
91        name: String::from("Test Collection 2"),
92        symbol: String::from("TEST 2"),
93        info: CollectionInfo {
94            creator: "creator".to_string(),
95            description: String::from("Terp Monkeys 2"),
96            image:
97                "ipfs://bafybeigi3bwpvyvsmnbj46ra4hyffcxdeaj6ntfk5jpic5mx27x6ih2qvq/images/1.png"
98                    .to_string(),
99            external_link: Some("https://example.com/external.html".to_string()),
100            residual_info: Some(ResidualInfoResponse {
101                payment_address: "creator".to_string(),
102                share: Decimal::percent(10),
103            }),
104            start_trading_time,
105            explicit_content: None,
106        },
107    }
108}