Ejemplo n.º 1
0
        private async Task ContributeAndDistribute(ProfitContractContainer.ProfitContractStub creator,
                                                   int contributeAmountEachTime, int period)
        {
            await creator.ContributeProfits.SendAsync(new ContributeProfitsInput
            {
                Amount   = contributeAmountEachTime,
                Symbol   = ProfitContractTestConstants.NativeTokenSymbol,
                SchemeId = schemeId
            });

            await creator.DistributeProfits.SendAsync(new DistributeProfitsInput
            {
                SchemeId = schemeId,
                Period   = period,
            });
        }
Ejemplo n.º 2
0
        private async Task <long> AddBeneficiaries(ProfitContractContainer.ProfitContractStub creator)
        {
            await creator.AddBeneficiaries.SendAsync(new AddBeneficiariesInput
            {
                SchemeId          = schemeId,
                BeneficiaryShares =
                {
                    new BeneficiaryShare
                    {
                        Beneficiary = Address.FromPublicKey(SampleECKeyPairs.KeyPairs[11].PublicKey),
                        Shares      = 1
                    },
                    new BeneficiaryShare
                    {
                        Beneficiary = Address.FromPublicKey(SampleECKeyPairs.KeyPairs[12].PublicKey),
                        Shares      = 1
                    },
                    new BeneficiaryShare
                    {
                        Beneficiary = Address.FromPublicKey(SampleECKeyPairs.KeyPairs[13].PublicKey),
                        Shares      = 1
                    },
                    new BeneficiaryShare
                    {
                        Beneficiary = Address.FromPublicKey(SampleECKeyPairs.KeyPairs[14].PublicKey),
                        Shares      = 1
                    },
                    new BeneficiaryShare
                    {
                        Beneficiary = Address.FromPublicKey(SampleECKeyPairs.KeyPairs[15].PublicKey),
                        Shares      = 1
                    },
                }
            });

            return(5);
        }