Skip to content
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

feat(tokenDeleteTransaction): Implement JSON-RPC endpoint for TokenDeleteTransaction #790

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sdk/main/include/CustomFractionalFee.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class CustomFractionalFee : public CustomFeeBase<CustomFractionalFee>
* @param denominator The desired denominator of the fractional amount of the transferred units to assess as a part of
* this CustomFractionalFee.
* @return A reference to this CustomFractionalFee object, with the newly-set denominator.
* @throws std::invalid_argument If the input denominator is 0.
*/
CustomFractionalFee& setDenominator(const int64_t& denominator);

Expand Down
1 change: 0 additions & 1 deletion src/sdk/main/include/CustomRoyaltyFee.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class CustomRoyaltyFee : public CustomFeeBase<CustomRoyaltyFee>
* @param denominator The desired denominator of the fractional amount of the transferred units to assess as a part of
* this CustomRoyaltyFee.
* @return A reference to this CustomRoyaltyFee object, with the newly-set denominator.
* @throws std::invalid_argument If the input denominator is 0.
*/
CustomRoyaltyFee& setDenominator(const int64_t& denominator);

Expand Down
11 changes: 10 additions & 1 deletion src/sdk/main/include/FeeAssessmentMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#ifndef HEDERA_SDK_CPP_FEE_ASSESSMENT_METHOD_H_
#define HEDERA_SDK_CPP_FEE_ASSESSMENT_METHOD_H_

#include <string>
#include <unordered_map>

namespace Hedera
Expand All @@ -46,11 +47,19 @@ enum class FeeAssessmentMethod
/**
* Map of FeeAssessmentMethod to its corresponding string.
*/
const std::unordered_map<FeeAssessmentMethod, const char*> gFeeAssessmentMethodToString = {
const std::unordered_map<FeeAssessmentMethod, std::string> gFeeAssessmentMethodToString = {
{FeeAssessmentMethod::INCLUSIVE, "INCLUSIVE"},
{ FeeAssessmentMethod::EXCLUSIVE, "EXCLUSIVE"}
};

/**
* Map of FeeAssessmentMethod string representation to its corresponding enum value.
*/
[[maybe_unused]] const std::unordered_map<std::string, FeeAssessmentMethod> gStringToFeeAssessmentMethod = {
{"INCLUSIVE", FeeAssessmentMethod::INCLUSIVE},
{ "EXCLUSIVE", FeeAssessmentMethod::EXCLUSIVE}
};

} // namespace Hedera

#endif // HEDERA_SDK_CPP_FEE_ASSESSMENT_METHOD_H_
5 changes: 0 additions & 5 deletions src/sdk/main/src/CustomFractionalFee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ CustomFractionalFee& CustomFractionalFee::setNumerator(const int64_t& numerator)
//-----
CustomFractionalFee& CustomFractionalFee::setDenominator(const int64_t& denominator)
{
if (denominator == 0LL)
{
throw std::invalid_argument("Denominator cannot be 0");
}

mDenominator = denominator;
return *this;
}
Expand Down
5 changes: 0 additions & 5 deletions src/sdk/main/src/CustomRoyaltyFee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ CustomRoyaltyFee& CustomRoyaltyFee::setNumerator(const int64_t& numerator)
//-----
CustomRoyaltyFee& CustomRoyaltyFee::setDenominator(const int64_t& denominator)
{
if (denominator == 0LL)
gsstoykov marked this conversation as resolved.
Show resolved Hide resolved
{
throw std::invalid_argument("Denominator cannot be 0");
}

mDenominator = denominator;
return *this;
}
Expand Down
10 changes: 0 additions & 10 deletions src/sdk/tests/unit/CustomFractionalFeeUnitTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ TEST_F(CustomFractionalFeeUnitTests, GetSetDenominator)
EXPECT_EQ(customFractionalFee.getDenominator(), getTestDenominator());
}

//-----
TEST_F(CustomFractionalFeeUnitTests, CannotSetDenominatorToZero)
{
// Given
CustomFractionalFee customFractionalFee;

// When / Then
EXPECT_THROW(customFractionalFee.setDenominator(0LL), std::invalid_argument);
}

//-----
TEST_F(CustomFractionalFeeUnitTests, GetSetMinimumAmount)
{
Expand Down
10 changes: 0 additions & 10 deletions src/sdk/tests/unit/CustomRoyaltyFeeUnitTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,6 @@ TEST_F(CustomRoyaltyFeeUnitTests, GetSetDenominator)
EXPECT_EQ(customRoyaltyFee.getDenominator(), getTestDenominator());
}

//-----
TEST_F(CustomRoyaltyFeeUnitTests, CannotSetDenominatorToZero)
{
// Given
CustomRoyaltyFee customRoyaltyFee;

// When / Then
EXPECT_THROW(customRoyaltyFee.setDenominator(0LL), std::invalid_argument);
}

//-----
TEST_F(CustomRoyaltyFeeUnitTests, GetSetFallbackFee)
{
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/tests/unit/FeeAssessmentMethodUnitTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ TEST_F(FeeAssessmentMethodUnitTests, FeeAssessmentMethodToString)
// Given / When / Then
ASSERT_TRUE(gFeeAssessmentMethodToString.find(FeeAssessmentMethod::INCLUSIVE) != gFeeAssessmentMethodToString.end());
ASSERT_TRUE(gFeeAssessmentMethodToString.find(FeeAssessmentMethod::EXCLUSIVE) != gFeeAssessmentMethodToString.end());
EXPECT_STRCASEEQ(gFeeAssessmentMethodToString.at(FeeAssessmentMethod::INCLUSIVE), "INCLUSIVE");
EXPECT_STRCASEEQ(gFeeAssessmentMethodToString.at(FeeAssessmentMethod::EXCLUSIVE), "EXCLUSIVE");
EXPECT_EQ(gFeeAssessmentMethodToString.at(FeeAssessmentMethod::INCLUSIVE), "INCLUSIVE");
EXPECT_EQ(gFeeAssessmentMethodToString.at(FeeAssessmentMethod::EXCLUSIVE), "EXCLUSIVE");
}
2 changes: 1 addition & 1 deletion src/tck/include/CommonTransactionParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
namespace Hedera::TCK
{
/**
* Struct the contains the common parameters of a Transaction.
* Struct that contains the common parameters of a Transaction.
*/
struct CommonTransactionParams
{
Expand Down
Loading
Loading