Skip to content

Commit 31eec10

Browse files
improvement: accept ps2h for proposals
1 parent 1c00ff0 commit 31eec10

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

lib/errors/spec.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ module.exports = [
9191
name: 'invalidAddress',
9292
message: 'Invalid Address',
9393
},
94-
{
95-
name: 'invalidP2SHAddress',
96-
message: 'Invalid P2SHAddress',
97-
},
9894
{
9995
name: 'invalidPayment',
10096
message: 'Invalid Payment Amount',
@@ -125,10 +121,6 @@ module.exports = [
125121
name: 'invalidAddresses',
126122
message: 'Invalid Payment Addresses',
127123
},
128-
{
129-
name: 'invalidP2SHAddresses',
130-
message: 'Invalid P2SH Payment Addresses',
131-
},
132124
{
133125
name: 'invalidPaymentAmounts',
134126
message: 'Invalid Payment Amounts',

lib/govobject/types/proposal.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ Proposal.prototype.getSerializationError = function (opts) {
151151
return new errors.GovObject.Proposal.invalidAddress();
152152
}
153153

154-
// verify not P2SH
155-
if (this._verifyPayToScriptHash(this.payment_address, this.network)) {
156-
return new errors.GovObject.Proposal.invalidP2SHAddress();
157-
}
158-
159154
// verify payment amount (should be non-negative number)
160155
if (this._verifyPayment(this.payment_amount)) {
161156
return new errors.GovObject.Proposal.invalidPayment();

lib/govobject/types/trigger.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ Trigger.prototype.getSerializationError = function (opts) {
152152
if (!self._verifyAddress(addr, self.network)) {
153153
return new errors.GovObject.Trigger.invalidAddresses();
154154
}
155-
// verify not P2SH
156-
if (self._verifyPayToScriptHash(addr, self.network)) {
157-
return new errors.GovObject.Trigger.invalidP2SHAddresses();
158-
}
159155
});
160156

161157
// verify payment amounts (should be non-negative number)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dashevo/dashcore-lib",
3-
"version": "0.19.41",
3+
"version": "0.19.42",
44
"description": "A pure and powerful JavaScript Dash library.",
55
"author": "Dash Core Group, Inc. <dev@dash.org>",
66
"main": "index.js",

test/govobject/types/proposal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('Proposal', function () {
134134
}).to.throw(errors.GovObject.Proposal.invalidAddress);
135135
});
136136

137-
it('should throw error if payment address is P2SH', function () {
137+
it('should not throw error if payment address is P2SH', function () {
138138
var proposal = new Proposal();
139139

140140
proposal.network = 'testnet';
@@ -158,10 +158,10 @@ describe('Proposal', function () {
158158

159159
expect(function () {
160160
return proposal.serialize();
161-
}).to.throw(errors.GovObject.Proposal.invalidP2SHAddress);
161+
}).to.not.throw();
162162
expect(function () {
163163
return proposal2.serialize();
164-
}).to.throw(errors.GovObject.Proposal.invalidP2SHAddress);
164+
}).to.not.throw();
165165
});
166166

167167
it('should throw error if amount <= 0', function () {

0 commit comments

Comments
 (0)