1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 20:58:39 -04:00

Lay groundwork and move sessions to 'store'

This commit is contained in:
2017-12-06 21:09:47 -05:00
parent 6bdde8e83b
commit c452984f23
18 changed files with 286 additions and 158 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"errors"
"github.com/aclindsa/moneygo/internal/models"
"github.com/aclindsa/moneygo/internal/store/db"
"github.com/yuin/gopher-lua"
"math/big"
"strings"
@ -16,7 +17,7 @@ func luaContextGetAccounts(L *lua.LState) (map[int64]*models.Account, error) {
ctx := L.Context()
tx, ok := ctx.Value(dbContextKey).(*Tx)
tx, ok := ctx.Value(dbContextKey).(*db.Tx)
if !ok {
return nil, errors.New("Couldn't find tx in lua's Context")
}
@ -150,7 +151,7 @@ func luaAccountBalance(L *lua.LState) int {
a := luaCheckAccount(L, 1)
ctx := L.Context()
tx, ok := ctx.Value(dbContextKey).(*Tx)
tx, ok := ctx.Value(dbContextKey).(*db.Tx)
if !ok {
panic("Couldn't find tx in lua's Context")
}