From 8369a9e912a3dfe525416805346978939135e453 Mon Sep 17 00:00:00 2001 From: Jeff Bencin Date: Thu, 13 Apr 2023 12:44:09 -0400 Subject: [PATCH] chore: Minor changes as requested in PR #253 --- src/chainstate/stacks/db/blocks.rs | 8 ++++---- testnet/stacks-node/src/tests/l1_observer_test.rs | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/chainstate/stacks/db/blocks.rs b/src/chainstate/stacks/db/blocks.rs index d0a2dd671..e213cb835 100644 --- a/src/chainstate/stacks/db/blocks.rs +++ b/src/chainstate/stacks/db/blocks.rs @@ -4735,8 +4735,8 @@ impl StacksChainState { let deposit_op_failed = match &value { Value::Response(r) => r.committed == false, _ => { - // TODO: Do anything for the case where `value` is not of type `Value::Response()`? - warn!("DepositFt op returned unexpected value"; "value" => %value); + // Public functions should always return type `Response` + error!("DepositFt op returned unexpected value"; "value" => %value); false } }; @@ -4817,8 +4817,8 @@ impl StacksChainState { let deposit_op_failed = match &value { Value::Response(r) => r.committed == false, _ => { - // TODO: Do anything for the case where `value` is not of type `Value::Response()`? - warn!("DepositNft op returned unexpected value"; "value" => %value); + // Public functions should always return type `Response` + error!("DepositNft op returned unexpected value"; "value" => %value); false } }; diff --git a/testnet/stacks-node/src/tests/l1_observer_test.rs b/testnet/stacks-node/src/tests/l1_observer_test.rs index fdef42428..b105b8aa4 100644 --- a/testnet/stacks-node/src/tests/l1_observer_test.rs +++ b/testnet/stacks-node/src/tests/l1_observer_test.rs @@ -2764,6 +2764,7 @@ fn nft_deposit_failure_and_refund_integration_test() { ); // Publish subnet contract for nft-token + // This contract is modified so that deposits to subnet always fail let subnet_nft_content = include_str!("../../../../core-contracts/contracts/helper/simple-nft-l2-no-deposit.clar"); let subnet_nft_publish = make_contract_publish( @@ -3721,8 +3722,8 @@ fn ft_deposit_and_withdraw_integration_test() { ); assert_eq!(amount, Value::okay(Value::UInt(5)).unwrap()); - // Check that the subnet contract no longer owns any tokens. It should have - // transferred the 1 that it had, then minted the remaining 3. + // Check that the subnet contract no longer owns any tokens + // It should have transferred the 3 that it had let res = call_read_only( &l1_rpc_origin, &user_addr, @@ -3864,6 +3865,7 @@ fn ft_deposit_failure_and_refund_integration_test() { ); // Publish subnet contract for ft-token + // This contract is modified so that deposits to subnet always fail let subnet_simple_ft = include_str!("../../../../core-contracts/contracts/helper/simple-ft-l2-no-deposit.clar"); let subnet_ft_publish = make_contract_publish(