From 219cab4783357f8bc51b0b9fe5c11a43caec117c Mon Sep 17 00:00:00 2001 From: Fang Date: Wed, 18 Apr 2018 01:25:37 +0200 Subject: [PATCH] Support proxy change events. --- lib/constitution.hoon | 13 +++++++++++++ sur/constitution.hoon | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/lib/constitution.hoon b/lib/constitution.hoon index 65ab21458..774b1f7b2 100644 --- a/lib/constitution.hoon +++ b/lib/constitution.hoon @@ -45,6 +45,17 @@ ~[%uint [%bytes-n 32] [%bytes-n 32] %uint] ?> &(=(p.enc 32) =(p.aut 32)) :: sanity [who %keys q.enc q.aut rev]~ + :: + ?: =(event.log changed-spawn-proxy) + =+ ^- [who=@ sox=@ux] + (decode-results data.log ~[%uint %address]) + [who %spawn-proxy sox]~ + :: + ?: =(event.log changed-transfer-proxy) + =+ ^- [who=@ tox=@ux] + (decode-results data.log ~[%uint %address]) + [who %transfer-proxy tox]~ + :: ::NOTE 0x8be0...57e0 is Owneable's OwnershipTransferred(address,address). :: changed-dns is handled separately since it doesn't affect hulls. ~& [%unimplemented-event event.log] @@ -61,6 +72,8 @@ %keys hul(encryption-key enc.dif, authentication-key aut.dif) %sponsor hul(sponsor new.dif, escape ~) %escape hul(escape new.dif) + %spawn-proxy hul(spawn-proxy new.dif) + %transfer-proxy hul(transfer-proxy new.dif) == :: ++ parse-id diff --git a/sur/constitution.hoon b/sur/constitution.hoon index 70dc2b0e6..46e63e2dd 100644 --- a/sur/constitution.hoon +++ b/sur/constitution.hoon @@ -13,6 +13,8 @@ spawned=(set @p) sponsor=@p escape=(unit @p) + spawn-proxy=@ux + transfer-proxy=@ux == :: ++ eth-type @@ -67,6 +69,8 @@ [%keys enc=@ aut=@ rev=@ud] [%sponsor new=@p] [%escape new=(unit @p)] + [%spawn-proxy new=address] + [%transfer-proxy new=address] == :: :: # constants @@ -113,6 +117,16 @@ 0x6a39.f4e0.c935.b557.860d.3df3.9f1f.cb6b. d63c.5a23.2d9e.fc28.5388.2994.f60c.708a :: + :: ChangedSpawnProxy(uint32,address) + ++ changed-spawn-proxy + 0x9027.36af.7b3c.efe1.0d9e.840a.ed0d.687e. + 35c8.4095.122b.2505.1a20.ead8.866f.006d + :: + :: ChangedTransferProxy(uint32,address) + ++ changed-transfer-proxy + 0xcfe3.69b7.197e.7f0c.f067.93ae.2472.a9b1. + 3583.fecb.ed2f.78df.a14d.1f10.796b.847c + :: :: ChangedDns(string,string,string) ++ changed-dns 0xfafd.04ad.e1da.ae2e.1fdb.0fc1.cc6a.899f.