Skip to content

Commit

Permalink
go roothash: move mesasge types to new file
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Oct 9, 2019
1 parent 560633d commit 1f16a93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
14 changes: 0 additions & 14 deletions go/roothash/api/block/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/oasislabs/ekiden/go/common/cbor"
"github.com/oasislabs/ekiden/go/common/crypto/hash"
"github.com/oasislabs/ekiden/go/common/crypto/signature"
staking "github.com/oasislabs/ekiden/go/staking/api"
storage "github.com/oasislabs/ekiden/go/storage/api"
)

Expand Down Expand Up @@ -47,19 +46,6 @@ const (
Decrease AdjustmentOp = 2
)

// StakingGeneralAdjustmentRoothashMessage is a message that changes an account's general balance.
// Mux app in charge: staking
type StakingGeneralAdjustmentRoothashMessage struct {
Account signature.PublicKey `json:"account"`
Op AdjustmentOp `json:"op"`
Amount *staking.Quantity `json:"amount"`
}

// RoothashMessage is a roothash message.
type RoothashMessage struct {
StakingGeneralAdjustmentRoothashMessage *StakingGeneralAdjustmentRoothashMessage
}

// Header is a block header.
//
// Keep this in sync with /runtime/src/common/roothash.rs.
Expand Down
19 changes: 19 additions & 0 deletions go/roothash/api/block/message.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package block

import (
"github.com/oasislabs/ekiden/go/common/crypto/signature"
staking "github.com/oasislabs/ekiden/go/staking/api"
)

// StakingGeneralAdjustmentRoothashMessage is a message that changes an account's general balance.
// Mux app in charge: staking
type StakingGeneralAdjustmentRoothashMessage struct {
Account signature.PublicKey `json:"account"`
Op AdjustmentOp `json:"op"`
Amount *staking.Quantity `json:"amount"`
}

// RoothashMessage is a roothash message.
type RoothashMessage struct {
StakingGeneralAdjustmentRoothashMessage *StakingGeneralAdjustmentRoothashMessage
}

0 comments on commit 1f16a93

Please sign in to comment.