Skip to content

Commit

Permalink
add check for hex string
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardmack committed Jul 19, 2022
1 parent f10020f commit aaf8fa4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/polkadotjs_test/test/test-polkadot.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ describe('Testing polkadot.js/api calls:', function () {
api.rpc.state.queryStorage(["0x1cb6f36e027abb2091cfb5110ab5087f06155b3cd9a8c9e5e9a23fd5dc13a5ed",
"0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80"], block0Hash);
expect(value).to.be.not.null;
const hexString = /^(0x|0X)?[a-fA-F0-9]+$/
value.forEach(item => {
expect(item[0]).to.have.lengthOf(32);
expect(item[0]).to.match( hexString );
expect(item[1]).to.have.lengthOf(2);
});
expect(value[0][0]).to.deep.equal(block0Hash);
Expand All @@ -204,3 +206,6 @@ describe('Testing polkadot.js/api calls:', function () {
});
});
});
var myRegExp = function (){
return /.*/;
}

0 comments on commit aaf8fa4

Please sign in to comment.