Skip to content

Commit

Permalink
log.Warns to debug weird issue
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Sep 16, 2024
1 parent 824ddf0 commit 9fbb868
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ jobs:
with:
image-tag: ${{ github.ref_name }}

immediate-docker-release:
name: Docker (immediate)
if: github.event_name == 'pull_request' &&
github.base_ref == 'release-lts-1' # these pull requests trigger a release via a quicker workflow which skips the tests
uses: vocdoni/vocdoni-node/.github/workflows/docker-release.yml@main
secrets: inherit
with:
image-tag: ${{ github.head_ref }}

job_gocoverage_textfmt:
name: Convert coverage (bin->txt)
continue-on-error: true # never mark the whole CI as failed because of this job
Expand Down
8 changes: 7 additions & 1 deletion api/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,14 @@ func (a *API) accountSetHandler(msg *apirest.APIdata, ctx *httprouter.HTTPContex
}
}

log.Warn("pre sendTx")

// send the transaction to the blockchain
res, err := a.sendTx(req.TxPayload)
if err != nil {
return err
}
log.Warn("post sendTx")

// prepare the reply
resp := &AccountSet{
Expand All @@ -304,17 +307,20 @@ func (a *API) accountSetHandler(msg *apirest.APIdata, ctx *httprouter.HTTPContex
if a.storage != nil && req.Metadata != nil {
sctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
log.Warn("pre Publish")
cid, err := a.storage.Publish(sctx, req.Metadata)
if err != nil {
log.Errorf("could not publish to storage: %v", err)
} else {
resp.MetadataURL = a.storage.URIprefix() + cid
}
log.Warnf("post Publish, metadata: %s", resp.MetadataURL)

if !ipfs.CIDequals(cid, metadataCID) {
log.Errorf("metadata CID does not match metadata content (%s != %s)", cid, metadataCID)
}
}

log.Warn("pre Marshal")
var data []byte
if data, err = json.Marshal(resp); err != nil {
return err
Expand Down

0 comments on commit 9fbb868

Please sign in to comment.