-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- create task with specific wallet - list task by the smart wallet - return all task data in list
- Loading branch information
Showing
9 changed files
with
301 additions
and
305 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
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,26 @@ | ||
package taskengine | ||
|
||
import ( | ||
"github.com/AvaProtocol/ap-avs/model" | ||
"github.com/AvaProtocol/ap-avs/storage" | ||
"github.com/ethereum/go-ethereum/common" | ||
) | ||
|
||
func ValidWalletAddress(address string) bool { | ||
return common.IsHexAddress(address) | ||
} | ||
|
||
func ValidWalletOwner(db storage.Storage, u *model.User, smartWalletAddress common.Address) (bool, error) { | ||
// the smart wallet adress is the default one | ||
if u.Address.Hex() == smartWalletAddress.Hex() { | ||
return true, nil | ||
} | ||
|
||
// not default, look up in our storage | ||
exists, err := db.Exist([]byte(WalletStorageKey(u.Address, smartWalletAddress.Hex()))) | ||
if exists { | ||
return true, nil | ||
} | ||
|
||
return false, err | ||
} |
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
Oops, something went wrong.