Browse Source

test

hosting-provider
Evan Feenstra 5 years ago
parent
commit
4dc6e5b2da
  1. 2
      api/utils/signer.ts
  2. 2
      dist/api/utils/signer.js
  3. 2
      dist/api/utils/signer.js.map

2
api/utils/signer.ts

@ -70,12 +70,14 @@ export const signBuffer = (msg) => {
function verifyMessage(msg,sig,pubkey): Promise<{[k:string]:any}> { function verifyMessage(msg,sig,pubkey): Promise<{[k:string]:any}> {
return new Promise(async(resolve, reject)=> { return new Promise(async(resolve, reject)=> {
let signer = await loadSigner() let signer = await loadSigner()
console.log('verifyMessage signer,',signer)
try { try {
const options = { const options = {
msg:ByteBuffer.fromHex(msg), msg:ByteBuffer.fromHex(msg),
signature:sig, signature:sig,
pubkey:ByteBuffer.fromHex(pubkey), pubkey:ByteBuffer.fromHex(pubkey),
} }
console.log("OPSP",options,signer.verifyMessage)
signer.verifyMessage(options, function(err,res){ signer.verifyMessage(options, function(err,res){
if(err) { if(err) {
reject(err) reject(err)

2
dist/api/utils/signer.js

@ -80,12 +80,14 @@ exports.signBuffer = (msg) => {
function verifyMessage(msg, sig, pubkey) { function verifyMessage(msg, sig, pubkey) {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
let signer = yield exports.loadSigner(); let signer = yield exports.loadSigner();
console.log('verifyMessage signer,', signer);
try { try {
const options = { const options = {
msg: ByteBuffer.fromHex(msg), msg: ByteBuffer.fromHex(msg),
signature: sig, signature: sig,
pubkey: ByteBuffer.fromHex(pubkey), pubkey: ByteBuffer.fromHex(pubkey),
}; };
console.log("OPSP", options, signer.verifyMessage);
signer.verifyMessage(options, function (err, res) { signer.verifyMessage(options, function (err, res) {
if (err) { if (err) {
reject(err); reject(err);

2
dist/api/utils/signer.js.map

@ -1 +1 @@
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../api/utils/signer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,6BAA4B;AAC5B,2CAA2C;AAC3C,6B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