when use lotus state call method, in lotus/cli/state.go 1620 line, the paramObj needs struct type not a ptr type,
if use a ptr type, the program will panic in line 1621(paramObj.NumField())
This commit is contained in:
		
							parent
							
								
									bb5a92e2f4
								
							
						
					
					
						commit
						72c1fa81db
					
				| @ -1617,7 +1617,7 @@ func parseParamsForMethod(act cid.Cid, method uint64, args []string) ([]byte, er | ||||
| 		return nil, fmt.Errorf("unknown method %d for actor %s", method, act) | ||||
| 	} | ||||
| 
 | ||||
| 	paramObj := methodMeta.Params | ||||
| 	paramObj := methodMeta.Params.Elem() | ||||
| 	if paramObj.NumField() != len(args) { | ||||
| 		return nil, fmt.Errorf("not enough arguments given to call that method (expecting %d)", paramObj.NumField()) | ||||
| 	} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user