Skip to content

Commit

Permalink
chore: sudo policy fallback for empty rules
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Jan 16, 2025
1 parent fa4b52d commit 3b6a9a1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @biconomy/sdk

## 0.0.28

### Patch Changes

- Sudo fallback for empty rules

## 0.0.27

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@biconomy/sdk",
"version": "0.0.27",
"version": "0.0.28",
"author": "Biconomy",
"repository": "github:bcnmy/sdk",
"main": "./dist/_cjs/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export const getPermissionAction = async ({
// })
// policyData.push(timeFramePolicyData)

if (actionPolicyInfo.rules && actionPolicyInfo.rules.length > 0) {
const hasValidRules =
actionPolicyInfo?.rules && actionPolicyInfo?.rules?.length > 0

if (hasValidRules) {
const actionConfig = createActionConfig(
actionPolicyInfo.rules ?? [],
actionPolicyInfo.valueLimit
Expand All @@ -100,7 +103,7 @@ export const getPermissionAction = async ({
}

// create sudo policy here..
if (actionPolicyInfo.sudo) {
if (actionPolicyInfo.sudo || !hasValidRules) {
const sudoPolicy = getSudoPolicy()
policyData.push(sudoPolicy)
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import type { TestFileNetworkType } from "./testSetup"
config()

const BASE_SEPOLIA_RPC_URL =
"https://virtual.base-sepolia.rpc.tenderly.co/6ccdd33d-d8f4-4476-8d37-63ba0ed0ea8f"
"https://virtual.base-sepolia.rpc.tenderly.co/25344426-d008-45d9-ac9f-93910c696110"

type AnvilInstance = ReturnType<typeof anvil>
type BundlerInstance = ReturnType<typeof alto>
Expand Down

0 comments on commit 3b6a9a1

Please sign in to comment.