Skip to content

Commit 1f93601

Browse files
authored
Merge pull request #45 from rarimo/fix/abstraction-account
Fix/abstraction account
2 parents 20b79a1 + 7326a64 commit 1f93601

File tree

5 files changed

+1584
-1532
lines changed

5 files changed

+1584
-1532
lines changed

internal/config/abstraction.go renamed to internal/config/extended_accounts.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/ethereum/go-ethereum/common"
1414
"github.com/ethereum/go-ethereum/ethclient"
1515
vaultapi "github.com/hashicorp/vault/api"
16-
accountFactory "github.com/rarimo/geo-points-svc/internal/contracts/abstractionaccountfactory"
16+
accountFactory "github.com/rarimo/geo-points-svc/internal/contracts/extendedaccountfactory"
1717
pointTokens "github.com/rarimo/geo-points-svc/internal/contracts/points"
1818

1919
"gitlab.com/distributed_lab/dig"
@@ -107,12 +107,12 @@ func (r *AbstractionConfig) CreateAccount(ctx context.Context, nullifier [32]byt
107107
return common.Address{}, fmt.Errorf("failed to get keyed transactor: %w", err)
108108
}
109109

110-
accountFactoryInstance, err := accountFactory.NewAbstractionAccountFactory(r.AccountFactory, r.RPC)
110+
accountFactoryInstance, err := accountFactory.NewExtendedAccountFactory(r.AccountFactory, r.RPC)
111111
if err != nil {
112112
return common.Address{}, fmt.Errorf("failed to get account factory: %w", err)
113113
}
114114

115-
tx, err := accountFactoryInstance.DeployAbstractionAccount(signerOpts, nullifier)
115+
tx, err := accountFactoryInstance.DeployAbstractAccount(signerOpts, nullifier)
116116
if err != nil {
117117
return common.Address{}, fmt.Errorf("failed to deploy abstraction account: %w", err)
118118
}
@@ -125,20 +125,20 @@ func (r *AbstractionConfig) CreateAccount(ctx context.Context, nullifier [32]byt
125125
return common.Address{}, fmt.Errorf("failed to wait mined transaction: %w", err)
126126
}
127127

128-
abi, err := accountFactory.AbstractionAccountFactoryMetaData.GetAbi()
128+
abi, err := accountFactory.ExtendedAccountFactoryMetaData.GetAbi()
129129
if err != nil {
130130
return common.Address{}, fmt.Errorf("failed to get contract abi: %w", err)
131131
}
132132

133-
abstractionAccountDeployedTopic := abi.Events["AbstractionAccountDeployed"].ID
133+
abstractionAccountDeployedTopic := abi.Events["AbstractAccountDeployed"].ID
134134

135-
var event *accountFactory.AbstractionAccountFactoryAbstractionAccountDeployed
135+
var event *accountFactory.ExtendedAccountFactoryAbstractAccountDeployed
136136
for _, log := range rec.Logs {
137137
if !bytes.Equal(log.Topics[0][:], abstractionAccountDeployedTopic[:]) {
138138
continue
139139
}
140140

141-
event, err = accountFactoryInstance.ParseAbstractionAccountDeployed(*log)
141+
event, err = accountFactoryInstance.ParseAbstractAccountDeployed(*log)
142142
if err != nil {
143143
return common.Address{}, fmt.Errorf("failed to unpack log: %w", err)
144144
}
@@ -149,12 +149,12 @@ func (r *AbstractionConfig) CreateAccount(ctx context.Context, nullifier [32]byt
149149
}
150150

151151
func (r *AbstractionConfig) GetAccount(nullifier [32]byte) (common.Address, error) {
152-
accountFactoryInstance, err := accountFactory.NewAbstractionAccountFactory(r.AccountFactory, r.RPC)
152+
accountFactoryInstance, err := accountFactory.NewExtendedAccountFactory(r.AccountFactory, r.RPC)
153153
if err != nil {
154154
return common.Address{}, fmt.Errorf("failed to get account factory: %w", err)
155155
}
156156

157-
accountAddress, err := accountFactoryInstance.GetAbstractionAccount(nil, nullifier)
157+
accountAddress, err := accountFactoryInstance.GetAbstractAccount(nil, nullifier)
158158
if err != nil {
159159
return common.Address{}, fmt.Errorf("failed to get abstraction account: %w", err)
160160
}

0 commit comments

Comments
 (0)