Skip to content

Commit

Permalink
Migrate web3 to most recent format
Browse files Browse the repository at this point in the history
  • Loading branch information
actuallymentor committed Jan 19, 2024
1 parent f5672a3 commit be49646
Show file tree
Hide file tree
Showing 6 changed files with 9,560 additions and 70 deletions.
9 changes: 0 additions & 9 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"hosting": {
"port": 5000
},
"pubsub": {
"port": 8085
},
"ui": {
"enabled": true
},
Expand Down
2 changes: 1 addition & 1 deletion functions/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
18
6 changes: 3 additions & 3 deletions functions/modules/web3/cryptography.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const Web3 = require( 'web3' )
const { log } = require( '../helpers' )
const web3 = new Web3()

const { recover } = require( 'web3-eth-accounts' )

exports.decode_signature_object = function( { claimed_message, signed_message, claimed_signatory } ) {

// Decode message
const confirmed_signatory = web3.eth.accounts.recover( claimed_message, signed_message )
const confirmed_signatory = recover( claimed_message, signed_message )

// If the signature does not belongs to the claimed signatory, reject
log( `Comparing claimed signatory ${ claimed_signatory } to confirmed signatory ${ confirmed_signatory }` )
Expand Down
Loading

0 comments on commit be49646

Please sign in to comment.