(count uint32, profiles []*types.SQLChainProfile)
| 83 | } |
| 84 | |
| 85 | func (bs *BusService) updateState(count uint32, profiles []*types.SQLChainProfile) { |
| 86 | bs.lock.Lock() |
| 87 | defer bs.lock.Unlock() |
| 88 | var ( |
| 89 | rebuilt = make(map[proto.DatabaseID]*types.SQLChainProfile) |
| 90 | sqlchainState = make(map[proto.DatabaseID]map[proto.AccountAddress]*types.PermStat) |
| 91 | ) |
| 92 | for _, v := range profiles { |
| 93 | rebuilt[v.ID] = v |
| 94 | sqlchainState[v.ID] = make(map[proto.AccountAddress]*types.PermStat) |
| 95 | for _, user := range v.Users { |
| 96 | sqlchainState[v.ID][user.Address] = &types.PermStat{ |
| 97 | Permission: user.Permission, |
| 98 | Status: user.Status, |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | atomic.StoreUint32(&bs.blockCount, count) |
| 103 | bs.sqlChainProfiles = rebuilt |
| 104 | bs.sqlChainState = sqlchainState |
| 105 | } |
| 106 | |
| 107 | func (bs *BusService) subscribeBlock(ctx context.Context) { |
| 108 | defer bs.wg.Done() |
no outgoing calls
no test coverage detected