-
Notifications
You must be signed in to change notification settings - Fork 123
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
SafeCash (Testnet) Support Added #12
Conversation
@hashtobewild Confirming you tested this on safecash and a non-safecash? Just want to be sure. Then I'll approve. If you need someone to test this pr on a different coin let me know. I'll do it or find someone that can quickly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the work to add this!
This will require a wide range of testing:
- Safecash
- Zencash
- Zcash or XSG
- One of the other coins
Let's wait until the changes I requested are satisfied before testing to ensure we're testing final code.
lib/blockTemplate.js
Outdated
@@ -39,6 +39,16 @@ var BlockTemplate = module.exports = function BlockTemplate( | |||
if (coin.payFoundersReward === true) { | |||
if (!this.rpcData.founders || this.rpcData.founders.length <= 0) { | |||
console.log('Error, founders reward missing for block template!'); | |||
} else if (this.rpcData.infrastructure && this.rpcData.infrastructure > 0){ | |||
// SafeCash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the alignment in this block?
Also, I'm uncomfortable with this setting blockReward
to an object but the else setting it to an integer. The variable should either be one or the other. If need-be, we can pass another variable for this coin.
Lastly, can you remove all the wrapping ()
? They're not necessary; thanks!
lib/pool.js
Outdated
@@ -374,7 +374,8 @@ var pool = module.exports = function pool(options, authorizeFn) { | |||
var batchRpcCalls = [ | |||
['validateaddress', [options.address]], | |||
['getdifficulty', []], | |||
['getinfo', []], | |||
['getblockchaininfo', []], | |||
['getnetworkinfo', []], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the alignment in this line?
lib/pool.js
Outdated
@@ -420,12 +421,12 @@ var pool = module.exports = function pool(options, authorizeFn) { | |||
return util.addressToScript(rpcResults.validateaddress.address); | |||
})(); | |||
|
|||
options.testnet = rpcResults.getinfo.testnet; | |||
options.protocolVersion = rpcResults.getinfo.protocolversion; | |||
options.testnet = (rpcResults.getblockchaininfo.chain === "test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parenthesis here aren't necessary.
lib/pool.js
Outdated
@@ -597,6 +598,14 @@ var pool = module.exports = function pool(options, authorizeFn) { | |||
|
|||
result.response.securenodes = (subsidy.securenodes || 0); | |||
result.response.supernodes = (subsidy.supernodes || 0); | |||
// SafeCash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the alignment here?
lib/transactions.js
Outdated
@@ -127,6 +127,40 @@ exports.createGeneration = (blockHeight, blockReward, feeReward, recipients, poo | |||
scriptFoundersCompile(foundersAddrHash), | |||
Math.round(blockReward * (coin.percentTreasuryReward / 100)) | |||
) | |||
} else if (coin.payAllFounders === true){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the alignment here? I'm also seeing some lines mixing spaces and tabs. We use 4 spaces for each tab.
Converted blockReward to consistantly be an object
Safecash tested and working. Still need to test other coins. |
Hello, can you provide a list of all the lib files that you finally fixed? I am testing a new coin now and I have a problem. 2018-09-14 04:50:39 [Payments] [rco] Could not parse rpc data from daemon instance 0 |
@egyptianbman zen, zero, and genesis all tested and working. Finding blocks on testnet. Will be testing xsg here soon. |
@egyptianbman xsg testnet okay. found blocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been tested and is working. Approving.
xsg tested. zen tested. zero tested. Genesis tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So sorry for the delay. Everything looks good but one minor potential bug.
This commit adds SafeCash support, has some minor changes to messages to make debugging easier and also updates the "getinfo" API usage to the newer calls.
This commit adds SafeCash (Testnet) support, has some minor changes to messages to make debugging easier and also updates the "getinfo" API usage to the newer calls.