Skip to content

Commit da00650

Browse files
authored
feat(smart_wallet): add GetStubSignature method (#478)
1 parent 0e9d695 commit da00650

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

pkg/smart_wallet/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"github.com/ethereum/go-ethereum/common"
77
)
88

9+
// TODO: rewrite using interface and implement it for each type
10+
911
// SmartWalletConfig represents the configuration
1012
// for the smart wallet to be used with the client.
1113
type Config struct {

pkg/smart_wallet/sig.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package smart_wallet
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ethereum/go-ethereum/common/hexutil"
7+
)
8+
9+
func GetStubSignature(swt Type) ([]byte, error) {
10+
switch swt {
11+
case SimpleAccountType, BiconomyType:
12+
return hexutil.Decode("0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c")
13+
case KernelType:
14+
return hexutil.Decode("0x00000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c")
15+
default:
16+
return nil, fmt.Errorf("unknown smart wallet type: %s", swt)
17+
}
18+
}

0 commit comments

Comments
 (0)