Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serializers #471

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/TransformRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class RawWriteCLValue {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs,
serializer: (args: Args) => serializeArgs(args, false),
name: 'WriteCLValue'
})
WriteCLValue?: Args;
Expand All @@ -253,7 +253,7 @@ export class WriteCLValue {
*/
@jsonMember(() => Args, {
deserializer: deserializeArgs,
serializer: serializeArgs,
serializer: (args: Args) => serializeArgs(args, false),
name: 'CLValue'
})
CLValue?: Args;
Expand Down
Loading