paypro: example - remove some comments.
This commit is contained in:
parent
253d66994c
commit
1e57a6d874
@ -5,7 +5,7 @@
|
|||||||
The node payment protocol demonstration will run automatically via:
|
The node payment protocol demonstration will run automatically via:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
$ node examples/PayPro`
|
$ node examples/PayPro
|
||||||
```
|
```
|
||||||
|
|
||||||
You will see the server and customer logs output in the terminal.
|
You will see the server and customer logs output in the terminal.
|
||||||
|
|||||||
@ -147,23 +147,19 @@ app.get('/-/request', function(req, res, next) {
|
|||||||
|
|
||||||
// Instead of creating it ourselves:
|
// Instead of creating it ourselves:
|
||||||
// if (!argv.pubkey && !argv.privkey && !argv.address) {
|
// if (!argv.pubkey && !argv.privkey && !argv.address) {
|
||||||
// argv.pubkey = '3730febcba04bad0cd476cfb820f9c37d7466fd9';
|
// //argv.pubkey = '3730febcba04bad0cd476cfb820f9c37d7466fd9';
|
||||||
|
// argv.pubkey = 'd96f46d7379c0f82fb6c47cdd0ba04babcfe3037'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (argv.pubkey || argv.privkey || argv.address) {
|
if (argv.pubkey || argv.privkey || argv.address) {
|
||||||
var pubKey;
|
var pubKey;
|
||||||
if (argv.pubkey) {
|
if (argv.pubkey) {
|
||||||
pubKey = new Buffer(argv.pubkey, 'hex');
|
pubKey = new Buffer(argv.pubkey, 'hex');
|
||||||
// If it were possible:
|
|
||||||
// pubKey = bitcore.Script.fromCompressedPubKey(new Buffer(argv.pubkey)).toCompressedPubKey();
|
|
||||||
} else if (argv.privkey) {
|
} else if (argv.privkey) {
|
||||||
pubKey = bitcore.Key.recoverPubKey(new Buffer(argv.privkey)).toCompressedPubKey();
|
pubKey = bitcore.Key.recoverPubKey(new Buffer(argv.privkey)).toCompressedPubKey();
|
||||||
} else if (argv.address) {
|
} else if (argv.address) {
|
||||||
pubKey = bitcore.Base58Check.decode(new Buffer(argv.address));
|
pubKey = bitcore.Base58Check.decode(new Buffer(argv.address));
|
||||||
// pubKey = bitcore.Script.fromUncompressedPubKey(pubKey).toCompressedPubKey();
|
|
||||||
}
|
}
|
||||||
// var pubKeyHash = bitcore.util.sha256ripe160(pubKey);
|
|
||||||
// var address = new bitcore.Address(111, pubKeyHash);
|
|
||||||
var address = bitcore.Address.fromPubKey(pubKey, 'testnet');
|
var address = bitcore.Address.fromPubKey(pubKey, 'testnet');
|
||||||
var scriptPubKey = address.getScriptPubKey();
|
var scriptPubKey = address.getScriptPubKey();
|
||||||
assert.equal(scriptPubKey.isPubkeyHash(), true);
|
assert.equal(scriptPubKey.isPubkeyHash(), true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user