-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clear module when switching piloted account (#463)
* fix: make sure to clear the module input when the pilot address changes * chore: create some test utils
- Loading branch information
1 parent
57352e6
commit 14bf6d9
Showing
5 changed files
with
86 additions
and
2 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
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,30 @@ | ||
import type { HexAddress } from '@/types' | ||
import { | ||
AccountType, | ||
ConnectionType, | ||
formatPrefixedAddress, | ||
type Waypoint, | ||
} from 'ser-kit' | ||
import { randomAddress, randomPrefixedAddress } from './randomHex' | ||
|
||
type CreateRoleWaypointOptions = { | ||
moduleAddress?: HexAddress | ||
} | ||
|
||
export const createRoleWaypoint = ({ | ||
moduleAddress = randomAddress(), | ||
}: CreateRoleWaypointOptions = {}): Waypoint => ({ | ||
account: { | ||
type: AccountType.ROLES, | ||
address: moduleAddress, | ||
prefixedAddress: formatPrefixedAddress(1, moduleAddress), | ||
chain: 1, | ||
multisend: [], | ||
version: 2, | ||
}, | ||
connection: { | ||
from: randomPrefixedAddress(), | ||
type: ConnectionType.IS_MEMBER, | ||
roles: [], | ||
}, | ||
}) |
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,14 @@ | ||
import { AccountType, type StartingPoint } from 'ser-kit' | ||
import { randomAddress, randomPrefixedAddress } from './randomHex' | ||
|
||
export const createStartingWaypoint = ({ | ||
account, | ||
}: Partial<StartingPoint> = {}): StartingPoint => ({ | ||
account: { | ||
address: randomAddress(), | ||
prefixedAddress: randomPrefixedAddress(), | ||
type: AccountType.EOA, | ||
|
||
...account, | ||
}, | ||
}) |
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