File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class PutDeployResult extends AbstractResult
88
99 public static function fromJSON (array $ json ): self
1010 {
11- return self ($ json , $ json ['deploy_hash ' ]);
11+ return new self ($ json , $ json ['deploy_hash ' ]);
1212 }
1313
1414 public function __construct (array $ rawJSON , string $ deployHash )
Original file line number Diff line number Diff line change @@ -25,12 +25,18 @@ public static function toJson($clType): array
2525 }
2626
2727 /**
28+ * @param array|string $json
2829 * @throws \Exception
2930 */
30- public static function fromJson (array $ json ): CLType
31+ public static function fromJson ($ json ): CLType
3132 {
3233 $ classPrefix = 'Casper\Types\CLValue\CLType\CL ' ;
3334
35+ if (is_string ($ json )) {
36+ $ clTypeClass = $ classPrefix . $ json . 'Type ' ;
37+ return new $ clTypeClass ();
38+ }
39+
3440 if (ArrayUtil::isMap ($ json )) {
3541 $ typeName = array_key_first ($ json );
3642 $ clTypeClass = $ classPrefix . $ typeName . 'Type ' ;
You can’t perform that action at this time.
0 commit comments