[WIP] Unify and extend rpc methods to bid and sequence #303
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#303
Loading…
Reference in a new issue
No description provided.
Delete branch "rpc_hash_hardfork"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A bunch of updated rpc keys can lead to breaking changes in users, note it uses camelCase name notation, it can be changed as well. Notable changes:
nomalized_name -> normalizedName
txid -> txId
nHeight -> height
nValidAtHeight (valid at height) -> validAtHeight
nAmount -> amount
nEffectiveAmount (effective amount) -> effectiveAmount
total names -> totalNames
total claims -> totalClaims
total value -> totalValue
Most values in getclaimsfortx
@ -0,0 +78,4 @@
" the latest active\n" \
" block will be used."
#define CLAIM_OUTPUT \
These are less readable than before. I actually used these quite often.
@ -133,0 +208,4 @@
CTxDestination address;
if (ExtractDestination(coin.out.scriptPubKey, address))
result.pushKV(T_ADDRESS, EncodeDestination(address));
typo
@ -136,3 +280,4 @@
return count >= required && count <= required + optional;
}
void validateRequest(const JSONRPCRequest& request, int findex, uint8_t required, uint8_t optional)
should we cast this?
@ -185,3 +305,3 @@
CBlockIndex *blockIndex = BlockHashIndex(ParseHashV(request.params[0], "blockhash (optional parameter 1)"));
CBlockIndex* blockIndex = BlockHashIndex(ParseHashV(request.params[0], T_BLOCKHASH " (optional parameter 1)"));
RollBackTo(blockIndex, coinsCache, trieCache);
}
casting again, maybe the type needs to be updated?
@ -263,3 +345,3 @@
if (!request.params.empty()) {
CBlockIndex *blockIndex = BlockHashIndex(ParseHashV(request.params[0], "blockhash (optional parameter 1)"));
CBlockIndex* blockIndex = BlockHashIndex(ParseHashV(request.params[0], T_BLOCKHASH " (optional parameter 1)"));
RollBackTo(blockIndex, coinsCache, trieCache);
nice catch!
Lots of changes here. I think it would be nice to just test the changes by validating the output between versions. It is largly a refactor of code, would have been nice to separate the refactor from the modifications required for bid and sequence. Is that possible?
Changes are breaking since i unify outputs which makes changes to the fields.
@ -0,0 +78,4 @@
" the latest active\n" \
" block will be used."
#define CLAIM_OUTPUT \
I think is more readable now :) You see it on one place and there is no need to verify it's same or not and it's correct on every place or not.
@ -136,3 +280,4 @@
return count >= required && count <= required + optional;
}
void validateRequest(const JSONRPCRequest& request, int findex, uint8_t required, uint8_t optional)
UniValue does not provide an uint32 constructor which can lead to ambiguous.
@ -0,0 +78,4 @@
" the latest active\n" \
" block will be used."
#define CLAIM_OUTPUT \
I was also looking at it through the PR lens. Will look at it in the code base too.
@ -0,0 +78,4 @@
" the latest active\n" \
" block will be used."
#define CLAIM_OUTPUT \
Overall code base is way better to me, logic and help message are separate which makes logic to be easy follow, OTOH help message are minimize.
The cli help (that shows all the available methods) isn't showing the parameters for the methods in rpc/claimtrie.cpp. It's like the argNames are ignored in that file.