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

Burn loan interest in DUSD instead of swapping to DFI #1357

Merged
merged 5 commits into from
Jun 23, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Merge branch 'master' into feature/direct_dusd_burn
Bushstar authored Jun 23, 2022
commit 5191c33350bd4f9809ee3ab2ef8263e9c19f4304
4 changes: 2 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
@@ -4543,8 +4543,8 @@ void CChainState::ProcessTokenSplits(const CBlock& block, const CBlockIndex* pin
});

LogPrintf("Token split info: rebalance " /* Continued */
"(id: %d, symbol: %s, add-accounts: %d, sub-accounts: %d, val: %d)\n",
id, newToken.symbol, addAccounts.size(), subAccounts.size(), totalBalance);
"(id: %d, symbol: %s, accounts: %d, val: %d)\n",
id, newToken.symbol, balanceUpdates.size(), totalBalance);

res = view.AddMintedTokens(newTokenId, totalBalance);
if (!res) {
44 changes: 43 additions & 1 deletion test/functional/feature_setgov.py
Original file line number Diff line number Diff line change
@@ -761,9 +761,15 @@ def run_test(self):
attributes = self.nodes[0].getgov('ATTRIBUTES')['ATTRIBUTES']
assert_equal(attributes['v0/locks/token/5'], 'true')

# Move to FCG fork
# Try and set Gov vars before fork
assert_raises_rpc_error(-32600, "Cannot be set before FortCanningGardensHeight", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/poolpairs/3/token_a_fee_direction': 'both'}})
assert_raises_rpc_error(-32600, "Cannot be set before FortCanningGardensHeight", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/poolpairs/3/token_b_fee_direction': 'both'}})

# Move to fork
self.nodes[0].generate(1250 - self.nodes[0].getblockcount())

# Test invalid calls
assert_raises_rpc_error(-5, "Fee direction value must be both, in or out", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/poolpairs/3/token_a_fee_direction': 'invalid'}})
assert_raises_rpc_error(-5, "Boolean value must be either \"true\" or \"false\"", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/params/dfip2206a/direct_interest_dusd_burn':'not_a_bool'}})
assert_raises_rpc_error(-5, "Boolean value must be either \"true\" or \"false\"", self.nodes[0].setgov, {"ATTRIBUTES":{'v0/params/dfip2206a/direct_loan_dusd_burn':'not_a_bool'}})

@@ -775,5 +781,41 @@ def run_test(self):
assert_equal(result['v0/params/dfip2206a/direct_interest_dusd_burn'], 'true')
assert_equal(result['v0/params/dfip2206a/direct_loan_dusd_burn'], 'true')

# Set fee direction Gov vars
self.nodes[0].setgov({"ATTRIBUTES":{
'v0/poolpairs/3/token_a_fee_direction': 'both',
'v0/poolpairs/3/token_b_fee_direction': 'both',
}})
self.nodes[0].generate(1)

# Check attributes
result = self.nodes[0].getgov('ATTRIBUTES')['ATTRIBUTES']
assert_equal(result['v0/poolpairs/3/token_a_fee_direction'], 'both')
assert_equal(result['v0/poolpairs/3/token_b_fee_direction'], "both")

# Set fee direction Gov vars
self.nodes[0].setgov({"ATTRIBUTES":{
'v0/poolpairs/3/token_a_fee_direction': 'in',
'v0/poolpairs/3/token_b_fee_direction': 'in',
}})
self.nodes[0].generate(1)

# Check attributes
result = self.nodes[0].getgov('ATTRIBUTES')['ATTRIBUTES']
assert_equal(result['v0/poolpairs/3/token_a_fee_direction'], 'in')
assert_equal(result['v0/poolpairs/3/token_b_fee_direction'], "in")

# Set fee direction Gov vars
self.nodes[0].setgov({"ATTRIBUTES":{
'v0/poolpairs/3/token_a_fee_direction': 'out',
'v0/poolpairs/3/token_b_fee_direction': 'out',
}})
self.nodes[0].generate(1)

# Check attributes
result = self.nodes[0].getgov('ATTRIBUTES')['ATTRIBUTES']
assert_equal(result['v0/poolpairs/3/token_a_fee_direction'], 'out')
assert_equal(result['v0/poolpairs/3/token_b_fee_direction'], "out")

if __name__ == '__main__':
GovsetTest ().main ()
You are viewing a condensed version of this merge commit. You can view the full changes here.