Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construction API work #23

Merged
merged 37 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4438da9
Add stubs for the new Rosetta Construction API
abukosek Jul 17, 2020
482a19a
Bump rosetta-cli version to 0.3.1
pro-wh Jul 24, 2020
895919c
construction: change transaction hashing
pro-wh Jul 24, 2020
dff1e4c
construction: add signing workflow
pro-wh Jul 24, 2020
1c950c3
tests: add construction test
pro-wh Jul 24, 2020
e87db5c
construction: add transfer
pro-wh Jul 27, 2020
bec8386
tests: add construction payloads test
pro-wh Jul 28, 2020
19fa5d6
construction: add burn
pro-wh Jul 28, 2020
a661da8
construction: add add escrow
pro-wh Jul 28, 2020
01ee3ea
construction: add reclaim escrow
pro-wh Jul 28, 2020
c5d5d7d
construction: implement parse
pro-wh Jul 29, 2020
6049739
tests: exercise parse in construction signing test
pro-wh Jul 30, 2020
f0a300b
construction: give unsigned transaction in JSON
pro-wh Jul 30, 2020
5fa09fb
construction: unpanic
pro-wh Jul 30, 2020
b940ce2
construction: no more literal transactions
pro-wh Jul 30, 2020
619571e
tests: run construction tests
pro-wh Jul 30, 2020
5fef825
tests: correct copying
pro-wh Jul 30, 2020
6498b4f
construction: switch to switch for intent matching
pro-wh Jul 31, 2020
9acd14c
construction: introduce fee_gas metadata
pro-wh Jul 31, 2020
3cd2721
construction: rearrange imports
pro-wh Jul 31, 2020
fd764dd
Bump rosetta-cli version to 0.4.0
pro-wh Jul 31, 2020
83f4c65
construction: implement derive
pro-wh Jul 31, 2020
8db44d3
Bump rosetta-sdk-go to version 0.3.3
pro-wh Aug 3, 2020
5b3e9f1
tests: extract common routines
pro-wh Aug 3, 2020
89fc42e
tests: add check-prep
pro-wh Aug 4, 2020
b662bac
model general balance as no subaccount
pro-wh Aug 4, 2020
188fa74
construction: avoid unnecessary hex when no error
pro-wh Aug 4, 2020
5e999bc
services: move internal imports to separate section
pro-wh Aug 4, 2020
e8d5fca
tests: initialize test entity balance
pro-wh Aug 4, 2020
a17246a
tests: fill in scenario config
pro-wh Aug 4, 2020
78e47d0
construction: use our own unsigned transaction format
pro-wh Aug 5, 2020
d9dd39e
tests: don't exercise zero-fee transaction
pro-wh Aug 5, 2020
a1cf329
switch to MarshalText for converting Address to string
pro-wh Aug 6, 2020
6d38678
tests: run check:construction
pro-wh Aug 6, 2020
440b495
tests: stop check:construction after confirmed tx
pro-wh Aug 6, 2020
2e080ff
Merge pull request #31 from oasisprotocol/pro-wh/feature/checkcons
pro-wh Aug 7, 2020
f9d7705
Merge pull request #26 from oasisprotocol/pro-wh/feature/cli4
pro-wh Aug 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env gmake

OASIS_RELEASE := 20.8.2
ROSETTA_CLI_RELEASE := 0.2.5
ROSETTA_CLI_RELEASE := 0.3.1

OASIS_GO ?= go
GO := env -u GOPATH $(OASIS_GO)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ go 1.14
replace github.com/tendermint/tendermint => github.com/oasisprotocol/tendermint v0.33.4-oasis2

require (
github.com/coinbase/rosetta-sdk-go v0.2.0
github.com/coinbase/rosetta-sdk-go v0.3.0
github.com/oasisprotocol/ed25519 v0.0.0-20200528083105-55566edd6df0
github.com/oasisprotocol/oasis-core/go v0.0.0-20200702171459-20d1a2dc6b66
google.golang.org/grpc v1.29.1
)
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/coinbase/rosetta-sdk-go/asserter"
"github.com/coinbase/rosetta-sdk-go/server"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
"github.com/oasisprotocol/oasis-core/go/common/logging"

"github.com/oasisprotocol/oasis-core-rosetta-gateway/oasis-client"
Expand All @@ -33,6 +34,8 @@ func NewBlockchainRouter(oasisClient oasis_client.OasisClient) (http.Handler, er
}

asserter, err := asserter.NewServer(
services.SupportedOperationTypes,
true,
[]*types.NetworkIdentifier{
&types.NetworkIdentifier{
Blockchain: services.OasisBlockchainName,
Expand Down Expand Up @@ -94,6 +97,9 @@ func main() {
os.Exit(1)
}

// Set the chain context for preparing signing payloads.
signature.SetChainContext(cid)

// Initialize logging.
err = logging.Initialize(os.Stdout, logging.FmtLogfmt, logging.LevelDebug, nil)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions services/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ var OasisCurrency = &types.Currency{
Decimals: 9,
}

// PoolShare is the currency used for debonding.
var PoolShare = &types.Currency{
Symbol: "(pool share)",
}

// GetChainID returns the chain ID.
func GetChainID(ctx context.Context, oc oc.OasisClient) (string, *types.Error) {
chainID, err := oc.GetChainID(ctx)
Expand Down
Loading