Move call data generation to lib.

This commit is contained in:
Fang 2018-04-18 14:03:34 +02:00
parent 2f4ce78d4e
commit b10b27e0a7
2 changed files with 25 additions and 19 deletions

View File

@ -64,25 +64,11 @@
::
++ ta-read
|= cal=ships:function
=- %+ ta-request `id
:+ %eth-call
[~ ships:contracts ~ ~ ~ (encode-call dat)]
[%label %latest]
::TODO probably turn the below into a lib arm
^- [id=@t dat=call-data]
?- -.cal
%ships
:- (crip "ships({(scow %p who.cal)})")
['ships(uint32)' ~[uint+`@`who.cal]]
::
%get-spawned
:- (crip "getSpawned({(scow %p who.cal)})")
['getSpawned(uint32)' ~[uint+`@`who.cal]]
::
%dns-domains
:- (crip "dnsDomains({(scow %ud ind.cal)})")
['dnsDomains(uint8)' ~[uint+ind.cal]]
==
=+ (ships:function-to-call cal)
%+ ta-request `id
:+ %eth-call
[~ ships:contracts ~ ~ ~ (encode-call dat)]
[%label %latest]
::
++ ta-read-ships
|= who=(list @p)

View File

@ -94,4 +94,24 @@
++ shipname
;~(pfix sig fed:ag)
--
::
++ function-to-call
|%
++ ships
|= cal=ships:function
^- [id=@t dat=call-data]
?- -.cal
%ships
:- (crip "ships({(scow %p who.cal)})")
['ships(uint32)' ~[uint+`@`who.cal]]
::
%get-spawned
:- (crip "getSpawned({(scow %p who.cal)})")
['getSpawned(uint32)' ~[uint+`@`who.cal]]
::
%dns-domains
:- (crip "dnsDomains({(scow %ud ind.cal)})")
['dnsDomains(uint8)' ~[uint+ind.cal]]
==
--
--