Impl account creation auth endpoints

This commit is contained in:
Arnau B
2020-10-21 16:40:31 +02:00
parent 721e5e8bf0
commit ede6c33a18
10 changed files with 271 additions and 26 deletions

View File

@@ -46,7 +46,13 @@ func (l2db *L2DB) DB() *sqlx.DB {
// AddAccountCreationAuth inserts an account creation authorization into the DB
func (l2db *L2DB) AddAccountCreationAuth(auth *common.AccountCreationAuth) error {
return meddler.Insert(l2db.db, "account_creation_auth", auth)
// return meddler.Insert(l2db.db, "account_creation_auth", auth)
_, err := l2db.db.Exec(
`INSERT INTO account_creation_auth (eth_addr, bjj, signature)
VALUES ($1, $2, $3);`,
auth.EthAddr, auth.BJJ, auth.Signature,
)
return err
}
// GetAccountCreationAuth returns an account creation authorization into the DB