Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed May 26, 2020
1 parent 3ce81ae commit 4442a06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/neo/SmartContract/Native/PolicyContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal bool CheckPolicy(Transaction tx, StoreView snapshot)

private bool CheckCommittees(ApplicationEngine engine)
{
UInt160 committeeMultiSigAddr = NEO.GetCommitteeMultiSigAddress(engine.Snapshot);
UInt160 committeeMultiSigAddr = NEO.GetCommitteeAddress(engine.Snapshot);
return InteropService.Runtime.CheckWitnessInternal(engine, committeeMultiSigAddr);
}

Expand Down
4 changes: 2 additions & 2 deletions src/neo/SmartContract/Native/Tokens/NeoToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ public ECPoint[] GetCommittee(StoreView snapshot)
return GetCommitteeMembers(snapshot, ProtocolSettings.Default.MaxCommitteeMembersCount).OrderBy(p => p).ToArray();
}

public UInt160 GetCommitteeMultiSigAddress(StoreView snapshot)
public UInt160 GetCommitteeAddress(StoreView snapshot)
{
ECPoint[] committees = NEO.GetCommittee(snapshot);
ECPoint[] committees = GetCommittee(snapshot);
return Contract.CreateMultiSigRedeemScript(committees.Length - (committees.Length - 1) / 3, committees).ToScriptHash();
}

Expand Down
8 changes: 4 additions & 4 deletions tests/neo.UnitTests/SmartContract/Native/UT_PolicyContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void Check_SetMaxBlockSize()
snapshot.PersistingBlock = new Block() { Index = 1000, PrevHash = UInt256.Zero };
snapshot.Blocks.Add(UInt256.Zero, new Neo.Ledger.TrimmedBlock() { NextConsensus = UInt160.Zero });

UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeMultiSigAddress(snapshot);
UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeAddress(snapshot);

NativeContract.Policy.Initialize(new ApplicationEngine(TriggerType.Application, null, snapshot, 0)).Should().BeTrue();

Expand Down Expand Up @@ -124,7 +124,7 @@ public void Check_SetMaxTransactionsPerBlock()

// With signature

ret = NativeContract.Policy.Call(snapshot, new Nep5NativeContractExtensions.ManualWitness(NativeContract.NEO.GetCommitteeMultiSigAddress(snapshot)),
ret = NativeContract.Policy.Call(snapshot, new Nep5NativeContractExtensions.ManualWitness(NativeContract.NEO.GetCommitteeAddress(snapshot)),
"setMaxTransactionsPerBlock", new ContractParameter(ContractParameterType.Integer) { Value = 1 });
ret.Should().BeOfType<VM.Types.Boolean>();
ret.ToBoolean().Should().BeTrue();
Expand Down Expand Up @@ -158,7 +158,7 @@ public void Check_SetFeePerByte()
ret.GetBigInteger().Should().Be(1000);

// With signature
UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeMultiSigAddress(snapshot);
UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeAddress(snapshot);
ret = NativeContract.Policy.Call(snapshot, new Nep5NativeContractExtensions.ManualWitness(committeeMultiSigAddr),
"setFeePerByte", new ContractParameter(ContractParameterType.Integer) { Value = 1 });
ret.Should().BeOfType<VM.Types.Boolean>();
Expand All @@ -179,7 +179,7 @@ public void Check_Block_UnblockAccount()
snapshot.PersistingBlock = new Block() { Index = 1000, PrevHash = UInt256.Zero };
snapshot.Blocks.Add(UInt256.Zero, new Neo.Ledger.TrimmedBlock() { NextConsensus = UInt160.Zero });

UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeMultiSigAddress(snapshot);
UInt160 committeeMultiSigAddr = NativeContract.NEO.GetCommitteeAddress(snapshot);

NativeContract.Policy.Initialize(new ApplicationEngine(TriggerType.Application, null, snapshot, 0)).Should().BeTrue();

Expand Down

0 comments on commit 4442a06

Please sign in to comment.