OSDN Git Service

wwww
authorHAOYUatHZ <haoyu@protonmail.com>
Wed, 22 May 2019 20:08:19 +0000 (04:08 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Wed, 22 May 2019 20:08:19 +0000 (04:08 +0800)
asset/builder.go
consensus/federation.go

index 3cd4bfc..fd4a042 100644 (file)
@@ -39,9 +39,12 @@ type crossInAction struct {
 // TODO: also need to hard-code mapTx
 func (a *crossInAction) Build(ctx context.Context, builder *txbuilder.TemplateBuilder) error {
        var missing []string
-       if len(a.FedXPubs) == 0 {
+       if len(a.FedXPubs) <= 1 {
                missing = append(missing, "fed_xpubs")
        }
+       if a.Quorum == 0 {
+               missing = append(missing, "fed_quorum")
+       }
        if a.SourceID == "" {
                missing = append(missing, "source_id")
        }
index 6ae20d2..16f230e 100644 (file)
@@ -8,6 +8,11 @@ import (
        "github.com/vapor/crypto/ed25519/chainkd"
 )
 
+type Federation struct {
+       XPubs  []chainkd.XPub
+       Quorum int
+}
+
 const (
        FedXPubs = ""
        Quorum   = 1