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

Bns implementation in libwalletapi #119

Merged
merged 25 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3c63569
Some of the testcases are disabled for bnstesting
victor-tucci Jul 14, 2023
db8a58e
basic function for buy BNS from libwalletapi
victor-tucci Jul 14, 2023
aa49e37
testcase for the bns_buy
victor-tucci Jul 14, 2023
a27c3be
typo fix in liwalletapi testcase
victor-tucci Jul 14, 2023
75cccd4
validate_bns_type function declaration added in walletImpl struct
victor-tucci Jul 17, 2023
561fed7
is_bns() function added in transaction_info
victor-tucci Jul 17, 2023
1e7b0e7
Testcase for wrong bnsType
victor-tucci Jul 17, 2023
7f883b6
validate_bns updated for checking hf_version
victor-tucci Jul 17, 2023
ad98ebb
New testcase for bnsBuy with old value
victor-tucci Jul 18, 2023
50cc314
error fixed
deen-kakarot Jul 18, 2023
ad16f39
bnsUpdateTransaction() has added for libwalletapi
Tore-tto Jul 18, 2023
a0584b7
testcases added for bnsUpdateTransaction()
deen-kakarot Jul 18, 2023
7cd8ce2
ERROR: reason are added into the pendingTransaction::status()
victor-tucci Jul 18, 2023
3da269a
bnsRenewTransaction() has added for libwalletapi
MogamboPuri Jul 18, 2023
3406b37
bnsRenewTransaction() has added for libwalletapi
MogamboPuri Jul 18, 2023
6093eaf
testcase added for bnsRenewTransaction()
peter-pratt Jul 18, 2023
d46c003
moreTestCases added for bnsRenewTransaction()
peter-pratt Jul 19, 2023
087da2a
testcase added for wrong value bnsUpdateTransaction()
deen-kakarot Jul 19, 2023
aeb07d4
updated test cases for bnsRenewTransaction()
peter-pratt Jul 19, 2023
3e9bddb
bns type validation added for wallet
Tore-tto Jul 20, 2023
e3e291a
countBns() added for libwalletapi
peter-pratt Jul 21, 2023
40f44ec
Testcases added for countBns()
MogamboPuri Jul 21, 2023
8be8fa0
testcases fixed for bnsrenew
Tore-tto Jul 21, 2023
5462a33
Merge pull request #116 from victor-tucci/bns-implementation-in-libwa…
sanada08 Aug 28, 2023
363dbbb
Merge branch 'dev' into bns-implementation-in-libwalletapi
victor-tucci Aug 28, 2023
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
4 changes: 4 additions & 0 deletions src/wallet/api/transaction_history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ void TransactionHistoryImpl::refresh()
ti->m_hash = tools::type_to_hex(pd.m_tx_hash);
ti->m_blockheight = pd.m_block_height;
ti->m_is_stake = pd.m_type == wallet::pay_type::stake;
ti->m_is_bns = pd.m_type == wallet::pay_type::bns;
ti->m_subaddrIndex = { pd.m_subaddr_index.minor };
ti->m_subaddrAccount = pd.m_subaddr_index.major;
ti->m_label = w->get_subaddress_label(pd.m_subaddr_index);
Expand Down Expand Up @@ -190,6 +191,7 @@ void TransactionHistoryImpl::refresh()
ti->m_hash = tools::type_to_hex(hash);
ti->m_blockheight = pd.m_block_height;
ti->m_is_stake = pd.m_pay_type == wallet::pay_type::stake;
ti->m_is_bns = pd.m_pay_type == wallet::pay_type::bns;
ti->m_subaddrIndex = pd.m_subaddr_indices;
ti->m_subaddrAccount = pd.m_subaddr_account;
ti->m_label = pd.m_subaddr_indices.size() == 1 ? w->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
Expand Down Expand Up @@ -222,6 +224,7 @@ void TransactionHistoryImpl::refresh()
ti->m_fee = fee;
ti->m_direction = TransactionInfo::Direction_Out;
ti->m_is_stake = pd.m_pay_type == wallet::pay_type::stake;
ti->m_is_bns = pd.m_pay_type == wallet::pay_type::bns;
ti->m_failed = is_failed;
ti->m_pending = true;
ti->m_hash = tools::type_to_hex(hash);
Expand Down Expand Up @@ -249,6 +252,7 @@ void TransactionHistoryImpl::refresh()
ti->m_hash = tools::type_to_hex(pd.m_tx_hash);
ti->m_blockheight = pd.m_block_height;
ti->m_is_stake = pd.m_type == wallet::pay_type::stake;
ti->m_is_bns = pd.m_type == wallet::pay_type::bns;
ti->m_pending = true;
ti->m_subaddrIndex = { pd.m_subaddr_index.minor };
ti->m_subaddrAccount = pd.m_subaddr_index.major;
Expand Down
7 changes: 7 additions & 0 deletions src/wallet/api/transaction_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ EXPORT
TransactionInfoImpl::TransactionInfoImpl()
: m_direction(Direction_Out)
, m_is_stake(false)
, m_is_bns(false)
, m_pending(false)
, m_failed(false)
, m_reward_type(reward_type::unspecified)
Expand Down Expand Up @@ -90,6 +91,12 @@ bool TransactionInfoImpl::isStake() const
return m_is_stake;
}

EXPORT
bool TransactionInfoImpl::isBns() const
{
return m_is_bns;
}

EXPORT
bool TransactionInfoImpl::isPending() const
{
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/api/transaction_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ class TransactionInfoImpl : public TransactionInfo
virtual uint64_t unlockTime() const override;
bool isMasterNodeReward() const override;
bool isStake() const override;
bool isBns() const override;
bool isMinerReward() const override;

private:
int m_direction;
bool m_is_stake;
bool m_is_bns;
bool m_pending;
bool m_failed;
reward_type m_reward_type; // may have a value rather than `unspecified` after hf 10
Expand Down
Loading