示例#1
0
        private IAccountStateDelta ExecuteInternal(IAccountStateDelta previousStates, long blockIndex = 0)
        {
            var dailyRewardAction = new DailyReward5
            {
                avatarAddress = _avatarAddress,
            };

            return(dailyRewardAction.Execute(new ActionContext
            {
                BlockIndex = blockIndex,
                PreviousStates = previousStates,
                Random = new TestRandom(),
                Rehearsal = false,
                Signer = _agentAddress,
            }));
        }
示例#2
0
        public void Rehearsal()
        {
            var action = new DailyReward5
            {
                avatarAddress = _avatarAddress,
            };

            var nextState = action.Execute(new ActionContext
            {
                BlockIndex     = 0,
                PreviousStates = new State(),
                Random         = new TestRandom(),
                Rehearsal      = true,
                Signer         = _agentAddress,
            });

            var updatedAddresses = new List <Address>
            {
                _avatarAddress,
            };

            Assert.Equal(updatedAddresses.ToImmutableHashSet(), nextState.UpdatedAddresses);
        }