Skip to content

Commit

Permalink
Modify test file by adding PayloadJson to Tx
Browse files Browse the repository at this point in the history
  • Loading branch information
jinuk-shin committed Nov 27, 2023
1 parent ecefa0c commit f0f0551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/jsonrpc/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ func TestParseBase58TxBody(t *testing.T) {
func TestParseTx(t *testing.T) {
testTx := &types.Tx{Body: &types.TxBody{Payload: []byte(`{"Name":"v1createName","Args":["honggildong3"]}`)}}
result := MarshalJSON(ConvTx(testTx, Base58))
assert.Equal(t, "{\n \"body\": {\n \"payload\": \"22MZAFWvxtVWehpgwEVxrvoqGL5xmcPmyLBiwraDfxRwKUNrV9tmhuB7Uu6ZeJWvp\"\n }\n}", result, "")
assert.Equal(t, "{\n \"body\": {\n \"payload\": \"22MZAFWvxtVWehpgwEVxrvoqGL5xmcPmyLBiwraDfxRwKUNrV9tmhuB7Uu6ZeJWvp\",\n \"payloadJson\": {}\n }\n}", result, "")
result = MarshalJSON(ConvTx(testTx, Raw))
assert.Equal(t, "{\n \"body\": {\n \"payload\": \"{\\\"Name\\\":\\\"v1createName\\\",\\\"Args\\\":[\\\"honggildong3\\\"]}\"\n }\n}", result, "")
assert.Equal(t, "{\n \"body\": {\n \"payload\": \"{\\\"Name\\\":\\\"v1createName\\\",\\\"Args\\\":[\\\"honggildong3\\\"]}\",\n \"payloadJson\": {}\n }\n}", result, "")
}

func TestConvTxBody(t *testing.T) {
Expand Down

0 comments on commit f0f0551

Please sign in to comment.