-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into DEVX-441/increase-test-coverage
- Loading branch information
Showing
9 changed files
with
133 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- develop | ||
- v4 | ||
- fix/SMA-682_docs-fix | ||
|
||
permissions: | ||
contents: write | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { PaymasterMode } from "@biconomy/paymaster"; | ||
import { TestData } from "../../../tests"; | ||
import { createSmartAccountClient } from "../../account/src/index"; | ||
import { Hex, encodeFunctionData, parseAbi } from "viem"; | ||
import { DEFAULT_MULTICHAIN_MODULE, createECDSAOwnershipValidationModule } from "@biconomy/modules"; | ||
|
||
describe("Account with ECDSAOwnershipValidationModule Module Tests", () => { | ||
let mumbai: TestData; | ||
let baseSepolia: TestData; | ||
|
||
beforeEach(() => { | ||
// @ts-ignore: Comes from setup-e2e-tests | ||
[mumbai, baseSepolia] = testDataPerChain; | ||
}); | ||
|
||
it("should create a ECDSAOwnershipValidationModule with signer", async () => { | ||
const { | ||
bundlerUrl, | ||
whale: { viemWallet: signer }, | ||
} = mumbai; | ||
|
||
const defaultValidationModule = await createECDSAOwnershipValidationModule({ signer }); | ||
// Should not require a signer or chainId | ||
const smartAccount = await createSmartAccountClient({ | ||
bundlerUrl, | ||
defaultValidationModule, | ||
signer, | ||
}); | ||
const address = await smartAccount.getAccountAddress(); | ||
expect(address).toBeTruthy(); | ||
expect(smartAccount.activeValidationModule).toEqual(defaultValidationModule); | ||
}); | ||
|
||
it("should create a ECDSAOwnershipValidationModule without signer", async () => { | ||
const { | ||
bundlerUrl, | ||
whale: { viemWallet: signer }, | ||
} = mumbai; | ||
|
||
const defaultValidationModule = await createECDSAOwnershipValidationModule({ signer }); | ||
// Should not require a signer or chainId | ||
const smartAccount = await createSmartAccountClient({ | ||
bundlerUrl, | ||
defaultValidationModule, | ||
}); | ||
const address = await smartAccount.getAccountAddress(); | ||
expect(address).toBeTruthy(); | ||
expect(smartAccount.activeValidationModule).toEqual(defaultValidationModule); | ||
}); | ||
|
||
it("should create a ECDSAOwnershipValidationModule by default, without explicitly setting it on the smart account", async () => { | ||
const { | ||
bundlerUrl, | ||
whale: { viemWallet: signer }, | ||
} = mumbai; | ||
const defaultValidationModule = await createECDSAOwnershipValidationModule({ signer }); | ||
const smartAccount = await createSmartAccountClient({ bundlerUrl, signer }); | ||
const address = await smartAccount.getAccountAddress(); | ||
expect(address).toBeTruthy(); | ||
const smartAccountValidationModuleAddress = await smartAccount.activeValidationModule.getAddress(); | ||
expect(smartAccountValidationModuleAddress).toEqual(defaultValidationModule.moduleAddress); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters