From 954dc79486521f03fcea0b8fcaee58e1e0c2ff8d Mon Sep 17 00:00:00 2001 From: Tristan Allaire Date: Fri, 27 Oct 2023 12:51:39 +0200 Subject: [PATCH] Mavryk Protocol integration + Test refactoring started --- Makefile | 32 ++++----- docker-compose.sandbox.yml | 65 +++++++++++++++++++ internal/bcd/ast/bytes_test.go | 2 +- internal/bcd/ast/validators_test.go | 2 +- internal/bcd/consts/primitives.go | 2 +- internal/bcd/encoding/base58.go | 16 ++--- internal/bcd/forge/domaintypes_test.go | 2 +- internal/bcd/forge/unpacking_test.go | 8 +-- ...RH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8.json | 2 +- .../operations/operation_group_test.go | 8 +-- internal/parsers/storage/helpers_test.go | 4 +- 11 files changed, 104 insertions(+), 39 deletions(-) create mode 100644 docker-compose.sandbox.yml diff --git a/Makefile b/Makefile index 4c943618a..65c3ec48e 100644 --- a/Makefile +++ b/Makefile @@ -7,33 +7,33 @@ BACKUP?=dump_latest.gz .ONESHELL: api: - docker-compose up -d db + docker compose up -d db cd cmd/api && go run -tags=jsoniter . indexer: - docker-compose up -d db + docker compose up -d db cd cmd/indexer && go run . seo: ifeq ($(BCD_ENV), development) cd scripts/nginx && go run . else - docker-compose exec api seo - docker-compose restart gui + docker compose exec api seo + docker compose restart gui endif migration: ifeq ($(BCD_ENV), development) cd scripts/migration && go run . else - docker-compose exec api migration + docker compose exec api migration endif rollback: ifeq ($(BCD_ENV), development) cd scripts/bcdctl && go run . rollback -n $(NETWORK) -l $(LEVEL) else - docker-compose exec api bcdctl rollback -n $(NETWORK) -l $(LEVEL) + docker compose exec api bcdctl rollback -n $(NETWORK) -l $(LEVEL) endif s3-db-restore: @@ -42,13 +42,13 @@ ifeq (,$(wildcard $(LATEST_DUMP))) aws s3 cp --profile bcd s3://bcd-db-snaps/$(BACKUP) $(LATEST_DUMP) endif - docker-compose exec -T db dropdb -U $(POSTGRES_USER) --if-exists $(POSTGRES_DB) - gunzip -dc $(LATEST_DUMP) | docker-compose exec -T db psql -U $(POSTGRES_USER) -v ON_ERROR_STOP=on $(POSTGRES_DB) + docker compose exec -T db dropdb -U $(POSTGRES_USER) --if-exists $(POSTGRES_DB) + gunzip -dc $(LATEST_DUMP) | docker compose exec -T db psql -U $(POSTGRES_USER) -v ON_ERROR_STOP=on $(POSTGRES_DB) rm $(LATEST_DUMP) s3-db-snapshot: echo "Database snapshot..." - docker-compose exec db pg_dump $(POSTGRES_DB) --create -U $(POSTGRES_USER) | gzip -c > $(LATEST_DUMP) + docker compose exec db pg_dump $(POSTGRES_DB) --create -U $(POSTGRES_USER) | gzip -c > $(LATEST_DUMP) aws s3 mv --profile bcd $(LATEST_DUMP) s3://bcd-db-snaps/dump_latest.gz s3-list: @@ -67,28 +67,28 @@ test-api: newman run ./scripts/newman/tests.json -e ./scripts/newman/env.json stable: - TAG=master docker-compose up -d api indexer + TAG=master docker compose up -d api indexer db-dump: - docker-compose exec db pg_dump -c $(POSTGRES_DB) > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql + docker compose exec db pg_dump -c $(POSTGRES_DB) > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql db-restore: - docker-compose exec -T db psql --username $(POSTGRES_USER) -v ON_ERROR_STOP=on $(POSTGRES_DB) < $(BACKUP) + docker compose exec -T db psql --username $(POSTGRES_USER) -v ON_ERROR_STOP=on $(POSTGRES_DB) < $(BACKUP) ps: docker ps --format "table {{.Names}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}" sandbox-pull: - TAG=4.7.6 docker-compose -f docker-compose.flextesa.yml pull + TAG=4.7.6 docker compose -f docker compose.flextesa.yml pull flextesa-sandbox: - COMPOSE_PROJECT_NAME=bcdbox TAG=4.7.6 docker-compose -f docker-compose.flextesa.yml up -d + COMPOSE_PROJECT_NAME=bcdbox TAG=4.7.6 docker compose -f docker compose.flextesa.yml up -d sandbox-down: - COMPOSE_PROJECT_NAME=bcdbox docker-compose -f docker-compose.flextesa.yml down + COMPOSE_PROJECT_NAME=bcdbox docker compose -f docker compose.flextesa.yml down sandbox-clear: - COMPOSE_PROJECT_NAME=bcdbox docker-compose -f docker-compose.flextesa.yml down -v + COMPOSE_PROJECT_NAME=bcdbox docker compose -f docker compose.flextesa.yml down -v generate: go generate ./... \ No newline at end of file diff --git a/docker-compose.sandbox.yml b/docker-compose.sandbox.yml new file mode 100644 index 000000000..fc3ff1d9f --- /dev/null +++ b/docker-compose.sandbox.yml @@ -0,0 +1,65 @@ +version: "3.6" +services: + db: + image: timescale/timescaledb:latest-pg15 + shm_size: 1g + restart: always + environment: + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + - POSTGRES_DB=bcd + - PGDATA=/var/lib/postgresql/data/pgdata + volumes: + - db:/var/lib/postgresql/data + logging: &bcd-logging + options: + max-size: 10m + max-file: "5" + + api: + restart: always + image: ghcr.io/baking-bad/bcdhub-api:${TAG} + environment: + - BCD_ENV=sandbox + - GIN_MODE=debug + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + - SANDBOX_NODE_URI=https://basenet-baking-node.mavryk.network + - SANDBOX_IPFS_GATEWAY=https://cloudflare-ipfs.com + depends_on: + - db + ports: + - 127.0.0.1:14000:14000 + volumes: + - bcdshare:/etc/bcd + logging: *bcd-logging + + indexer: + restart: always + image: mavrykdynamics/bcdhub-indexer:${TAG} + environment: + - BCD_ENV=sandbox + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + - SANDBOX_NODE_URI=https://basenet-baking-node.mavryk.network + - SANDBOX_IPFS_GATEWAY=https://cloudflare-ipfs.com + depends_on: + - db + volumes: + - bcdshare:/etc/bcd + logging: *bcd-logging + + gui: + container_name: sandbox-gui + restart: always + image: mavrykdynamics/bcdhub-gui:${TAG} + depends_on: + - api + ports: + - 127.0.0.1:8000:80 + logging: *bcd-logging + +volumes: + bcdshare: + db: + driver: local \ No newline at end of file diff --git a/internal/bcd/ast/bytes_test.go b/internal/bcd/ast/bytes_test.go index 15298edce..10557cd9b 100644 --- a/internal/bcd/ast/bytes_test.go +++ b/internal/bcd/ast/bytes_test.go @@ -23,7 +23,7 @@ func TestBytes_ToMiguel(t *testing.T) { Prim: "bytes", Type: "bytes", Name: testsuite.Ptr("@bytes_1"), - Value: `{ Pair "ledger" "tz1b1L4P8P1ucwuqCEP1Hxs7KB68CX8prFCp" }`, + Value: `{ Pair "ledger" "mv1PNoMySkKGCDh4LYwrXnZ8UBx6kufz8Jdt" }`, }, }, } diff --git a/internal/bcd/ast/validators_test.go b/internal/bcd/ast/validators_test.go index 1c5693412..f1320d819 100644 --- a/internal/bcd/ast/validators_test.go +++ b/internal/bcd/ast/validators_test.go @@ -22,7 +22,7 @@ func TestAddressValidator(t *testing.T) { wantErr: false, }, { name: "test 3", - value: "tz1KfEsrtDaA1sX7vdM4qmEPWuSytuqCDp5j", + value: "mv182iBTCasWb9JM4wuv5avQfvJxTJMdCLQG", wantErr: false, }, { name: "test 4", diff --git a/internal/bcd/consts/primitives.go b/internal/bcd/consts/primitives.go index 66da4a062..76173cc99 100644 --- a/internal/bcd/consts/primitives.go +++ b/internal/bcd/consts/primitives.go @@ -32,7 +32,7 @@ const ( OPERATION = "operation" INT = "int" BYTES = "bytes" - MUTEZ = "mutez" + MUTEZ = "mumav" BOOL = "bool" KEYHASH = "key_hash" TIMESTAMP = "timestamp" diff --git a/internal/bcd/encoding/base58.go b/internal/bcd/encoding/base58.go index 9e5cadc52..ea2eccd30 100644 --- a/internal/bcd/encoding/base58.go +++ b/internal/bcd/encoding/base58.go @@ -25,10 +25,10 @@ const ( PrefixOperationListListHash = "LLo" PrefixProtocolHash = "P" PrefixContextHash = "Co" - PrefixPublicKeyTZ1 = "tz1" - PrefixPublicKeyTZ2 = "tz2" - PrefixPublicKeyTZ3 = "tz3" - PrefixPublicKeyTZ4 = "tz4" + PrefixPublicKeyTZ1 = "mv1" + PrefixPublicKeyTZ2 = "mv2" + PrefixPublicKeyTZ3 = "mv3" + PrefixPublicKeyTZ4 = "mv4" PrefixPublicKeyKT1 = "KT1" PrefixPublicKeyTxr1 = "txr1" PrefixOriginatedSmartRollup = "sr1" @@ -72,10 +72,10 @@ var base58Encodings = []base58Encoding{ {[]byte(PrefixProtocolHash), 51, []byte{2, 170}, 32, "protocol hash"}, {[]byte(PrefixContextHash), 52, []byte{79, 199}, 32, "context hash"}, - {[]byte(PrefixPublicKeyTZ1), 36, []byte{6, 161, 159}, 20, "ed25519 public key hash"}, - {[]byte(PrefixPublicKeyTZ2), 36, []byte{6, 161, 161}, 20, "secp256k1 public key hash"}, - {[]byte(PrefixPublicKeyTZ3), 36, []byte{6, 161, 164}, 20, "p256 public key hash"}, - {[]byte(PrefixPublicKeyTZ4), 36, []byte{6, 161, 166}, 20, "BLS-MinPk"}, + {[]byte(PrefixPublicKeyTZ1), 36, []byte{5, 186, 196}, 20, "ed25519 public key hash"}, + {[]byte(PrefixPublicKeyTZ2), 36, []byte{5, 186, 199}, 20, "secp256k1 public key hash"}, + {[]byte(PrefixPublicKeyTZ3), 36, []byte{5, 186, 201}, 20, "p256 public key hash"}, + {[]byte(PrefixPublicKeyTZ4), 36, []byte{5, 186, 204}, 20, "BLS-MinPk"}, {[]byte(PrefixPublicKeyKT1), 36, []byte{2, 90, 121}, 20, "Originated address"}, {[]byte(PrefixPublicKeyTxr1), 37, []byte{1, 128, 120, 31}, 20, "Rollup address"}, diff --git a/internal/bcd/forge/domaintypes_test.go b/internal/bcd/forge/domaintypes_test.go index cadafbad4..2b64abd32 100644 --- a/internal/bcd/forge/domaintypes_test.go +++ b/internal/bcd/forge/domaintypes_test.go @@ -148,7 +148,7 @@ func TestUnforgeAddress(t *testing.T) { }, { name: "test 2", str: "00003a96709901319a5da2968782279dae581b9ba4", - want: "tz1KfEsrtDaA1sX7vdM4qmEPWuSytuqCDp5j", + want: "mv182iBTCasWb9JM4wuv5avQfvJxTJMdCLQG", }, } for _, tt := range tests { diff --git a/internal/bcd/forge/unpacking_test.go b/internal/bcd/forge/unpacking_test.go index b661bf3a2..9f98ffd0e 100644 --- a/internal/bcd/forge/unpacking_test.go +++ b/internal/bcd/forge/unpacking_test.go @@ -27,8 +27,8 @@ func TestCollectStrings(t *testing.T) { tree: `{"args":[{"bytes": "00000c9b9e93efaac92e71f2c1ec48bb35848efeba70"},{"bytes": "0000b240dadc291b4fd6f1328f60ed463264c0d17e97"}],"prim": "Pair"}`, tryUnpack: true, want: []string{ - "tz1LnhE3qb44rE9vBYLwPxcRoJVTpCNxqSGy", - "tz1btYfTs5YhJZSfXB1pTf3L4SHfi3Ks1zeh", + "mv19AAXe9xMRRVw9KrundnJSxKMSNas4cisy", + "mv1QG1y4BSr3sqDtfVafhUjMDT9eGRrZMHwd", }, }, { name: "bytes with unpack", @@ -80,14 +80,14 @@ func TestCollectStrings(t *testing.T) { tree: `{"bytes": "00012ffebbf1560632ca767bc960ccdb84669d284c2c"}`, tryUnpack: true, want: []string{ - "tz2Ch1abG7FNiibmV26Uzgdsnfni9XGrk5wD", + "mv2QQ5sHsmFuksCRmRgkZpp2DUHBxrZkQzcZ", }, }, { name: "tz3", tree: `{"bytes": "000247d8c0238fc2f5a3b6c2e16b19a2283323dfdbba"}`, tryUnpack: true, want: []string{ - "tz3SswFNdm14VehWk2kL6LxeQxgJib67syej", + "mv3FFQYxx8JR4vUjtMKBLAefZyYHGycEazFF", }, }, { name: "KT1", diff --git a/internal/parsers/operations/data/rpc/opg/oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8.json b/internal/parsers/operations/data/rpc/opg/oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8.json index 6a7444170..6a9053253 100644 --- a/internal/parsers/operations/data/rpc/opg/oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8.json +++ b/internal/parsers/operations/data/rpc/opg/oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8.json @@ -1 +1 @@ -{"protocol":"PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i","chain_id":"NetXdQprcVkpaWU","hash":"oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8","branch":"BLwNtdMw1VQqHBJ3G5XF8Dzzfh4YYvErH2wzHoP5h2jjNWiqYUA","contents":[{"kind":"transaction","source":"tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT","fee":"5043","counter":"10671622","gas_limit":"46511","storage_limit":"400","amount":"0","destination":"KT1H1MqmUM4aK9i1833EBmYCCEfkbt6ZdSBc","parameters":{"entrypoint":"update_record","value":{"prim":"Pair","args":[{"bytes":"62616c6c732e74657a"},{"prim":"Pair","args":[{"prim":"Some","args":[{"string":"tz1dDQc4KsTHEFe3USc66Wti2pBatZ3UDbD4"}]},{"prim":"Pair","args":[{"string":"tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT"},[]]}]}]}},"metadata":{"balance_updates":[{"kind":"contract","contract":"tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT","change":"-5043","origin":"block"},{"kind":"freezer","category":"fees","delegate":"tz1irJKkXS2DBWkU1NnmFQx1c1L7pbGg4yhk","cycle":371,"change":"5043","origin":"block"}],"operation_result":{"status":"applied","storage":{"prim":"Pair","args":[{"prim":"Pair","args":[{"bytes":"01535d971759846a1f2be8610e36f2db40fe8ce40800"},{"int":"1268"}]},{"bytes":"01ebb657570e494e8a7bd43ac3bf7cfd0267a32a9f00"}]},"big_map_diff":[],"consumed_gas":"19466","consumed_milligas":"19465257","storage_size":"1005","lazy_storage_diff":[{"kind":"big_map","id":"1268","diff":{"action":"update","updates":[]}}]},"internal_operation_results":[{"kind":"transaction","source":"KT1H1MqmUM4aK9i1833EBmYCCEfkbt6ZdSBc","nonce":0,"amount":"0","destination":"KT1GBZmSxmnKJXGMdMLbugPfLyUPmuLSMwKS","parameters":{"entrypoint":"execute","value":{"prim":"Pair","args":[{"string":"UpdateRecord"},{"prim":"Pair","args":[{"bytes":"0507070a0000000962616c6c732e74657a070705090a000000160000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c07070a000000160000753f63893674b6d523f925f0d787bf9270b95c330200000000"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]}]}},"result":{"status":"applied","storage":{"prim":"Pair","args":[[{"int":"1260"},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"1261"},{"int":"1262"}]},{"prim":"Pair","args":[{"int":"1263"},{"int":"9824"}]}]},{"prim":"Pair","args":[{"bytes":"01ebb657570e494e8a7bd43ac3bf7cfd0267a32a9f00"},{"int":"1264"}]},{"int":"1265"},{"int":"1266"}],[{"bytes":"014796e76af90e6327adfab057bbbe0375cd2c8c1000"},{"bytes":"015c6799f783b8d118b704267f634c5d24d19e9a9f00"},{"bytes":"0168e9b7d86646e312c76dfbedcbcdb24320875a3600"},{"bytes":"019178a76f3c41a9541d2291cad37dd5fb96a6850500"},{"bytes":"01ac3638385caa4ad8126ea84e061f4f49baa44d3c00"},{"bytes":"01d2a0974172cf6fc8b1eefdebd5bea681616f7c6f00"}]]},"big_map_diff":[{"action":"update","big_map":"1264","key_hash":"exprvKwnhi4q3tSmdvgqXACxfN6zARGkoikHv7rqohvQKg4cWdgsii","key":{"bytes":"62616c6c732e74657a"},"value":{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"0000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c"}]},[]]},{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"62616c6c732e74657a"}]},[]]}]},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"2"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]},{"prim":"Some","args":[{"int":"3223"}]}]}]}}],"balance_updates":[{"kind":"contract","contract":"tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT","change":"-6750","origin":"block"}],"consumed_gas":"26965","consumed_milligas":"26964942","storage_size":"3517552","paid_storage_size_diff":"27","lazy_storage_diff":[{"kind":"big_map","id":"1266","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1265","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1264","diff":{"action":"update","updates":[{"key_hash":"exprvKwnhi4q3tSmdvgqXACxfN6zARGkoikHv7rqohvQKg4cWdgsii","key":{"bytes":"62616c6c732e74657a"},"value":{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"0000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c"}]},[]]},{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"62616c6c732e74657a"}]},[]]}]},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"2"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]},{"prim":"Some","args":[{"int":"3223"}]}]}]}}]}},{"kind":"big_map","id":"1263","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1262","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1261","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1260","diff":{"action":"update","updates":[]}}]}}]}}],"signature":"siggDHax85cnXDNH65RnioGX1cmECRg9EdAk7zQ9Jq52Q5rdJnLNYLu5W1nWAWph68TH28gRHvZZF9FfcTtgN38npsok1ov9"} \ No newline at end of file +{"protocol":"PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i","chain_id":"NetXdQprcVkpaWU","hash":"oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8","branch":"BLwNtdMw1VQqHBJ3G5XF8Dzzfh4YYvErH2wzHoP5h2jjNWiqYUA","contents":[{"kind":"transaction","source":"mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i","fee":"5043","counter":"10671622","gas_limit":"46511","storage_limit":"400","amount":"0","destination":"KT1H1MqmUM4aK9i1833EBmYCCEfkbt6ZdSBc","parameters":{"entrypoint":"update_record","value":{"prim":"Pair","args":[{"bytes":"62616c6c732e74657a"},{"prim":"Pair","args":[{"prim":"Some","args":[{"string":"mv1RasueeEkdoXRGcmAwLLajBq3ZSwX13eX2"}]},{"prim":"Pair","args":[{"string":"mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i"},[]]}]}]}},"metadata":{"balance_updates":[{"kind":"contract","contract":"mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i","change":"-5043","origin":"block"},{"kind":"freezer","category":"fees","delegate":"tz1irJKkXS2DBWkU1NnmFQx1c1L7pbGg4yhk","cycle":371,"change":"5043","origin":"block"}],"operation_result":{"status":"applied","storage":{"prim":"Pair","args":[{"prim":"Pair","args":[{"bytes":"01535d971759846a1f2be8610e36f2db40fe8ce40800"},{"int":"1268"}]},{"bytes":"01ebb657570e494e8a7bd43ac3bf7cfd0267a32a9f00"}]},"big_map_diff":[],"consumed_gas":"19466","consumed_milligas":"19465257","storage_size":"1005","lazy_storage_diff":[{"kind":"big_map","id":"1268","diff":{"action":"update","updates":[]}}]},"internal_operation_results":[{"kind":"transaction","source":"KT1H1MqmUM4aK9i1833EBmYCCEfkbt6ZdSBc","nonce":0,"amount":"0","destination":"KT1GBZmSxmnKJXGMdMLbugPfLyUPmuLSMwKS","parameters":{"entrypoint":"execute","value":{"prim":"Pair","args":[{"string":"UpdateRecord"},{"prim":"Pair","args":[{"bytes":"0507070a0000000962616c6c732e74657a070705090a000000160000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c07070a000000160000753f63893674b6d523f925f0d787bf9270b95c330200000000"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]}]}},"result":{"status":"applied","storage":{"prim":"Pair","args":[[{"int":"1260"},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"1261"},{"int":"1262"}]},{"prim":"Pair","args":[{"int":"1263"},{"int":"9824"}]}]},{"prim":"Pair","args":[{"bytes":"01ebb657570e494e8a7bd43ac3bf7cfd0267a32a9f00"},{"int":"1264"}]},{"int":"1265"},{"int":"1266"}],[{"bytes":"014796e76af90e6327adfab057bbbe0375cd2c8c1000"},{"bytes":"015c6799f783b8d118b704267f634c5d24d19e9a9f00"},{"bytes":"0168e9b7d86646e312c76dfbedcbcdb24320875a3600"},{"bytes":"019178a76f3c41a9541d2291cad37dd5fb96a6850500"},{"bytes":"01ac3638385caa4ad8126ea84e061f4f49baa44d3c00"},{"bytes":"01d2a0974172cf6fc8b1eefdebd5bea681616f7c6f00"}]]},"big_map_diff":[{"action":"update","big_map":"1264","key_hash":"exprvKwnhi4q3tSmdvgqXACxfN6zARGkoikHv7rqohvQKg4cWdgsii","key":{"bytes":"62616c6c732e74657a"},"value":{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"0000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c"}]},[]]},{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"62616c6c732e74657a"}]},[]]}]},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"2"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]},{"prim":"Some","args":[{"int":"3223"}]}]}]}}],"balance_updates":[{"kind":"contract","contract":"mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i","change":"-6750","origin":"block"}],"consumed_gas":"26965","consumed_milligas":"26964942","storage_size":"3517552","paid_storage_size_diff":"27","lazy_storage_diff":[{"kind":"big_map","id":"1266","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1265","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1264","diff":{"action":"update","updates":[{"key_hash":"exprvKwnhi4q3tSmdvgqXACxfN6zARGkoikHv7rqohvQKg4cWdgsii","key":{"bytes":"62616c6c732e74657a"},"value":{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"0000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c"}]},[]]},{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"62616c6c732e74657a"}]},[]]}]},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"2"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]},{"prim":"Some","args":[{"int":"3223"}]}]}]}}]}},{"kind":"big_map","id":"1263","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1262","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1261","diff":{"action":"update","updates":[]}},{"kind":"big_map","id":"1260","diff":{"action":"update","updates":[]}}]}}]}}],"signature":"siggDHax85cnXDNH65RnioGX1cmECRg9EdAk7zQ9Jq52Q5rdJnLNYLu5W1nWAWph68TH28gRHvZZF9FfcTtgN38npsok1ov9"} \ No newline at end of file diff --git a/internal/parsers/operations/operation_group_test.go b/internal/parsers/operations/operation_group_test.go index cca2cfe2f..5672f7d2c 100644 --- a/internal/parsers/operations/operation_group_test.go +++ b/internal/parsers/operations/operation_group_test.go @@ -1449,14 +1449,14 @@ func TestGroup_Parse(t *testing.T) { Kind: types.OperationKindTransaction, Hash: encoding.MustDecodeBase58("oocFt4vkkgQGfoRH54328cJUbDdWvj3x6KEs5Arm4XhqwwJmnJ8"), Source: account.Account{ - Address: "tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT", + Address: "mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i", Type: types.AccountTypeTz, Level: 1520888, OperationsCount: 1, LastAction: timestamp, }, Initiator: account.Account{ - Address: "tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT", + Address: "mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i", Type: types.AccountTypeTz, Level: 1520888, OperationsCount: 1, @@ -1484,7 +1484,7 @@ func TestGroup_Parse(t *testing.T) { OperationsCount: 1, LastAction: timestamp, }, - Parameters: []byte(`{"entrypoint":"update_record","value":{"prim":"Pair","args":[{"bytes":"62616c6c732e74657a"},{"prim":"Pair","args":[{"prim":"Some","args":[{"string":"tz1dDQc4KsTHEFe3USc66Wti2pBatZ3UDbD4"}]},{"prim":"Pair","args":[{"string":"tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT"},[]]}]}]}}`), + Parameters: []byte(`{"entrypoint":"update_record","value":{"prim":"Pair","args":[{"bytes":"62616c6c732e74657a"},{"prim":"Pair","args":[{"prim":"Some","args":[{"string":"mv1RasueeEkdoXRGcmAwLLajBq3ZSwX13eX2"}]},{"prim":"Pair","args":[{"string":"mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i"},[]]}]}]}}`), DeffatedStorage: []byte(`{"prim":"Pair","args":[{"prim":"Pair","args":[{"bytes":"01535d971759846a1f2be8610e36f2db40fe8ce40800"},{"int":"1268"}]},{"bytes":"01ebb657570e494e8a7bd43ac3bf7cfd0267a32a9f00"}]}`), }, { @@ -1503,7 +1503,7 @@ func TestGroup_Parse(t *testing.T) { Valid: true, }, Initiator: account.Account{ - Address: "tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT", + Address: "mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i", Type: types.AccountTypeTz, Level: 1520888, OperationsCount: 1, diff --git a/internal/parsers/storage/helpers_test.go b/internal/parsers/storage/helpers_test.go index 550a25b5b..f0fb2fabc 100644 --- a/internal/parsers/storage/helpers_test.go +++ b/internal/parsers/storage/helpers_test.go @@ -22,9 +22,9 @@ func Test_GetStrings(t *testing.T) { name: "test 2", data: []byte(`{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"0000c0ca282a775946b5ecbe02e5cf73e25f6b62b70c"}]},[]]},{"prim":"Pair","args":[{"prim":"Some","args":[{"bytes":"62616c6c732e74657a"}]},[]]}]},{"prim":"Pair","args":[{"prim":"Pair","args":[{"int":"2"},{"bytes":"0000753f63893674b6d523f925f0d787bf9270b95c33"}]},{"prim":"Some","args":[{"int":"3223"}]}]}]}`), want: []string{ - "tz1dDQc4KsTHEFe3USc66Wti2pBatZ3UDbD4", + "mv1RasueeEkdoXRGcmAwLLajBq3ZSwX13eX2", "balls.tez", - "tz1WKygtstVY96oyc6Rmk945dMf33LeihgWT", + "mv1JhSzVCFntiNbCkQzcyxk6nNX1bj9VSR7i", }, }, }