-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: add NotValidBefore transaction attribute
Close #1490
- Loading branch information
1 parent
e9a8e95
commit aea44e4
Showing
8 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package transaction | ||
|
||
import "github.com/nspcc-dev/neo-go/pkg/io" | ||
|
||
// NotValidBefore represents attribute with the height transaction is not valid before. | ||
type NotValidBefore struct { | ||
Height uint32 `json:"height"` | ||
} | ||
|
||
// DecodeBinary implements io.Serializable interface. | ||
func (n *NotValidBefore) DecodeBinary(br *io.BinReader) { | ||
n.Height = br.ReadU32LE() | ||
} | ||
|
||
// EncodeBinary implements io.Serializable interface. | ||
func (n *NotValidBefore) EncodeBinary(w *io.BinWriter) { | ||
w.WriteU32LE(n.Height) | ||
} | ||
|
||
func (n *NotValidBefore) toJSONMap(m map[string]interface{}) { | ||
m["height"] = n.Height | ||
} |