!626 增加HUKS attestkey API Mock

Merge pull request !626 from CheungVane/master
This commit is contained in:
openharmony_ci
2022-08-08 13:35:15 +00:00
committed by Gitee
@@ -527,6 +527,18 @@ export function mockHuks() {
})
}
},
attestKey: function (...args) {
console.warn("huks.attestKey interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
const len = args.length
if (typeof args[len - 1] === 'function') {
args[len - 1].call(this, paramMock.businessErrorMock, HuksResult)
} else {
return new Promise((resolve, reject) => {
resolve(HuksResult)
})
}
},
getSdkVersion: function (...args) {
console.warn("huks.getSdkVersion interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")