(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestRNodeJoinRNode(t *testing.T) { |
| 43 | // deploy contract |
| 44 | contractBackend := backends.NewDporSimulatedBackend(core.GenesisAlloc{ |
| 45 | ownerAddr: {Balance: big.NewInt(1000000000000)}, |
| 46 | candidateAddr: {Balance: new(big.Int).Mul(big.NewInt(1000000), big.NewInt(configs.Cpc))}, |
| 47 | candidate2Addr: {Balance: new(big.Int).Mul(big.NewInt(1000000), big.NewInt(configs.Cpc))}}) |
| 48 | _, instance := deploy(ownerKey, contractBackend) |
| 49 | |
| 50 | // join rnode |
| 51 | candidateTransactOpts := bind.NewKeyedTransactor(candidateKey) |
| 52 | candidateInvest := new(big.Int).Mul(big.NewInt(200000), big.NewInt(1e+18)) |
| 53 | candidateTransactOpts.GasLimit = uint64(50000000) |
| 54 | candidateTransactOpts.Value = candidateInvest |
| 55 | _, err := instance.JoinRnode(candidateTransactOpts, initVersion) |
| 56 | checkError(t, "join rnode", err) |
| 57 | |
| 58 | contractBackend.Commit() |
| 59 | |
| 60 | checkIsRNode(t, instance, candidateAddr, true) |
| 61 | |
| 62 | checkRNodeNum(t, instance, 1) |
| 63 | } |
| 64 | |
| 65 | func TestRNodeNotEnoughInvest(t *testing.T) { |
| 66 | // deploy contract |
nothing calls this directly
no test coverage detected