@@ -57,7 +57,7 @@ type Marble struct {
57
57
func (marbleApp * MarbleApp ) CreateMarble (args []string ) (* common.Envelope , error ) {
58
58
// 0 1 2 3
59
59
// "asdf", "blue", "35", "bob"
60
- logger .Debugf ("===COUCHDB=== Entering ----------CreateMarble()----------" )
60
+ logger .Debugf ("Entering ----------CreateMarble()----------" )
61
61
marbleName := args [0 ]
62
62
marbleJsonBytes , err := init_marble (args )
63
63
if err != nil {
@@ -76,9 +76,9 @@ func (marbleApp *MarbleApp) CreateMarble(args []string) (*common.Envelope, error
76
76
if txSimulationResults , err = txSimulator .GetTxSimulationResults (); err != nil {
77
77
return nil , err
78
78
}
79
- logger .Debugf ("===COUCHDB=== CreateMarble() simulation done, packaging into a transaction..." )
79
+ logger .Debugf ("CreateMarble() simulation done, packaging into a transaction..." )
80
80
tx := constructTransaction (txSimulationResults )
81
- logger .Debugf ("===COUCHDB=== Exiting CreateMarble()" )
81
+ logger .Debugf ("Exiting CreateMarble()" )
82
82
return tx , nil
83
83
}
84
84
@@ -94,7 +94,7 @@ func init_marble(args []string) ([]byte, error) {
94
94
return nil , errors .New ("Incorrect number of arguments. Expecting 4" )
95
95
}
96
96
97
- logger .Debugf ("===COUCHDB=== Entering init marble" )
97
+ logger .Debugf ("Entering init marble" )
98
98
if len (args [0 ]) <= 0 {
99
99
return nil , errors .New ("1st argument must be a non-empty string" )
100
100
}
@@ -120,7 +120,7 @@ func init_marble(args []string) ([]byte, error) {
120
120
marbleJson := `{"txid": "` + tx + `", "asset_name": "` + args [0 ] + `", "color": "` + color + `", "size": ` + strconv .Itoa (size ) + `, "owner": "` + user + `"}`
121
121
marbleBytes := []byte (marbleJson )
122
122
123
- logger .Debugf ("===COUCHDB=== Exiting init marble" )
123
+ logger .Debugf ("Exiting init marble" )
124
124
return marbleBytes , nil
125
125
}
126
126
@@ -134,7 +134,7 @@ func (marbleApp *MarbleApp) TransferMarble(args []string) (*common.Envelope, err
134
134
marbleName := args [0 ]
135
135
marbleNewOwner := args [1 ]
136
136
137
- logger .Debugf ("===COUCHDB=== Entering ----------TransferMarble----------" )
137
+ logger .Debugf ("Entering ----------TransferMarble----------" )
138
138
var txSimulator ledger.TxSimulator
139
139
var err error
140
140
if txSimulator , err = marbleApp .ledger .NewTxSimulator (); err != nil {
@@ -143,25 +143,25 @@ func (marbleApp *MarbleApp) TransferMarble(args []string) (*common.Envelope, err
143
143
defer txSimulator .Done ()
144
144
145
145
marbleBytes , err := txSimulator .GetState (marbleApp .name , marbleName )
146
- logger .Debugf ("===COUCHDB=== marbleBytes is: %v" , marbleBytes )
146
+ logger .Debugf ("marbleBytes is: %v" , marbleBytes )
147
147
if marbleBytes != nil {
148
148
jsonString := string (marbleBytes [:])
149
- logger .Debugf ("===COUCHDB=== TransferMarble() Retrieved jsonString: \n %s" , jsonString )
149
+ logger .Debugf ("TransferMarble() Retrieved jsonString: \n %s" , jsonString )
150
150
}
151
151
152
152
theMarble := Marble {}
153
153
json .Unmarshal (marbleBytes , & theMarble ) //Unmarshal JSON bytes into a Marble struct
154
154
155
- logger .Debugf ("===COUCHDB=== theMarble after unmarshal: %v" , theMarble )
155
+ logger .Debugf (" theMarble after unmarshal: %v" , theMarble )
156
156
157
- logger .Debugf ("===COUCHDB=== Setting the owner to: %s" , marbleNewOwner )
157
+ logger .Debugf (" Setting the owner to: %s" , marbleNewOwner )
158
158
theMarble .User = marbleNewOwner //change the user
159
159
theMarble .Txid = "tx000000000000002" // COUCHDB hardcode a txid for now for demo purpose
160
160
161
161
updatedMarbleBytes , _ := json .Marshal (theMarble )
162
162
if updatedMarbleBytes != nil {
163
163
updatedJsonString := string (updatedMarbleBytes [:])
164
- logger .Debugf ("===COUCHDB=== updatedJsonString:\n %s" , updatedJsonString )
164
+ logger .Debugf ("updatedJsonString:\n %s" , updatedJsonString )
165
165
}
166
166
err = txSimulator .SetState (marbleApp .name , marbleName , updatedMarbleBytes )
167
167
if err != nil {
@@ -172,7 +172,7 @@ func (marbleApp *MarbleApp) TransferMarble(args []string) (*common.Envelope, err
172
172
if txSimulationResults , err = txSimulator .GetTxSimulationResults (); err != nil {
173
173
return nil , err
174
174
}
175
- logger .Debugf ("===COUCHDB=== TransferMarble() simulation done, packaging into a transaction..." )
175
+ logger .Debugf ("TransferMarble() simulation done, packaging into a transaction..." )
176
176
tx := constructTransaction (txSimulationResults )
177
177
return tx , nil
178
178
}
0 commit comments