CodeChain-io / CodeChain-io/codechain-sdk-go

Use custom JSON marshal instead of object duplication

Offen
#54 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
5
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, some of the Transaction-related objects have two forms, which implement normal type and for marshaling.

https://github.com/CodeChain-io/codechain-sdk-go/blob/6ad3e76c4dfba22b0867764b8c67500dce7518d2/core/transaction/signedTransaction.go#L11-L17
https://github.com/CodeChain-io/codechain-sdk-go/blob/6ad3e76c4dfba22b0867764b8c67500dce7518d2/core/transaction/signedTransaction.go#L19-L25

This implementation is from [codechain-sdk-js](https://github.com/CodeChain-io/codechain-sdk-js).
But since golang can implement custom marshaling function ([link1](http://choly.ca/post/go-json-marshalling/
)) ([link2](https://play.golang.org/p/CTmJhTiGAM)), I think duplication of the objects is unnecessary.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.