Skip to content

Commit

Permalink
Test to fix (#5224)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson committed May 9, 2023
1 parent eaca38e commit 4239272
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/jobs/test-audius-cmd.yml
Expand Up @@ -38,4 +38,4 @@ steps:
- run:
name: audius-cmd test
no_output_timeout: 30m
command: . ~/.profile; sleep inf
command: . ~/.profile; audius-compose up -w && sleep 60 && audius-cmd test
1 change: 0 additions & 1 deletion dev-tools/commands/src/create-user.mjs
Expand Up @@ -12,7 +12,6 @@ program.command("create-user")
.option("-e, --email <email>", "The email for the new user (chosen randomly if not specified)")
.action(async (handle, { password, email }) => {
const audiusLibs = await initializeAudiusLibs();
await audiusLibs.Account.logout();

const rand = randomBytes(2).toString("hex").padStart(4, "0").toUpperCase();

Expand Down
11 changes: 8 additions & 3 deletions dev-tools/commands/src/utils.mjs
@@ -1,5 +1,5 @@
import { Utils as AudiusUtils, sdk as AudiusSdk, libs as AudiusLibs } from "@audius/sdk";
import { PublicKey } from "@solana/web3.js";
import { Utils as AudiusUtils, sdk as AudiusSdk, libs as AudiusLibs } from "@audius/sdk"
import { PublicKey } from "@solana/web3.js"

export const initializeAudiusLibs = async (handle) => {
const audiusLibs = new AudiusLibs({
Expand Down Expand Up @@ -38,15 +38,20 @@ export const initializeAudiusLibs = async (handle) => {
enableUserReplicaSetManagerContract: true,
});

// This is a bad solution
await audiusLibs.init();
await audiusLibs.Account.logout();
await audiusLibs.localStorage.removeItem("hedgehog-entropy-key")

if (handle) {
audiusLibs.localStorage.setItem(
await audiusLibs.localStorage.setItem(
"hedgehog-entropy-key",
audiusLibs.localStorage.getItem(`handle-${handle}`),
);
}

await audiusLibs.init();

return audiusLibs;
};

Expand Down

0 comments on commit 4239272

Please sign in to comment.