Skip to content

Commit

Permalink
Add all msgs to account tangle properly in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Mar 23, 2024
1 parent 9bcf616 commit 43b8762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ function initDB(peer, config) {
if (!msg?.data) continue
/** @type {AccountData} */
const data = msg.data
console.log('data', data)
if (data.action === 'add') {
const purpose = data.key?.purpose
if (purpose !== 'sig' && purpose !== 'shs-and-sig') continue
Expand All @@ -422,7 +421,6 @@ function initDB(peer, config) {
sigkeys.delete(data.key.bytes)
}
}
console.log('sigkeys', sigkeys)
return sigkeys
}

Expand Down
9 changes: 4 additions & 5 deletions test/account-add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ test('account.add()', async (t) => {

await t.test(
"Can't publish with a key if the key has been del'd",
async (t) => {
async () => {
rimraf.sync(DIR)

const keypair1 = Keypair.generate('ed25519', 'alice')
Expand Down Expand Up @@ -243,15 +243,14 @@ test('account.add()', async (t) => {
})
const postMootRec = peer.db.feed.findMoot(account, 'post')

const accountRoot = peer.db.get(account)

const tangle = new MsgV4.Tangle(account)
tangle.add(account, accountRoot)
tangle.add(account, accountMsg0)
tangle.add(accountRec1.id, accountRec1.msg)
// can't publish() account msgs. and creating this manually for now until we have a .del() fn
const delMsg = MsgV4.create({
account: 'self',
accountTips: null,
domain: accountRoot.metadata.domain,
domain: accountMsg0.metadata.domain,
keypair: keypair1,
tangles: {
[account]: tangle,
Expand Down

0 comments on commit 43b8762

Please sign in to comment.