diff --git a/contracts/axone-cognitarium/src/contract.rs b/contracts/axone-cognitarium/src/contract.rs index 0b723f02..3f852d74 100644 --- a/contracts/axone-cognitarium/src/contract.rs +++ b/contracts/axone-cognitarium/src/contract.rs @@ -504,7 +504,7 @@ mod tests { } #[test] - fn instantiate_fail_with_funds() { + fn funds_initialization() { let mut deps = mock_dependencies(); let env = mock_env(); let info = mock_info("sender", &coins(10, "uaxone")); diff --git a/contracts/axone-dataverse/src/contract.rs b/contracts/axone-dataverse/src/contract.rs index 0ca585cd..a91f00ea 100644 --- a/contracts/axone-dataverse/src/contract.rs +++ b/contracts/axone-dataverse/src/contract.rs @@ -215,7 +215,7 @@ mod tests { } #[test] - fn instantiate_fail_with_funds() { + fn funds_initialization() { let mut deps = mock_dependencies(); let env = mock_env(); let info = mock_info("sender", &coins(10, "uaxone")); diff --git a/contracts/axone-law-stone/src/contract.rs b/contracts/axone-law-stone/src/contract.rs index 42c4dcfb..4ca32645 100644 --- a/contracts/axone-law-stone/src/contract.rs +++ b/contracts/axone-law-stone/src/contract.rs @@ -390,7 +390,7 @@ mod tests { } #[test] - fn instantiate_fail_with_funds() { + fn funds_initialization() { let mut deps = mock_dependencies_with_logic_handler(|_| SystemResult::Err(SystemError::Unknown {})); let env = mock_env(); diff --git a/contracts/axone-objectarium/src/contract.rs b/contracts/axone-objectarium/src/contract.rs index e50ffc5c..a32a07ec 100644 --- a/contracts/axone-objectarium/src/contract.rs +++ b/contracts/axone-objectarium/src/contract.rs @@ -22,6 +22,7 @@ pub fn instantiate( info: MessageInfo, msg: InstantiateMsg, ) -> Result { + nonpayable(&info)?; let bucket = Bucket::try_new( info.sender, msg.bucket, @@ -650,6 +651,25 @@ mod tests { assert_eq!("foobar", value.name); } + #[test] + fn funds_initialization() { + let mut deps = mock_dependencies(); + let msg = InstantiateMsg { + bucket: "foo".to_string(), + config: Default::default(), + limits: Default::default(), + pagination: Default::default(), + }; + let info = mock_info("creator", &coins(10, "uaxone")); + + let res = instantiate(deps.as_mut(), mock_env(), info, msg); + assert!(res.is_err()); + assert_eq!( + res.unwrap_err(), + ContractError::Payment(PaymentError::NonPayable {}) + ); + } + #[test] fn execute_fail_with_funds() { let mut deps = mock_dependencies();