-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34fdbf0
commit b96ed43
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,19 +182,23 @@ describe('Testing MsgEditValidator', function () { | |
); | ||
}); | ||
|
||
it('should throw Error when the `commission_rate` field is missing', function () { | ||
it('should NOT throw Error when the `commission_rate` field is missing', function () { | ||
const json = | ||
'{"@type":"/cosmos.staking.v1beta1.MsgEditValidator","description":{"moniker":"hiteshTest","identity":"","website":"","security_contact":"[email protected]","details":""},"validator_address":"tcrocncl1j7pej8kplem4wt50p4hfvndhuw5jprxxxtenvr","min_self_delegation":"1"}'; | ||
expect(() => cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet)).to.throw( | ||
expect(() => cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet)).to.not.throw( | ||
'Expected `commissionRate` to be of type `null` but received type `undefined` in object `options`', | ||
); | ||
const msgEdit = cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet); | ||
expect(msgEdit.commissionRate).to.be.null; | ||
}); | ||
it('should throw Error when the `min_self_delegation` field is missing', function () { | ||
it('should NOT throw Error when the `min_self_delegation` field is missing', function () { | ||
const json = | ||
'{"@type":"/cosmos.staking.v1beta1.MsgEditValidator","description":{"moniker":"hiteshTest","identity":"","website":"","security_contact":"[email protected]","details":""},"validator_address":"tcrocncl1j7pej8kplem4wt50p4hfvndhuw5jprxxxtenvr","commission_rate":"0.100000000000000000"}'; | ||
expect(() => cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet)).to.throw( | ||
expect(() => cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet)).to.not.throw( | ||
'Expected `minSelfDelegation` to be of type `null` but received type `undefined` in object `options`', | ||
); | ||
const msgEdit = cro.staking.MsgEditValidator.fromCosmosMsgJSON(json, CroNetwork.Testnet); | ||
expect(msgEdit.minSelfDelegation).to.be.null; | ||
}); | ||
|
||
it('should return the MsgEditValidator corresponding to the JSON', function () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters