CreateCompany registers a company.
(ctx contractapi.TransactionContextInterface, name string)
| 78 | |
| 79 | // CreateCompany registers a company. |
| 80 | func (s *SmartContract) CreateCompany(ctx contractapi.TransactionContextInterface, name string) (*Company, error) { |
| 81 | id, err := nextID(ctx, companyCounterKey) |
| 82 | if err != nil { |
| 83 | return nil, err |
| 84 | } |
| 85 | company := &Company{ID: id, Name: name} |
| 86 | if err := putJSON(ctx, companyKey(id), company); err != nil { |
| 87 | return nil, err |
| 88 | } |
| 89 | return company, nil |
| 90 | } |
| 91 | |
| 92 | // IssueCoin increases the central-bank supply. |
| 93 | func (s *SmartContract) IssueCoin(ctx contractapi.TransactionContextInterface, amount string) (*Transaction, error) { |
nothing calls this directly
no test coverage detected