Skip to content

Commit

Permalink
Fix byron v1 witnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBenc committed Mar 2, 2021
1 parent c489661 commit 5f17071
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/frontend/wallet/shelley/shelley-js-crypto-provider.ts
@@ -1,6 +1,12 @@
/* eslint-disable no-use-before-define */
/* eslint-disable camelcase */
import {sign as signMsg, derivePrivate, xpubToHdPassphrase} from 'cardano-crypto.js'
import {
sign as signMsg,
derivePrivate,
xpubToHdPassphrase,
base58,
getBootstrapAddressAttributes,
} from 'cardano-crypto.js'
import {encode} from 'borc'

import HdNode, {_HdNode} from '../helpers/hd-node'
Expand Down Expand Up @@ -99,9 +105,8 @@ CryptoProviderParams): Promise<CryptoProvider> => {
const xpub = await deriveXpub(path)
const publicKey = xpub2pub(xpub)
const chainCode = xpub2ChainCode(xpub)
// TODO: we should get address addresses from cardano-crypto
// but for some reason it returns something invalid for testnet
const addressAttributes = encode({})
// TODO: check if this works for testnet, apparently it doesnt
const addressAttributes = encode(getBootstrapAddressAttributes(base58.decode(address)))
return {publicKey, signature, chainCode, addressAttributes}
}

Expand Down

0 comments on commit 5f17071

Please sign in to comment.