Skip to content

Commit

Permalink
update transactions model
Browse files Browse the repository at this point in the history
  • Loading branch information
daniildulin committed Feb 4, 2020
1 parent e73c854 commit b009575
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.1] - 2020-02-04
### Added

### Changed
- Transaction model

### Removed

## [4.0.0] - 2020-02-04
### Added

Expand Down
21 changes: 4 additions & 17 deletions models/transaction.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
package models

import (
"encoding/json"
"time"
)

const TxTypeSend = 1
const TxTypeSellCoin = 2
const TxTypeSellAllCoin = 3
const TxTypeBuyCoin = 4
const TxTypeCreateCoin = 5
const TxTypeDeclareCandidacy = 6
const TxTypeDelegate = 7
const TxTypeUnbound = 8
const TxTypeRedeemCheck = 9
const TxTypeSetCandidateOnline = 10
const TxTypeSetCandidateOffline = 11
const TxTypeMultiSig = 12
const TxTypeMultiSend = 13
const TxTypeEditCandidate = 14

type Transaction struct {
ID uint64 `json:"id" sql:",pk"`
FromAddressID uint64 `json:"from_address_id"`
Expand All @@ -31,8 +17,9 @@ type Transaction struct {
Type uint8 `json:"type"`
Hash string `json:"hash"`
ServiceData string `json:"service_data"`
Data interface{} `json:"data"`
Tags interface{} `json:"tags"`
Data json.RawMessage `json:"data"`
IData interface{} `json:"-" sql:"-"`
Tags map[string]string `json:"tags"`
Payload []byte `json:"payload"`
RawTx []byte `json:"raw_tx"`
Block *Block `json:"block"` //Relation has one to Blocks
Expand Down

0 comments on commit b009575

Please sign in to comment.