mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 11:56:46 +01:00
Add ProcessTxs send fees to Coordinator accounts
This commit is contained in:
@@ -2,6 +2,7 @@ package statedb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
ethCommon "github.com/ethereum/go-ethereum/common"
|
||||
@@ -108,6 +109,18 @@ func (s *StateDB) GetIdxByEthAddrBJJ(addr ethCommon.Address, pk *babyjub.PublicK
|
||||
return common.Idx(0), ErrToIdxNotFound
|
||||
}
|
||||
|
||||
func (s *StateDB) getTokenIDsFromIdxs(idxs []common.Idx) (map[common.TokenID]common.Idx, error) {
|
||||
m := make(map[common.TokenID]common.Idx)
|
||||
for i := 0; i < len(idxs); i++ {
|
||||
a, err := s.GetAccount(idxs[i])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("getTokenIDsFromIdxs error on GetAccount with Idx==%d: %s", idxs[i], err.Error())
|
||||
}
|
||||
m[a.TokenID] = idxs[i]
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func siblingsToZKInputFormat(s []*merkletree.Hash) []*big.Int {
|
||||
b := make([]*big.Int, len(s))
|
||||
for i := 0; i < len(s); i++ {
|
||||
|
||||
Reference in New Issue
Block a user