github.com/cranelv/ethereum_mpc@v0.0.0-20191031014521-23aeb1415092/mpcService/mpc_ctx_factory_test.go (about)

     1  package mpcService
     2  
     3  import (
     4  	"testing"
     5  	"github.com/ethereum/go-ethereum/mpcService/protocol"
     6  	"github.com/ethereum/go-ethereum/common"
     7  )
     8  
     9  func TestMpcCtxFactory(t *testing.T) {
    10  	mpcFactory := MpcCtxFactory{}
    11  	_, err := mpcFactory.CreateContext(protocol.MpcCreateLockAccountLeader, common.Hash{}, nil,nil)
    12  	if err != nil {
    13  		t.Error("mpcFactory create err:", err)
    14  	}
    15  
    16  	_, err = mpcFactory.CreateContext(protocol.MpcCreateLockAccountPeer,  common.Hash{}, nil,nil)
    17  	if err != nil {
    18  		t.Error("mpcFactory create err:", err)
    19  	}
    20  
    21  	_, err = mpcFactory.CreateContext(protocol.MpcTXSignLeader,  common.Hash{}, nil,nil)
    22  	if err != nil {
    23  		t.Error("mpcFactory create err:", err)
    24  	}
    25  
    26  	_, err = mpcFactory.CreateContext(protocol.MpcTXSignPeer,  common.Hash{}, nil,nil)
    27  	if err != nil {
    28  		t.Error("mpcFactory create err:", err)
    29  	}
    30  
    31  	_, err = mpcFactory.CreateContext(5, common.Hash{}, nil,nil)
    32  	if err != nil {
    33  		t.Log("mpcFactory create err:", err)
    34  	}
    35  }