MCPcopy
hub / github.com/yeasy/blockchain_guide / putHome

Function putHome

11_app_dev/chaincode_example05.go:202–207  ·  view source on GitHub ↗
(ctx contractapi.TransactionContextInterface, home *Home)

Source from the content-addressed store, hash-verified

200}
201
202func putHome(ctx contractapi.TransactionContextInterface, home *Home) error {
203 if err := putJSON(ctx, homeKey(home.Address), home); err != nil {
204 return err
205 }
206 return ctx.GetStub().PutState(homeIDKey(home.ID), []byte(home.Address))
207}
208
209func readHome(ctx contractapi.TransactionContextInterface, address string) (*Home, error) {
210 var home Home

Callers 3

CreateUserMethod · 0.85
BuyByAddressMethod · 0.85
ChangeStatusMethod · 0.85

Calls 3

homeKeyFunction · 0.85
homeIDKeyFunction · 0.85
putJSONFunction · 0.70

Tested by

no test coverage detected