1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

Use prefix on checksum.

This commit is contained in:
Pedro Gutiérrez 2019-05-27 19:28:31 +02:00 committed by Pedro Gutiérrez
parent d7e572c646
commit 7f0d50691c
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ export class DDO {
this.id,
]
return Web3Provider.getWeb3().utils.sha3(values.join("")).replace(/^0x([a-f0-9]{64})(:!.+)?$/i, "$1")
return Web3Provider.getWeb3().utils.sha3(values.join("")).replace(/^0x([a-f0-9]{64})(:!.+)?$/i, "0x$1")
}
/**

View File

@ -238,7 +238,7 @@ describe("DDO", () => {
const ddo = new DDO(testDDO)
const checksum = ddo.getChecksum()
assert.equal(checksum, "15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b")
assert.equal(checksum, "0x15f27a7a3c7b15d2b06dec7347c6b8da168adddd7df51a8ebbbe87b59b80049b")
})
})