-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#139] nns: require admin signature for registering subdomain
Signed-off-by: Evgenii Stratonikov <[email protected]>
- Loading branch information
Showing
3 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,7 +136,7 @@ func TestContainerPut(t *testing.T) { | |
c.id = sha256.Sum256(c.value) | ||
|
||
t.Run("bad domain owner", func(t *testing.T) { | ||
tx = PrepareInvoke(t, bc, acc, nnsHash, "register", | ||
tx = PrepareInvoke(t, bc, []*wallet.Account{acc, CommitteeAcc}, nnsHash, "register", | ||
"baddomain.neofs", acc.Contract.ScriptHash(), | ||
"[email protected]", int64(0), int64(0), int64(0), int64(0)) | ||
AddBlockCheckHalt(t, bc, tx) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,16 +65,23 @@ func TestNNSRegister(t *testing.T) { | |
bc := NewChain(t) | ||
h := DeployContract(t, bc, nnsPath, nil) | ||
|
||
accTop := NewAccount(t, bc) | ||
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104) | ||
tx := PrepareInvoke(t, bc, CommitteeAcc, h, "register", | ||
"com", CommitteeAcc.Contract.ScriptHash(), | ||
tx := PrepareInvoke(t, bc, []*wallet.Account{CommitteeAcc, accTop}, h, "register", | ||
"com", accTop.Contract.ScriptHash(), | ||
"[email protected]", refresh, retry, expire, ttl) | ||
AddBlockCheckHalt(t, bc, tx) | ||
|
||
acc := NewAccount(t, bc) | ||
tx = PrepareInvoke(t, bc, []*wallet.Account{CommitteeAcc, acc}, h, "register", | ||
"testdomain.com", acc.Contract.ScriptHash(), | ||
"[email protected]", refresh, retry, expire, ttl) | ||
AddBlock(t, bc, tx) | ||
CheckFault(t, bc, tx.Hash(), "not witnessed by admin") | ||
|
||
tx = PrepareInvoke(t, bc, []*wallet.Account{accTop, acc}, h, "register", | ||
"testdomain.com", acc.Contract.ScriptHash(), | ||
"[email protected]", refresh, retry, expire, ttl) | ||
b := AddBlockCheckHalt(t, bc, tx) | ||
|
||
tx = PrepareInvoke(t, bc, acc, h, "getRecords", "testdomain.com", int64(nns.SOA)) | ||
|