Skip to content

Commit

Permalink
Merge pull request #471 from casper-ecosystem/feat-utils-and-fixes
Browse files Browse the repository at this point in the history
Fix serializers
  • Loading branch information
alexmyshchyshyn authored Dec 20, 2024
2 parents 1e987fb + 783b989 commit 466fcdb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/types/Args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class Args {
* The map of argument names to `CLValue` values.
*/
@jsonMapMember(String, CLValue, {
serializer: serRA,
serializer: (map: Map<string, CLValue>) => serRA(map),
deserializer: desRA
})
public args: Map<string, CLValue>;
Expand Down
4 changes: 2 additions & 2 deletions src/types/EraEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class EraEndV2 {
*/
@jsonMapMember(String, Array, {
name: 'rewards',
serializer: serializeRewards,
serializer: (map: Map<string, CLValueUInt512[]>) => serializeRewards(map),
deserializer: deserializeRewards
})
public rewards: Map<string, CLValueUInt512[]>;
Expand Down Expand Up @@ -252,7 +252,7 @@ export class EraEnd {
@jsonMapMember(String, CLValueUInt512, {
name: 'rewards',
deserializer: deserializeRewards,
serializer: serializeRewards
serializer: (map: Map<string, CLValueUInt512[]>) => serializeRewards(map),
})
public rewards: Map<string, CLValueUInt512[]>;

Expand Down
14 changes: 7 additions & 7 deletions src/types/ExecutableDeployItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ModuleBytes {
@jsonMember({
name: 'module_bytes',
constructor: Uint8Array,
serializer: byteArrayJsonSerializer,
serializer: (bytes: Uint8Array) => byteArrayJsonSerializer(bytes),
deserializer: byteArrayJsonDeserializer
})
moduleBytes!: Uint8Array;
Expand All @@ -56,7 +56,7 @@ export class ModuleBytes {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down Expand Up @@ -120,7 +120,7 @@ export class StoredContractByHash {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down Expand Up @@ -171,7 +171,7 @@ export class StoredContractByName {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down Expand Up @@ -227,7 +227,7 @@ export class StoredVersionedContractByHash {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down Expand Up @@ -302,7 +302,7 @@ export class StoredVersionedContractByName {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down Expand Up @@ -348,7 +348,7 @@ export class TransferDeployItem {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
args: Args;

Expand Down
2 changes: 1 addition & 1 deletion src/types/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export class Transaction {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
public args: Args;

Expand Down
4 changes: 2 additions & 2 deletions src/types/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export class NamedKeyKind {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
public namedKey: Args;

Expand All @@ -526,7 +526,7 @@ export class NamedKeyKind {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs
serializer: (args: Args) => serializeArgs(args, false)
})
public name: Args;
}
4 changes: 2 additions & 2 deletions src/types/TransformRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class RawWriteCLValue {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs,
serializer: (args: Args) => serializeArgs(args, false),
name: 'WriteCLValue'
})
WriteCLValue?: Args;
Expand All @@ -357,7 +357,7 @@ export class WriteCLValue {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs,
serializer: (args: Args) => serializeArgs(args, false),
name: 'CLValue'
})
CLValue?: Args;
Expand Down

0 comments on commit 466fcdb

Please sign in to comment.