pact
pact copied to clipboard
getting tx sender with (chain-data) function in local server
the (chain-data) function does not seem to be working when running a local chain. I have a chain running on port 9001 and using a javascript front-end to interact with the contract and send tx's
defun get-sender ()
(let (tx-data (chain-data))
[(at "sender" tx-data)]
)
)
;returns -> [""]
this is the javascript call:
test = (keyset) => {
const cmdObj = {
pactCode: `(contract.get-sender)`,
keyPairs: keyset
}
Pact.fetch.local(cmdObj, API_HOST)
.then(res => {
console.log(res.data);
})
}
//logs -> [""]
In Pact, we'll need to populate the local PublicData with the correct values. Thanks for raising this @fmelp