(ctx contractapi.TransactionContextInterface)
| 255 | } |
| 256 | |
| 257 | func (s *SmartContract) GetCompanies(ctx contractapi.TransactionContextInterface) ([]Company, error) { |
| 258 | count, err := currentID(ctx, companyCounterKey) |
| 259 | if err != nil { |
| 260 | return nil, err |
| 261 | } |
| 262 | companies := make([]Company, 0, count) |
| 263 | for id := 0; id < count; id++ { |
| 264 | company, err := readCompany(ctx, id) |
| 265 | if err != nil { |
| 266 | return nil, err |
| 267 | } |
| 268 | companies = append(companies, *company) |
| 269 | } |
| 270 | return companies, nil |
| 271 | } |
| 272 | |
| 273 | // GetCompanys keeps the historical example name available. |
| 274 | func (s *SmartContract) GetCompanys(ctx contractapi.TransactionContextInterface) ([]Company, error) { |
no test coverage detected