mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 03:46:52 +01:00
Refactor account creation auth endpoints
This commit is contained in:
@@ -55,7 +55,7 @@ func (l2db *L2DB) AddAccountCreationAuth(auth *common.AccountCreationAuth) error
|
||||
return err
|
||||
}
|
||||
|
||||
// GetAccountCreationAuth returns an account creation authorization into the DB
|
||||
// GetAccountCreationAuth returns an account creation authorization from the DB
|
||||
func (l2db *L2DB) GetAccountCreationAuth(addr ethCommon.Address) (*common.AccountCreationAuth, error) {
|
||||
auth := new(common.AccountCreationAuth)
|
||||
return auth, meddler.QueryRow(
|
||||
@@ -65,6 +65,16 @@ func (l2db *L2DB) GetAccountCreationAuth(addr ethCommon.Address) (*common.Accoun
|
||||
)
|
||||
}
|
||||
|
||||
// GetAccountCreationAuthAPI returns an account creation authorization from the DB
|
||||
func (l2db *L2DB) GetAccountCreationAuthAPI(addr ethCommon.Address) (*AccountCreationAuthAPI, error) {
|
||||
auth := new(AccountCreationAuthAPI)
|
||||
return auth, meddler.QueryRow(
|
||||
l2db.db, auth,
|
||||
"SELECT * FROM account_creation_auth WHERE eth_addr = $1;",
|
||||
addr,
|
||||
)
|
||||
}
|
||||
|
||||
// AddTx inserts a tx to the pool
|
||||
func (l2db *L2DB) AddTx(tx *PoolL2TxWrite) error {
|
||||
return meddler.Insert(l2db.db, "tx_pool", tx)
|
||||
|
||||
Reference in New Issue
Block a user