Skip to content

Commit c18fb8f

Browse files
committed
basic-price-oracle: specify error code
Simply passes an error code of 1 (unsupported subject asset) where appropriate in the mock oracle. The raw code is used instead of oraclerpc.UNSUPPORTED or similar to avoid dependency changes at present. Also adds the mock oracle's log to gitignore.
1 parent 8e885e7 commit c18fb8f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ cmd/tapd/tapd
2424
/itest/itest.test
2525

2626
/docs/examples/basic-price-oracle/basic-price-oracle
27+
/docs/examples/basic-price-oracle/basic-price-oracle-example.log
2728

2829
# Load test binaries and config
2930
/loadtest

docs/examples/basic-price-oracle/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ func (p *RpcPriceOracleServer) QueryAssetRates(_ context.Context,
306306
Error: &oraclerpc.QueryAssetRatesErrResponse{
307307
Message: "unsupported payment asset, " +
308308
"only BTC is supported",
309+
Code: 1,
309310
},
310311
},
311312
}, nil
@@ -326,6 +327,7 @@ func (p *RpcPriceOracleServer) QueryAssetRates(_ context.Context,
326327
Result: &oraclerpc.QueryAssetRatesResponse_Error{
327328
Error: &oraclerpc.QueryAssetRatesErrResponse{
328329
Message: "unsupported subject asset",
330+
Code: 1,
329331
},
330332
},
331333
}, nil

0 commit comments

Comments
 (0)