hyperledger / fabric-chaincode-go

Hyperledger Fabric Packages for Go Chaincode
https://pkg.go.dev/github.com/hyperledger/fabric-chaincode-go
Apache License 2.0
137 stars 133 forks source link

Different struct problem #34

Closed wallcuber closed 2 years ago

wallcuber commented 2 years ago

I define 3 structs in a go file. When I want to create a asset of one struct(like what in fabcar chaincode), I get 3 asset created. Can anyone help me? type EVstate struct { EVID string json:"evid" PILEID string json:"pileid" Price float64 json:"price" UP_Reserve float64 json:"up_reserve" DOWN_Reserve float64 json:"down_reserve" Performance float64 json:"performance" Mileage float64 json:"mileage" Iteration int json:"iteration" Dual float64 json:"dual"// Dual variable which stores in every ev node. Converge int json:"converge" }

// PILEstate describes basic details of what makes up a simple asset type PILEstate struct { PILEID string json:"pileid" Delta float64 json:"delta power" }

// OPstate describes basic details of what makes up a simple asset type OPstate struct { OPID string json:"opid" Price_M float64 json:"price_m" Price_C float64 json:"price_c" Signal float64 json:"signal"// Only the operator node can change this item by issuing signal. }

1637636562(1)