forked from Mozartted/ethr-did
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for base58 key encoding (uport-project#62)
also removed direct dependency on 'buffer' and 'elliptic' and enforced linting during build fixes uport-project#60
- Loading branch information
Showing
5 changed files
with
194 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,12 +1,70 @@ | ||
import { EthrDID } from '..' | ||
|
||
describe('other networks', () => { | ||
it('rsk - github #50', () => { | ||
it('supports rsk - github #50', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: '0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
chainNameOrId: 'rsk', | ||
}) | ||
expect(ethrDid.did).toEqual('did:ethr:rsk:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71') | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports rsk:testnet - github #50', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: '0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
chainNameOrId: 'rsk:testnet', | ||
}) | ||
expect(ethrDid.did).toEqual( | ||
'did:ethr:rsk:testnet:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71' | ||
) | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports rsk as did string', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: 'did:ethr:rsk:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
}) | ||
expect(ethrDid.did).toEqual('did:ethr:rsk:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71') | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports rsk:testnet as did string', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: 'did:ethr:rsk:testnet:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
}) | ||
expect(ethrDid.did).toEqual( | ||
'did:ethr:rsk:testnet:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71' | ||
) | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports rsk:testnet:custom:params as did string', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: | ||
'did:ethr:rsk:testnet:custom:params:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
}) | ||
expect(ethrDid.did).toEqual( | ||
'did:ethr:rsk:testnet:custom:params:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71' | ||
) | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports hexstring chainId', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: '0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
chainNameOrId: '0x3', | ||
}) | ||
expect(ethrDid.did).toEqual('did:ethr:0x3:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71') | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
|
||
it('supports numbered chainId', () => { | ||
const ethrDid = new EthrDID({ | ||
identifier: '0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71', | ||
chainNameOrId: 42, | ||
}) | ||
expect(ethrDid.did).toEqual('did:ethr:0x2a:0x02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71') | ||
expect(ethrDid.address).toEqual('0xC662e6c5F91B9FcD22D7FcafC80Cf8b640aed247') | ||
}) | ||
}) |
Oops, something went wrong.