@@ -24,8 +24,14 @@ import (
24
24
"testing"
25
25
"time"
26
26
27
+ "math/big"
28
+
29
+ "github.com/ShyftNetwork/go-empyrean/accounts/abi/bind"
30
+ "github.com/ShyftNetwork/go-empyrean/accounts/abi/bind/backends"
27
31
"github.com/ShyftNetwork/go-empyrean/common"
32
+ "github.com/ShyftNetwork/go-empyrean/core"
28
33
"github.com/ShyftNetwork/go-empyrean/crypto"
34
+ "github.com/ShyftNetwork/go-empyrean/generated_bindings"
29
35
"github.com/ShyftNetwork/go-empyrean/p2p"
30
36
"github.com/ShyftNetwork/go-empyrean/rpc"
31
37
whisper "github.com/ShyftNetwork/go-empyrean/whisper/whisperv6"
@@ -615,3 +621,24 @@ func TestWhisperChannels(t *testing.T) {
615
621
t .Errorf ("result mismatch: have %s, want %s" , resp , testAddrA )
616
622
}
617
623
}
624
+
625
+ func TestCheckContractAdminStatus (t * testing.T ) {
626
+ key0 , _ := crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
627
+ addr0 := crypto .PubkeyToAddress (key0 .PublicKey )
628
+ deployTransactor := bind .NewKeyedTransactor (key0 )
629
+ backend := backends .NewSimulatedBackend (core.GenesisAlloc {addr0 : {Balance : big .NewInt (1000000000 )}}, 10000000 )
630
+ addr , _ , _ , err := shyft_contracts .DeployValidSigners (deployTransactor , backend )
631
+ if err != nil {
632
+ t .Errorf ("Deploy Valid Signers Contract failed " , err )
633
+ }
634
+ t .Log ("add is " , addr )
635
+ stack , err := New (testNodeConfig ())
636
+ if err != nil {
637
+ t .Fatalf ("failed to create protocol stack: %v" , err )
638
+ }
639
+ result := stack .CheckContractAdminStatus (addr0 , backend )
640
+
641
+ if result != false {
642
+ t .Errorf ("result mismatch: have %s, want %s" , result , false )
643
+ }
644
+ }
0 commit comments