Skip to content

Commit

Permalink
fix: fix migration test by reducing gas for repost (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyProgrammist authored May 28, 2024
1 parent b68c0c2 commit 6326386
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/repost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn repost_internal(post: Post, contract_address: AccountId) -> near_sdk::serde_j

pub fn repost(post: Post) -> Promise {
social_db_contract()
.with_static_gas(env::prepaid_gas().saturating_div(3))
.with_static_gas(env::prepaid_gas().saturating_div(4))
.with_attached_deposit(env::attached_deposit())
.set(repost_internal(post, env::current_account_id()))
}
Expand Down
20 changes: 20 additions & 0 deletions tests/proposals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ async fn test_proposal() -> anyhow::Result<()> {

let deposit_amount = NearToken::from_near(2);

let add_idea_post = contract
.call("add_post")
.args_json(json!({
"parent_id": null,
"labels": [],
"body": {
"name": "This is a test idea.",
"description": "This is a test description.",
"post_type": "Idea",
"idea_version": "V1"
}
}))
.deposit(deposit_amount)
.transact()
.await?;

println!("add idea post: {:?}", add_idea_post);
assert!(add_idea_post.is_success());


let _set_categories = contract
.call("set_allowed_categories")
.args_json(json!({"new_categories": ["Marketing", "Events"]}))
Expand Down

0 comments on commit 6326386

Please sign in to comment.