-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Release fund logic for Campaign Milestone #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anonfedora
wants to merge
8
commits into
boundlessfi:develop
Choose a base branch
from
anonfedora:feat-release_fund_logic
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
525fdfb
feat: Release fund logic for Campaign Milestone
anonfedora d935ecd
fix: fmt
anonfedora c36ae2b
Merge branch 'develop' into feat-release_fund_logic
anonfedora b46c432
fix: fmt
anonfedora 031a11f
tests: campaign
anonfedora 68abc69
Merge branch 'develop' into feat-release_fund_logic
anonfedora 0279b29
fix: format, wasm32v1
anonfedora a9d2cb1
fix: fmt
anonfedora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| #![cfg(test)] | ||
|
|
||
| use crate::{ | ||
| datatypes::{Campaign, Status}, | ||
| datatypes::{Campaign, EntityType, Milestone, MilestoneStatus, Status}, | ||
| BoundlessContract, BoundlessContractClient, | ||
| }; | ||
| use soroban_sdk::{ | ||
| testutils::Address as _, | ||
| Address, Env, Symbol, Vec, | ||
| }; | ||
| use soroban_sdk::{testutils::Address as _, Address, Env, Symbol, Vec}; | ||
|
|
||
| extern crate std; | ||
| mod boundless { | ||
| soroban_sdk::contractimport!(file = "../../target/wasm32v1-none/release/boundless.wasm"); | ||
| soroban_sdk::contractimport!( | ||
| file = "../../target/wasm32-unknown-unknown/release/boundless.wasm" | ||
| ); | ||
|
||
| } | ||
|
|
||
| #[test] | ||
|
|
@@ -22,9 +21,9 @@ fn test_cancel_campaign_success() { | |
| let admin = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
|
|
||
| let campaign_id = 1u64; | ||
| let owner: Address = Address::generate(&env); | ||
| let title = Symbol::new(&env, "TestCampaign"); | ||
|
|
@@ -33,7 +32,7 @@ fn test_cancel_campaign_success() { | |
| let escrow_contract_id = Address::generate(&env); | ||
| let milestones = Vec::new(&env); | ||
| let backers = Vec::new(&env); | ||
|
|
||
| let campaign = Campaign { | ||
| id: campaign_id, | ||
| owner: owner.clone(), | ||
|
|
@@ -50,9 +49,9 @@ fn test_cancel_campaign_success() { | |
| env.as_contract(&contract_id, || { | ||
| env.storage().persistent().set(&campaign_key, &campaign); | ||
| }); | ||
|
|
||
| contract.cancel_campaign(&campaign_id, &admin); | ||
|
|
||
| let updated_campaign: Campaign = env.as_contract(&contract_id, || { | ||
| env.storage().persistent().get(&campaign_key).unwrap() | ||
| }); | ||
|
|
@@ -69,7 +68,7 @@ fn test_cancel_campaign_unauthorized() { | |
| let unauthorized_user = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
|
|
||
| let campaign_id = 1u64; | ||
|
|
@@ -80,7 +79,7 @@ fn test_cancel_campaign_unauthorized() { | |
| let escrow_contract_id = Address::generate(&env); | ||
| let milestones = Vec::new(&env); | ||
| let backers = Vec::new(&env); | ||
|
|
||
| let campaign = Campaign { | ||
| id: campaign_id, | ||
| owner: owner.clone(), | ||
|
|
@@ -108,7 +107,7 @@ fn test_cancel_campaign_not_found() { | |
| let admin = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
| contract.cancel_campaign(&999u64, &admin); | ||
| } | ||
|
|
@@ -122,7 +121,7 @@ fn test_cancel_campaign_already_completed() { | |
| let admin = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
|
|
||
| let campaign_id = 1u64; | ||
|
|
@@ -133,7 +132,7 @@ fn test_cancel_campaign_already_completed() { | |
| let escrow_contract_id = Address::generate(&env); | ||
| let milestones = Vec::new(&env); | ||
| let backers = Vec::new(&env); | ||
|
|
||
| let campaign = Campaign { | ||
| id: campaign_id, | ||
| owner: owner.clone(), | ||
|
|
@@ -160,7 +159,7 @@ fn test_cancel_campaign_already_failed() { | |
| let admin = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
|
|
||
| let campaign_id = 1u64; | ||
|
|
@@ -171,7 +170,7 @@ fn test_cancel_campaign_already_failed() { | |
| let escrow_contract_id = Address::generate(&env); | ||
| let milestones = Vec::new(&env); | ||
| let backers = Vec::new(&env); | ||
|
|
||
| let campaign = Campaign { | ||
| id: campaign_id, | ||
| owner: owner.clone(), | ||
|
|
@@ -197,7 +196,7 @@ fn test_cancel_campaign_pending_status() { | |
| let admin = Address::generate(&env); | ||
| let contract_id = env.register(BoundlessContract, ()); | ||
| let contract = BoundlessContractClient::new(&env, &contract_id); | ||
|
|
||
| contract.initialize(&admin); | ||
|
|
||
| let campaign_id = 1u64; | ||
|
|
@@ -208,7 +207,7 @@ fn test_cancel_campaign_pending_status() { | |
| let escrow_contract_id = Address::generate(&env); | ||
| let milestones = Vec::new(&env); | ||
| let backers = Vec::new(&env); | ||
|
|
||
| let campaign = Campaign { | ||
| id: campaign_id, | ||
| owner: owner.clone(), | ||
|
|
@@ -225,9 +224,9 @@ fn test_cancel_campaign_pending_status() { | |
| env.as_contract(&contract_id, || { | ||
| env.storage().persistent().set(&campaign_key, &campaign); | ||
| }); | ||
|
|
||
| contract.cancel_campaign(&campaign_id, &admin); | ||
|
|
||
| let updated_campaign: Campaign = env.as_contract(&contract_id, || { | ||
| env.storage().persistent().get(&campaign_key).unwrap() | ||
| }); | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this to
"../../target/wasm32v1-none/release/boundless.wasm");For Rust v1.84.0 or higher, you need wasm32v1-none target.