Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stat committed Jan 17, 2025
1 parent de5979b commit b445e20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ This tool checks the reputation of an address on a given network. It takes:
*/
export const AddressReputationInput = z
.object({
network: z
.string()
.describe("The network to check the address on"),
address: z
.string()
.regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address format")
.describe("The Ethereum address to check"),
network: z.string().describe("The network to check the address on"),
})
.strip()
.describe("Input schema for address reputation check");
Expand All @@ -37,7 +35,7 @@ export async function checkAddressReputation(
args: z.infer<typeof AddressReputationInput>,
): Promise<string> {
try {
const address = new Address(args.address, args.network);
const address = new Address(args.network, args.address);
const reputation = await address.reputation();
return reputation.toString();
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe("Address Reputation Action", () => {
});

it("should successfully check address reputation", async () => {
// TODO: ask John if there is a better way...
const mockReputation = {
score: 85,
metadata: {
Expand All @@ -68,6 +67,7 @@ describe("Address Reputation Action", () => {
ens_contract_interactions: 2,
smart_contract_deployments: 1,
},
// TODO: ask John if there is a better way...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as unknown as jest.Mocked<any>;

Expand All @@ -81,7 +81,6 @@ describe("Address Reputation Action", () => {
const action = new AddressReputationAction();
const response = await action.func(args);

console.log(mockReputation.toString());
expect(response).toBe(mockReputation.toString());
});

Expand Down

0 comments on commit b445e20

Please sign in to comment.